|
@@ -255,8 +255,9 @@
|
|
|
<if test="auditTime != null">audit_time = #{auditTime},</if>
|
|
<if test="auditTime != null">audit_time = #{auditTime},</if>
|
|
|
<if test="diseaseName != null">disease_name = #{diseaseName},</if>
|
|
<if test="diseaseName != null">disease_name = #{diseaseName},</if>
|
|
|
<if test="isReturnGoods != null">is_return_goods = #{isReturnGoods},</if>
|
|
<if test="isReturnGoods != null">is_return_goods = #{isReturnGoods},</if>
|
|
|
- update_by = #{updateBy},
|
|
|
|
|
- update_time = #{updateTime}
|
|
|
|
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
|
+ <if test="params != null and params.clearUpdateTime != null and params.clearUpdateTime == true">update_time = null,</if>
|
|
|
</trim>
|
|
</trim>
|
|
|
where order_id = #{orderId}
|
|
where order_id = #{orderId}
|
|
|
</update>
|
|
</update>
|
|
@@ -280,7 +281,8 @@
|
|
|
o.user_id AS userId,
|
|
o.user_id AS userId,
|
|
|
c.company_name AS companyName,
|
|
c.company_name AS companyName,
|
|
|
d.dept_name AS deptName,
|
|
d.dept_name AS deptName,
|
|
|
- cu.user_name AS companyUserName,
|
|
|
|
|
|
|
+ cu.nick_name AS companyUserName,
|
|
|
|
|
+ cu.user_id AS companyUserId,
|
|
|
o.user_name AS userName,
|
|
o.user_name AS userName,
|
|
|
o.user_phone AS userPhone,
|
|
o.user_phone AS userPhone,
|
|
|
u.phone AS memberPhone,
|
|
u.phone AS memberPhone,
|
|
@@ -320,6 +322,7 @@
|
|
|
o.delivery_update_time AS deliveryUpdateTime,
|
|
o.delivery_update_time AS deliveryUpdateTime,
|
|
|
o.follow_time AS followTime,
|
|
o.follow_time AS followTime,
|
|
|
o.update_time AS updateTime,
|
|
o.update_time AS updateTime,
|
|
|
|
|
+ CASE WHEN o.status = 4 THEN o.update_time ELSE NULL END AS returnTime,
|
|
|
o.deposit_return_time AS depositReturnTime,
|
|
o.deposit_return_time AS depositReturnTime,
|
|
|
o.refund_price AS refundPrice,
|
|
o.refund_price AS refundPrice,
|
|
|
o.refund_time AS refundTime,
|
|
o.refund_time AS refundTime,
|
|
@@ -360,7 +363,7 @@
|
|
|
<if test="orderCode != null and orderCode != ''"> AND FIND_IN_SET(IFNULL(o.order_code, ''), #{orderCode}) > 0</if>
|
|
<if test="orderCode != null and orderCode != ''"> AND FIND_IN_SET(IFNULL(o.order_code, ''), #{orderCode}) > 0</if>
|
|
|
<if test="userId != null"> AND FIND_IN_SET(IFNULL(o.user_id, ''), #{userId}) > 0</if>
|
|
<if test="userId != null"> AND FIND_IN_SET(IFNULL(o.user_id, ''), #{userId}) > 0</if>
|
|
|
<if test="companyUserId != null"> AND FIND_IN_SET(IFNULL(o.company_user_id, ''), #{companyUserId}) > 0</if>
|
|
<if test="companyUserId != null"> AND FIND_IN_SET(IFNULL(o.company_user_id, ''), #{companyUserId}) > 0</if>
|
|
|
- <if test="companyUserName != null and companyUserName != ''"><choose><when test='companyUserName.contains(",")'> AND FIND_IN_SET(IFNULL(cu.user_name, ''), #{companyUserName}) > 0</when><otherwise> AND cu.user_name LIKE CONCAT('%', #{companyUserName}, '%')</otherwise></choose></if>
|
|
|
|
|
|
|
+ <if test="companyUserName != null and companyUserName != ''"><choose><when test='companyUserName.contains(",")'> AND FIND_IN_SET(IFNULL(cu.nick_name, ''), #{companyUserName}) > 0</when><otherwise> AND cu.nick_name LIKE CONCAT('%', #{companyUserName}, '%')</otherwise></choose></if>
|
|
|
<if test="deptId != null"> AND cu.dept_id = #{deptId}</if>
|
|
<if test="deptId != null"> AND cu.dept_id = #{deptId}</if>
|
|
|
<if test="userName != null and userName != ''"><choose><when test='userName.contains(",")'> AND FIND_IN_SET(IFNULL(o.user_name, ''), #{userName}) > 0</when><otherwise> AND o.user_name LIKE CONCAT('%', #{userName}, '%')</otherwise></choose></if>
|
|
<if test="userName != null and userName != ''"><choose><when test='userName.contains(",")'> AND FIND_IN_SET(IFNULL(o.user_name, ''), #{userName}) > 0</when><otherwise> AND o.user_name LIKE CONCAT('%', #{userName}, '%')</otherwise></choose></if>
|
|
|
<if test="userPhone != null and userPhone != ''"> AND FIND_IN_SET(IFNULL(o.user_phone, ''), #{userPhone}) > 0</if>
|
|
<if test="userPhone != null and userPhone != ''"> AND FIND_IN_SET(IFNULL(o.user_phone, ''), #{userPhone}) > 0</if>
|
|
@@ -487,7 +490,8 @@
|
|
|
o.create_time AS createTime,
|
|
o.create_time AS createTime,
|
|
|
c.company_name AS companyName,
|
|
c.company_name AS companyName,
|
|
|
d.dept_name AS deptName,
|
|
d.dept_name AS deptName,
|
|
|
- cu.nick_name AS companyUserName
|
|
|
|
|
|
|
+ cu.nick_name AS companyUserName,
|
|
|
|
|
+ cu.user_id AS companyUserId
|
|
|
FROM fs_external_order o
|
|
FROM fs_external_order o
|
|
|
LEFT JOIN company c ON o.company_id = c.company_id
|
|
LEFT JOIN company c ON o.company_id = c.company_id
|
|
|
LEFT JOIN company_user cu ON o.company_user_id = cu.user_id
|
|
LEFT JOIN company_user cu ON o.company_user_id = cu.user_id
|
|
@@ -517,7 +521,7 @@
|
|
|
o.order_id AS orderId,
|
|
o.order_id AS orderId,
|
|
|
o.order_code AS orderCode,
|
|
o.order_code AS orderCode,
|
|
|
o.external_create_time AS externalCreateTime,
|
|
o.external_create_time AS externalCreateTime,
|
|
|
- o.update_time AS returnTime,
|
|
|
|
|
|
|
+ CASE WHEN o.status = 4 THEN o.update_time ELSE NULL END AS returnTime,
|
|
|
o.update_by AS returnUser,
|
|
o.update_by AS returnUser,
|
|
|
o.user_name AS userName,
|
|
o.user_name AS userName,
|
|
|
o.delivery_name AS deliveryName,
|
|
o.delivery_name AS deliveryName,
|
|
@@ -528,10 +532,11 @@
|
|
|
o.return_price AS returnPrice,
|
|
o.return_price AS returnPrice,
|
|
|
o.receiver_phone AS receiverPhone,
|
|
o.receiver_phone AS receiverPhone,
|
|
|
GROUP_CONCAT(oi.product_name SEPARATOR ',') AS productNames,
|
|
GROUP_CONCAT(oi.product_name SEPARATOR ',') AS productNames,
|
|
|
|
|
+ GROUP_CONCAT(CONCAT(oi.product_name, '*', oi.num) SEPARATOR ',') AS productInfo,
|
|
|
IFNULL(SUM(oi.num), 0) AS productNum,
|
|
IFNULL(SUM(oi.num), 0) AS productNum,
|
|
|
o.remark,
|
|
o.remark,
|
|
|
o.delivery_time AS deliveryTime,
|
|
o.delivery_time AS deliveryTime,
|
|
|
- cu.user_name AS companyUserName,
|
|
|
|
|
|
|
+ cu.nick_name AS companyUserName,
|
|
|
c.company_name AS companyName,
|
|
c.company_name AS companyName,
|
|
|
d.dept_name AS deptName,
|
|
d.dept_name AS deptName,
|
|
|
o.pay_type AS payType,
|
|
o.pay_type AS payType,
|
|
@@ -557,6 +562,7 @@
|
|
|
<if test='returnStatus.contains("0") and !returnStatus.contains("1")'> AND o.status != 4</if>
|
|
<if test='returnStatus.contains("0") and !returnStatus.contains("1")'> AND o.status != 4</if>
|
|
|
</if>
|
|
</if>
|
|
|
<if test="returnUser != null and returnUser != ''"> AND o.update_by LIKE CONCAT('%', #{returnUser}, '%')</if>
|
|
<if test="returnUser != null and returnUser != ''"> AND o.update_by LIKE CONCAT('%', #{returnUser}, '%')</if>
|
|
|
|
|
+ <if test="(returnTimeStart != null and returnTimeStart != '') or (returnTimeEnd != null and returnTimeEnd != '')"> AND o.status = 4</if>
|
|
|
<if test="returnTimeStart != null and returnTimeStart != ''"> AND o.update_time >= #{returnTimeStart}</if>
|
|
<if test="returnTimeStart != null and returnTimeStart != ''"> AND o.update_time >= #{returnTimeStart}</if>
|
|
|
<if test="returnTimeEnd != null and returnTimeEnd != ''"> AND o.update_time <= #{returnTimeEnd}</if>
|
|
<if test="returnTimeEnd != null and returnTimeEnd != ''"> AND o.update_time <= #{returnTimeEnd}</if>
|
|
|
<if test="totalPrice != null"> AND o.total_price IN
|
|
<if test="totalPrice != null"> AND o.total_price IN
|
|
@@ -574,7 +580,7 @@
|
|
|
<if test="receiverPhone != null and receiverPhone != ''"> AND o.receiver_phone LIKE CONCAT('%', #{receiverPhone}, '%')</if>
|
|
<if test="receiverPhone != null and receiverPhone != ''"> AND o.receiver_phone LIKE CONCAT('%', #{receiverPhone}, '%')</if>
|
|
|
<if test="remark != null and remark != ''"><choose><when test='remark.contains(",")'> AND FIND_IN_SET(IFNULL(o.remark, ''), #{remark}) > 0</when><otherwise> AND o.remark LIKE CONCAT('%', #{remark}, '%')</otherwise></choose></if>
|
|
<if test="remark != null and remark != ''"><choose><when test='remark.contains(",")'> AND FIND_IN_SET(IFNULL(o.remark, ''), #{remark}) > 0</when><otherwise> AND o.remark LIKE CONCAT('%', #{remark}, '%')</otherwise></choose></if>
|
|
|
<if test="payType != null"> AND o.pay_type = #{payType}</if>
|
|
<if test="payType != null"> AND o.pay_type = #{payType}</if>
|
|
|
- <if test="companyUserName != null and companyUserName != ''"><choose><when test='companyUserName.contains(",")'> AND FIND_IN_SET(IFNULL(cu.user_name, ''), #{companyUserName}) > 0</when><otherwise> AND cu.user_name LIKE CONCAT('%', #{companyUserName}, '%')</otherwise></choose></if>
|
|
|
|
|
|
|
+ <if test="companyUserName != null and companyUserName != ''"><choose><when test='companyUserName.contains(",")'> AND FIND_IN_SET(IFNULL(cu.nick_name, ''), #{companyUserName}) > 0</when><otherwise> AND cu.nick_name LIKE CONCAT('%', #{companyUserName}, '%')</otherwise></choose></if>
|
|
|
<if test="deptId != null"> AND cu.dept_id = #{deptId}</if>
|
|
<if test="deptId != null"> AND cu.dept_id = #{deptId}</if>
|
|
|
<if test="sTime != null and sTime != ''"> AND o.external_create_time >= #{sTime}</if>
|
|
<if test="sTime != null and sTime != ''"> AND o.external_create_time >= #{sTime}</if>
|
|
|
<if test="eTime != null and eTime != ''"> AND o.external_create_time <= #{eTime}</if>
|
|
<if test="eTime != null and eTime != ''"> AND o.external_create_time <= #{eTime}</if>
|
|
@@ -615,6 +621,7 @@
|
|
|
cu.nick_name AS companyUserName,
|
|
cu.nick_name AS companyUserName,
|
|
|
d.dept_name AS deptName,
|
|
d.dept_name AS deptName,
|
|
|
GROUP_CONCAT(oi.product_name SEPARATOR ',') AS productNames,
|
|
GROUP_CONCAT(oi.product_name SEPARATOR ',') AS productNames,
|
|
|
|
|
+ GROUP_CONCAT(CONCAT(oi.product_name, '*', oi.num) SEPARATOR ',') AS productInfo,
|
|
|
o.delivery_time AS deliveryTime
|
|
o.delivery_time AS deliveryTime
|
|
|
FROM fs_external_order o
|
|
FROM fs_external_order o
|
|
|
LEFT JOIN company c ON o.company_id = c.company_id
|
|
LEFT JOIN company c ON o.company_id = c.company_id
|
|
@@ -722,6 +729,7 @@
|
|
|
o.receiver_phone AS memberPhone,
|
|
o.receiver_phone AS memberPhone,
|
|
|
cu.nick_name AS companyUserName,
|
|
cu.nick_name AS companyUserName,
|
|
|
GROUP_CONCAT(oi.product_name SEPARATOR ',') AS productNames,
|
|
GROUP_CONCAT(oi.product_name SEPARATOR ',') AS productNames,
|
|
|
|
|
+ GROUP_CONCAT(CONCAT(oi.product_name, '*', oi.num) SEPARATOR ',') AS productInfo,
|
|
|
o.user_address AS userAddress
|
|
o.user_address AS userAddress
|
|
|
FROM fs_external_order o
|
|
FROM fs_external_order o
|
|
|
LEFT JOIN company c ON o.company_id = c.company_id
|
|
LEFT JOIN company c ON o.company_id = c.company_id
|
|
@@ -1039,7 +1047,7 @@
|
|
|
<if test="orderCode != null and orderCode != ''"> AND FIND_IN_SET(IFNULL(o.order_code, ''), #{orderCode}) > 0</if>
|
|
<if test="orderCode != null and orderCode != ''"> AND FIND_IN_SET(IFNULL(o.order_code, ''), #{orderCode}) > 0</if>
|
|
|
<if test="userId != null"> AND FIND_IN_SET(IFNULL(o.user_id, ''), #{userId}) > 0</if>
|
|
<if test="userId != null"> AND FIND_IN_SET(IFNULL(o.user_id, ''), #{userId}) > 0</if>
|
|
|
<if test="companyUserId != null"> AND FIND_IN_SET(IFNULL(o.company_user_id, ''), #{companyUserId}) > 0</if>
|
|
<if test="companyUserId != null"> AND FIND_IN_SET(IFNULL(o.company_user_id, ''), #{companyUserId}) > 0</if>
|
|
|
- <if test="companyUserName != null and companyUserName != ''"><choose><when test='companyUserName.contains(",")'> AND FIND_IN_SET(IFNULL(cu.user_name, ''), #{companyUserName}) > 0</when><otherwise> AND cu.user_name LIKE CONCAT('%', #{companyUserName}, '%')</otherwise></choose></if>
|
|
|
|
|
|
|
+ <if test="companyUserName != null and companyUserName != ''"><choose><when test='companyUserName.contains(",")'> AND FIND_IN_SET(IFNULL(cu.nick_name, ''), #{companyUserName}) > 0</when><otherwise> AND cu.nick_name LIKE CONCAT('%', #{companyUserName}, '%')</otherwise></choose></if>
|
|
|
<if test="deptId != null"> AND cu.dept_id = #{deptId}</if>
|
|
<if test="deptId != null"> AND cu.dept_id = #{deptId}</if>
|
|
|
<if test="userName != null and userName != ''"><choose><when test='userName.contains(",")'> AND FIND_IN_SET(IFNULL(o.user_name, ''), #{userName}) > 0</when><otherwise> AND o.user_name LIKE CONCAT('%', #{userName}, '%')</otherwise></choose></if>
|
|
<if test="userName != null and userName != ''"><choose><when test='userName.contains(",")'> AND FIND_IN_SET(IFNULL(o.user_name, ''), #{userName}) > 0</when><otherwise> AND o.user_name LIKE CONCAT('%', #{userName}, '%')</otherwise></choose></if>
|
|
|
<if test="userPhone != null and userPhone != ''"> AND FIND_IN_SET(IFNULL(o.user_phone, ''), #{userPhone}) > 0</if>
|
|
<if test="userPhone != null and userPhone != ''"> AND FIND_IN_SET(IFNULL(o.user_phone, ''), #{userPhone}) > 0</if>
|
|
@@ -1143,6 +1151,7 @@
|
|
|
<if test='returnStatus.contains("0") and !returnStatus.contains("1")'> AND o.status != 4</if>
|
|
<if test='returnStatus.contains("0") and !returnStatus.contains("1")'> AND o.status != 4</if>
|
|
|
</if>
|
|
</if>
|
|
|
<if test="returnUser != null and returnUser != ''"> AND o.update_by LIKE CONCAT('%', #{returnUser}, '%')</if>
|
|
<if test="returnUser != null and returnUser != ''"> AND o.update_by LIKE CONCAT('%', #{returnUser}, '%')</if>
|
|
|
|
|
+ <if test="(returnTimeStart != null and returnTimeStart != '') or (returnTimeEnd != null and returnTimeEnd != '')"> AND o.status = 4</if>
|
|
|
<if test="returnTimeStart != null and returnTimeStart != ''"> AND o.update_time >= #{returnTimeStart}</if>
|
|
<if test="returnTimeStart != null and returnTimeStart != ''"> AND o.update_time >= #{returnTimeStart}</if>
|
|
|
<if test="returnTimeEnd != null and returnTimeEnd != ''"> AND o.update_time <= #{returnTimeEnd}</if>
|
|
<if test="returnTimeEnd != null and returnTimeEnd != ''"> AND o.update_time <= #{returnTimeEnd}</if>
|
|
|
<if test="totalPrice != null"> AND o.total_price IN
|
|
<if test="totalPrice != null"> AND o.total_price IN
|
|
@@ -1160,7 +1169,7 @@
|
|
|
<if test="receiverPhone != null and receiverPhone != ''"> AND o.receiver_phone LIKE CONCAT('%', #{receiverPhone}, '%')</if>
|
|
<if test="receiverPhone != null and receiverPhone != ''"> AND o.receiver_phone LIKE CONCAT('%', #{receiverPhone}, '%')</if>
|
|
|
<if test="remark != null and remark != ''"><choose><when test='remark.contains(",")'> AND FIND_IN_SET(IFNULL(o.remark, ''), #{remark}) > 0</when><otherwise> AND o.remark LIKE CONCAT('%', #{remark}, '%')</otherwise></choose></if>
|
|
<if test="remark != null and remark != ''"><choose><when test='remark.contains(",")'> AND FIND_IN_SET(IFNULL(o.remark, ''), #{remark}) > 0</when><otherwise> AND o.remark LIKE CONCAT('%', #{remark}, '%')</otherwise></choose></if>
|
|
|
<if test="payType != null"> AND o.pay_type = #{payType}</if>
|
|
<if test="payType != null"> AND o.pay_type = #{payType}</if>
|
|
|
- <if test="companyUserName != null and companyUserName != ''"><choose><when test='companyUserName.contains(",")'> AND FIND_IN_SET(IFNULL(cu.user_name, ''), #{companyUserName}) > 0</when><otherwise> AND cu.user_name LIKE CONCAT('%', #{companyUserName}, '%')</otherwise></choose></if>
|
|
|
|
|
|
|
+ <if test="companyUserName != null and companyUserName != ''"><choose><when test='companyUserName.contains(",")'> AND FIND_IN_SET(IFNULL(cu.nick_name, ''), #{companyUserName}) > 0</when><otherwise> AND cu.nick_name LIKE CONCAT('%', #{companyUserName}, '%')</otherwise></choose></if>
|
|
|
<if test="deptId != null"> AND cu.dept_id = #{deptId}</if>
|
|
<if test="deptId != null"> AND cu.dept_id = #{deptId}</if>
|
|
|
<if test="sTime != null and sTime != ''"> AND o.external_create_time >= #{sTime}</if>
|
|
<if test="sTime != null and sTime != ''"> AND o.external_create_time >= #{sTime}</if>
|
|
|
<if test="eTime != null and eTime != ''"> AND o.external_create_time <= #{eTime}</if>
|
|
<if test="eTime != null and eTime != ''"> AND o.external_create_time <= #{eTime}</if>
|