|
@@ -2,27 +2,38 @@
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.fjhx.victoriatourist.mapper.abnormal.AbnormalInfoMapper">
|
|
<mapper namespace="com.fjhx.victoriatourist.mapper.abnormal.AbnormalInfoMapper">
|
|
<select id="getPage" resultType="com.fjhx.victoriatourist.entity.abnormal.vo.AbnormalInfoVo">
|
|
<select id="getPage" resultType="com.fjhx.victoriatourist.entity.abnormal.vo.AbnormalInfoVo">
|
|
- select
|
|
|
|
- ai.id,
|
|
|
|
- ai.type,
|
|
|
|
- ai.link_id,
|
|
|
|
- ai.link_code,
|
|
|
|
- ai.title,
|
|
|
|
- ai.status,
|
|
|
|
- ai.handle_user,
|
|
|
|
- ai.handle_time,
|
|
|
|
- ai.remark,
|
|
|
|
- ai.create_user,
|
|
|
|
- ai.create_time,
|
|
|
|
- ai.update_user,
|
|
|
|
- ai.update_time,
|
|
|
|
- ai.purchase_id,
|
|
|
|
- li.code as logisticsCode
|
|
|
|
- <if test="businessType eq 10 or businessType eq 50">
|
|
|
|
- ,p.create_user purchaseUserId
|
|
|
|
- </if>
|
|
|
|
- from abnormal_info ai
|
|
|
|
- <!-- 到货质检 待入库 来源 -->
|
|
|
|
|
|
+ SELECT
|
|
|
|
+ ai.*,
|
|
|
|
+ li.code as logisticsCode
|
|
|
|
+ <if test="businessType eq 10 or businessType eq 50">
|
|
|
|
+ ,p.create_user purchaseUserId
|
|
|
|
+ </if>
|
|
|
|
+ FROM
|
|
|
|
+ (
|
|
|
|
+ SELECT
|
|
|
|
+ ai.id,
|
|
|
|
+ ai.type,
|
|
|
|
+ ai.link_id,
|
|
|
|
+ ai.link_code,
|
|
|
|
+ ai.title,
|
|
|
|
+ ai.`status`,
|
|
|
|
+ ai.handle_user,
|
|
|
|
+ ai.handle_time,
|
|
|
|
+ ai.remark,
|
|
|
|
+ ai.create_user,
|
|
|
|
+ ai.create_time,
|
|
|
|
+ ai.update_user,
|
|
|
|
+ ai.update_time,
|
|
|
|
+ ai.purchase_id,
|
|
|
|
+ ai.logistics_infos_id,
|
|
|
|
+ IFNULL( sum( ad.refund_amount ), 0 ) AS refundAmount
|
|
|
|
+ FROM
|
|
|
|
+ abnormal_info ai
|
|
|
|
+ LEFT JOIN abnormal_details ad ON ad.abnormal_info_id = ai.id
|
|
|
|
+ GROUP BY
|
|
|
|
+ ai.id
|
|
|
|
+ ) ai
|
|
|
|
+ <!-- 到货质检 待入库 来源 -->
|
|
<if test="businessType eq 10 or businessType eq 50">
|
|
<if test="businessType eq 10 or businessType eq 50">
|
|
left JOIN bytesailing_purchase.purchase p ON ai.purchase_id = p.id
|
|
left JOIN bytesailing_purchase.purchase p ON ai.purchase_id = p.id
|
|
LEFT JOIN bytesailing_purchase.purchase_detail pd ON pd.purchase_id = p.id
|
|
LEFT JOIN bytesailing_purchase.purchase_detail pd ON pd.purchase_id = p.id
|
|
@@ -40,7 +51,7 @@
|
|
left JOIN bytesailing_purchase.arrival_detail arrd ON arrd.arrival_id = arr.id and arr.del_flag = 0
|
|
left JOIN bytesailing_purchase.arrival_detail arrd ON arrd.arrival_id = arr.id and arr.del_flag = 0
|
|
LEFT JOIN bytesailing_item.product_info pi ON arrd.bussiness_id = pi.id
|
|
LEFT JOIN bytesailing_item.product_info pi ON arrd.bussiness_id = pi.id
|
|
</if>
|
|
</if>
|
|
- LEFT JOIN bytesailing_base.sys_dept de ON CAST(json_unquote(pi.victoriatourist_json -> '$.deptId') AS UNSIGNED) = de.dept_id
|
|
|
|
|
|
+ LEFT JOIN bytesailing_base.sys_dept de ON pi.deptIdWdly = de.dept_id
|
|
left join logistics_infos li on ai.logistics_infos_id = li.id
|
|
left join logistics_infos li on ai.logistics_infos_id = li.id
|
|
${ew.customSqlSegment}
|
|
${ew.customSqlSegment}
|
|
</select>
|
|
</select>
|