|
|
@@ -98,6 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<select id="selectFsStoreOrderList" parameterType="FsStoreOrderScrm" resultMap="FsStoreOrderResult">
|
|
|
<include refid="selectFsStoreOrderVo"/>
|
|
|
<where>
|
|
|
+ is_del = 0
|
|
|
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
|
|
|
<if test="extendOrderId != null and extendOrderId != ''"> and extend_order_id = #{extendOrderId}</if>
|
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
|
|
@@ -157,7 +158,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="selectFsStoreOrderById" parameterType="Long" resultMap="FsStoreOrderResult">
|
|
|
<include refid="selectFsStoreOrderVo"/>
|
|
|
- where id = #{id}
|
|
|
+ where id = #{id} and is_del = 0
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertFsStoreOrder" parameterType="FsStoreOrderScrm" useGeneratedKeys="true" keyProperty="id">
|
|
|
@@ -327,6 +328,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="customerId != null">#{customerId},</if>
|
|
|
<if test="isPayRemain != null">#{isPayRemain},</if>
|
|
|
<if test="deliverySendTime != null">#{deliverySendTime},</if>
|
|
|
+ <if test="scheduleId != null">#{scheduleId},</if>
|
|
|
<if test="orderVisit != null">#{orderVisit},</if>
|
|
|
<if test="serviceFee != null">#{serviceFee},</if>
|
|
|
<if test="orderMedium != null">#{orderMedium},</if>
|
|
|
@@ -434,12 +436,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
delete from fs_store_order_scrm where id = #{id}
|
|
|
</delete>
|
|
|
|
|
|
- <delete id="deleteFsStoreOrderByIds" parameterType="String">
|
|
|
- delete from fs_store_order_scrm where id in
|
|
|
+
|
|
|
+ <update id="deleteFsStoreOrderByIds" parameterType="java.util.List">
|
|
|
+ UPDATE fs_store_order_scrm
|
|
|
+ SET is_del = 1
|
|
|
+ WHERE id IN
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
- </delete>
|
|
|
+ </update>
|
|
|
|
|
|
<select id="selectFsStoreOrderCounts" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
SELECT count(t.id ) AS orderCount, t.type, sum(IFNULL(t.pay_price,0)) as payPrice
|
|
|
@@ -449,7 +454,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
FROM
|
|
|
fs_store_order_scrm AS o
|
|
|
<where>
|
|
|
- o.status > 0 and
|
|
|
+ o.status > 0 and o.is_del = 0 and
|
|
|
(DATE_FORMAT(o.create_time,#{sqlDateFormat}) between #{beginTime} and #{finalTime})
|
|
|
<if test="userIds != null and userIds.length>0">
|
|
|
AND o.company_user_id IN
|
|
|
@@ -473,6 +478,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
FROM
|
|
|
fs_store_order_scrm AS s
|
|
|
WHERE
|
|
|
+ s.is_del = 0 and
|
|
|
(DATE_FORMAT(s.create_time,#{sqlDateFormat}) between #{beginTime} and #{finalTime})
|
|
|
AND s.status>0
|
|
|
AND s.company_user_id IN
|
|
|
@@ -484,7 +490,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
|
|
|
<select id="selectFsStoreOrderStatisticsByUserId" resultType="com.fs.hisStore.domain.FsStoreOrderScrm">
|
|
|
- select * from fs_store_order_scrm where user_id in
|
|
|
+ select * from fs_store_order_scrm where is_del = 0 and user_id in
|
|
|
<foreach collection="ids" item='item' open='(' separator=',' close=')'>
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
@@ -501,6 +507,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
FROM
|
|
|
fs_store_order_scrm
|
|
|
WHERE
|
|
|
+ is_del = 0 and
|
|
|
<choose>
|
|
|
<when test="map.orderStatus != null and map.orderStatus != ''">
|
|
|
status = #{map.orderStatus}
|
|
|
@@ -528,6 +535,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<select id="selectFsStoreOrderCountByParam" resultType="int">
|
|
|
select count(id) from fs_store_order_scrm
|
|
|
<where>
|
|
|
+ is_del = 0
|
|
|
<if test="startTime != null and startTime != ''">AND date_format(create_time,'%y%m%d') >= date_format(#{startTime},'%y%m%d')</if>
|
|
|
<if test="endTime != null and endTime != ''">AND date_format(create_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')</if>
|
|
|
<if test="status != null"> and status = #{status}</if>
|
|
|
@@ -540,6 +548,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<select id="selectFsStoreOrderByPayPriceCount" resultType="java.math.BigDecimal">
|
|
|
select sum(pay_price) from fs_store_order_scrm
|
|
|
<where>
|
|
|
+ is_del = 0
|
|
|
<if test="paid != null"> and paid = #{paid}</if>
|
|
|
<if test="startTime != null and startTime != ''">AND date_format(create_time,'%y%m%d') >= date_format(#{startTime},'%y%m%d')</if>
|
|
|
<if test="endTime != null and endTime != ''">AND date_format(create_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')</if>
|
|
|
@@ -548,7 +557,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
<select id="selectFsStoreOrderTotalCount" resultType="java.lang.Long">
|
|
|
select count(1) from fs_store_order_scrm
|
|
|
- where 1=1
|
|
|
+ where is_del = 0
|
|
|
<if test = "type != null and type ==1 ">
|
|
|
and DATE_FORMAT(create_time, '%Y-%m-%d') = DATE_FORMAT(NOW(), '%Y-%m-%d')
|
|
|
</if>
|
|
|
@@ -820,6 +829,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
fs_store_order_scrm AS so
|
|
|
LEFT JOIN company_user u ON so.company_user_id = u.user_id
|
|
|
where
|
|
|
+ so.is_del = 0 and
|
|
|
(DATE_FORMAT(so.create_time,#{sqlDateFormat}) between #{beginTime} and #{finalTime})
|
|
|
<if test="userIds != null and userIds.length>0">AND so.company_user_id IN
|
|
|
<foreach item
|
|
|
@@ -834,7 +844,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
) o GROUP BY o.company_user_id
|
|
|
</select>
|
|
|
<select id="computePayMoney" resultMap="FsStoreOrderResult">
|
|
|
- SELECT o.customer_id,o.pay_price FROM fs_store_order_scrm o WHERE `status` = 3
|
|
|
+ SELECT o.customer_id,o.pay_price FROM fs_store_order_scrm o WHERE o.is_del = 0 and `status` = 3
|
|
|
and o.customer_id in
|
|
|
<foreach collection="customerIds" item="customerId" open="(" close=")" separator=",">
|
|
|
#{customerId}
|
|
|
@@ -842,7 +852,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
GROUP BY o.customer_id
|
|
|
</select>
|
|
|
<select id="selectLastByCustomerId" resultMap="FsStoreOrderResult">
|
|
|
- SELECT o.* FROM fs_store_order_scrm o WHERE `status` = 3
|
|
|
+ SELECT o.* FROM fs_store_order_scrm o WHERE o.is_del = 0 and `status` = 3
|
|
|
and o.customer_id = #{customerId}
|
|
|
order by o.create_time desc limit 1
|
|
|
</select>
|
|
|
@@ -864,7 +874,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
LEFT JOIN company_user u ON o.company_user_id = u.user_id
|
|
|
where i.product_id = #{productId}
|
|
|
and o.`status` = 3
|
|
|
- and
|
|
|
+ and o.is_del = 0 and
|
|
|
(DATE_FORMAT(o.create_time,#{sqlDateFormat}) between #{beginTime} and #{finalTime})
|
|
|
<if test="userIds != null and userIds.length>0">AND o.company_user_id IN
|
|
|
<foreach item="item" collection="userIds" open="(" separator="," close=")">
|
|
|
@@ -915,7 +925,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="selectStoreOrderScrmInId" resultType="com.fs.hisStore.domain.FsStoreOrderScrm">
|
|
|
<include refid="selectFsStoreOrderVo"/>
|
|
|
- where id IN <foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
|
|
|
+ where is_del = 0 and id IN <foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</select>
|
|
|
@@ -932,7 +942,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
INNER JOIN fs_user fu ON os.user_id = fu.user_id
|
|
|
INNER JOIN fs_store_order_item_scrm ois ON ois.order_id = os.id
|
|
|
INNER JOIN fs_store_payment_scrm sps ON os.id=sps.order_id
|
|
|
- WHERE os.id IN <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
|
|
|
+ WHERE os.is_del = 0 and os.id IN <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
AND sps.`status` = 1
|
|
|
@@ -946,6 +956,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
fs_store_order_scrm sos
|
|
|
INNER JOIN fs_store_payment_scrm sps ON sos.id = sps.order_id
|
|
|
WHERE
|
|
|
+ sos.is_del = 0 and
|
|
|
sos.paid = 1
|
|
|
AND sps.business_type = 2
|
|
|
AND sos.`status` = 2
|
|
|
@@ -990,6 +1001,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
) fp
|
|
|
ON o.id = fp.order_id
|
|
|
WHERE
|
|
|
+ o.is_del = 0 and
|
|
|
1 = 1
|
|
|
<if test="maps.orderCode != null and maps.orderCode != ''">
|
|
|
AND o.order_code LIKE CONCAT('%', #{maps.orderCode}, '%')
|