|
@@ -7,8 +7,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<resultMap type="IntegralOrder" id="IntegralOrderResult">
|
|
|
<result property="id" column="id" />
|
|
|
<result property="integralOrderNo" column="integral_order_no" />
|
|
|
- <result property="waresType" column="wares_type" />
|
|
|
<result property="waresName" column="wares_name" />
|
|
|
+ <result property="waresPic" column="wares_pic" />
|
|
|
+ <result property="waresDetail" column="wares_detail" />
|
|
|
<result property="waresId" column="wares_id" />
|
|
|
<result property="unionId" column="union_id" />
|
|
|
<result property="customerName" column="customer_name" />
|
|
@@ -23,28 +24,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectIntegralOrderVo">
|
|
|
- select id, integral_order_no, wares_type, wares_name, wares_id, union_id, customer_name, exchange_num, exchange_time,
|
|
|
- p.status, integral, station_id,d.dept_name as station_name,mobile_phone
|
|
|
- from integral_order p join sys_dept d on p.station_id =d.dept_id
|
|
|
+ select p.id, p.integral_order_no, w.wares_name, p.wares_id, p.union_id, p.customer_name, w.wares_pic,w.wares_detail,p.exchange_num,p.exchange_time,p.status, p.integral, p.station_id,d.dept_name as station_name,p.mobile_phone
|
|
|
+ from integral_order p
|
|
|
+ join sys_dept d on p.station_id =d.dept_id
|
|
|
+ join integral_wares w on p.wares_id = w.id
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectIntegralOrderList" parameterType="IntegralOrder" resultMap="IntegralOrderResult">
|
|
|
<include refid="selectIntegralOrderVo"/>
|
|
|
<where>
|
|
|
<if test="integralOrderNo != null and integralOrderNo != ''"> and integral_order_no like concat('%', #{integralOrderNo}, '%')</if>
|
|
|
- <if test="waresType != null and waresType != ''"> and wares_type = #{waresType}</if>
|
|
|
- <if test="waresName != null and waresName != ''"> and wares_name like concat('%', #{waresName}, '%')</if>
|
|
|
- <if test="waresId != null "> and wares_id = #{waresId}</if>
|
|
|
+ <if test="waresName != null and waresName != ''"> and w.wares_name like concat('%', #{waresName}, '%')</if>
|
|
|
+ <if test="waresId != null "> and p.wares_id = #{waresId}</if>
|
|
|
<if test="unionId != null and unionId != ''"> and union_id = #{unionId}</if>
|
|
|
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
|
|
|
<if test="exchangeNum != null "> and exchange_num = #{exchangeNum}</if>
|
|
|
<if test="exchangeTime != null "> and exchange_time = #{exchangeTime}</if>
|
|
|
<if test="status != null and status != ''"> and p.status = #{status}</if>
|
|
|
- <if test="integral != null "> and integral = #{integral}</if>
|
|
|
- <if test="stationId != null "> and station_id = #{stationId}</if>
|
|
|
- <if test="mobilePhone != null "> and mobile_phone = #{mobilePhone}</if>
|
|
|
+ <if test="integral != null "> and p.integral = #{integral}</if>
|
|
|
+ <if test="stationId != null "> and p.station_id = #{stationId}</if>
|
|
|
+ <if test="mobilePhone != null "> and p.mobile_phone = #{mobilePhone}</if>
|
|
|
<if test="stationIdList != null ">
|
|
|
- and station_id in
|
|
|
+ and p.station_id in
|
|
|
<foreach item="item" index="index" collection="stationIdList"
|
|
|
open="(" separator="," close=")">
|
|
|
#{item}
|
|
@@ -63,8 +64,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
insert into integral_order
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="integralOrderNo != null">integral_order_no,</if>
|
|
|
- <if test="waresType != null">wares_type,</if>
|
|
|
- <if test="waresName != null">wares_name,</if>
|
|
|
<if test="waresId != null">wares_id,</if>
|
|
|
<if test="unionId != null">union_id,</if>
|
|
|
<if test="customerName != null">customer_name,</if>
|
|
@@ -77,8 +76,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="integralOrderNo != null">#{integralOrderNo},</if>
|
|
|
- <if test="waresType != null">#{waresType},</if>
|
|
|
- <if test="waresName != null">#{waresName},</if>
|
|
|
<if test="waresId != null">#{waresId},</if>
|
|
|
<if test="unionId != null">#{unionId},</if>
|
|
|
<if test="customerName != null">#{customerName},</if>
|
|
@@ -95,8 +92,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
update integral_order
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
<if test="integralOrderNo != null">integral_order_no = #{integralOrderNo},</if>
|
|
|
- <if test="waresType != null">wares_type = #{waresType},</if>
|
|
|
- <if test="waresName != null">wares_name = #{waresName},</if>
|
|
|
<if test="waresId != null">wares_id = #{waresId},</if>
|
|
|
<if test="unionId != null">union_id = #{unionId},</if>
|
|
|
<if test="customerName != null">customer_name = #{customerName},</if>
|