Browse Source

[砍价][修改]:sql修改

release_toaliyun_real
Stormeye Wu 7 years ago
parent
commit
f62ec44f50
1 changed files with 23 additions and 6 deletions
  1. +23
    -6
      mallinkService/src/main/resources/mapper/WxOrderMapper.xml

+ 23
- 6
mallinkService/src/main/resources/mapper/WxOrderMapper.xml View File

@@ -15,10 +15,14 @@
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
<result column="detail" jdbcType="VARCHAR" property="detail"/>
<result column="press_end_date" jdbcType="TIMESTAMP" property="pressEndDate"/>
<result column="press_current_num" jdbcType="INTEGER" property="pressCurrentNum"/>
<result column="press_current_value" jdbcType="INTEGER" property="pressCurrentValue"/>
</resultMap>

<sql id="allColumns">
`id`,`order_number`,`tenant_id`,`c_user_id`,`product_id`,`type`,`payment_type`,`payment`,`payment_time`,`order_status`,`create_date`,`update_date`,`detail`
`id`,`order_number`,`tenant_id`,`c_user_id`,`product_id`,`type`,`payment_type`,`payment`,`payment_time`,`order_status`,`create_date`,`update_date`,`detail`,
`press_end_date`,`press_current_num`,`press_current_value`
</sql>

<sql id="dynamicWhereConditions">
@@ -75,6 +79,19 @@
<if test=" null != detail ">
and `detail` like concat('%', #{detail},'%')
</if>

<if test=" null != pressEndDate ">
and `press_end_date` = #{pressEndDate}
</if>

<if test=" null != pressCurrentNum ">
and `press_current_num` = #{pressCurrentNum}
</if>

<if test=" null != pressCurrentValue ">
and `press_current_value` = #{pressCurrentValue}
</if>

<if test=" null != ids ">
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
@@ -123,10 +140,10 @@
AND type = #{type,jdbcType=TINYINT}
</if>
<if test="startDate != null">
AND create_date &gt; #{startDate,jdbcType=TIMESTAMP}
AND `create_date` &gt; #{startDate,jdbcType=TIMESTAMP}
</if>
<if test="endDate != null">
AND create_date &lt; #{endDate,jdbcType=TIMESTAMP}
AND `create_date` &lt; #{endDate,jdbcType=TIMESTAMP}
</if>
</select>

@@ -139,10 +156,10 @@
AND type = #{type,jdbcType=TINYINT}
</if>
<if test="startDate != null">
AND create_date &gt; #{startDate,jdbcType=TIMESTAMP}
AND `create_date` &gt; #{startDate,jdbcType=TIMESTAMP}
</if>
<if test="endDate != null">
AND press_end_date &lt; #{endDate,jdbcType=TIMESTAMP}
AND `press_end_date` &lt; #{endDate,jdbcType=TIMESTAMP}
</if>
</select>

@@ -202,7 +219,7 @@
from wx_coupon c,wx_order o
left join wx_coupon_order co on co.order_id = o.id
left join wx_coupon_action_log cal on cal.coupon_order_id = co.id
where o.product_id = c.id
where o.product_id = c.id and c.type != 7 and c.type != 8
<if test="cUserId != null">
and o.c_user_id = #{cUserId}
</if>


Loading…
Cancel
Save