Commit 0c94316929590efc1376987a5f9a63bdba6f130b
1 parent
925806e6
fix: 适配商城、CRM 和 MES 布尔字段查询
Showing
4 changed files
with
30 additions
and
17 deletions
yudao-module-crm/src/main/resources/mapper/statistics/CrmStatisticsPortraitMapper.xml
| @@ -4,7 +4,8 @@ | @@ -4,7 +4,8 @@ | ||
| 4 | 4 | ||
| 5 | <select id="selectSummaryListGroupByAreaId" | 5 | <select id="selectSummaryListGroupByAreaId" |
| 6 | resultType="cn.iocoder.yudao.module.crm.controller.admin.statistics.vo.portrait.CrmStatisticCustomerAreaRespVO"> | 6 | resultType="cn.iocoder.yudao.module.crm.controller.admin.statistics.vo.portrait.CrmStatisticCustomerAreaRespVO"> |
| 7 | - SELECT area_id, COUNT(*) AS customerCount, SUM(deal_status) AS dealCount | 7 | + <bind name="trueValue" value="true"/> |
| 8 | + SELECT area_id, COUNT(*) AS customerCount, SUM(CASE WHEN deal_status = #{trueValue} THEN 1 WHEN deal_status IS NULL THEN NULL ELSE 0 END) AS dealCount | ||
| 8 | FROM crm_customer | 9 | FROM crm_customer |
| 9 | WHERE deleted = 0 AND area_id IS NOT NULL | 10 | WHERE deleted = 0 AND area_id IS NOT NULL |
| 10 | AND owner_user_id IN | 11 | AND owner_user_id IN |
| @@ -18,7 +19,8 @@ | @@ -18,7 +19,8 @@ | ||
| 18 | 19 | ||
| 19 | <select id="selectCustomerIndustryListGroupByIndustryId" | 20 | <select id="selectCustomerIndustryListGroupByIndustryId" |
| 20 | resultType="cn.iocoder.yudao.module.crm.controller.admin.statistics.vo.portrait.CrmStatisticCustomerIndustryRespVO"> | 21 | resultType="cn.iocoder.yudao.module.crm.controller.admin.statistics.vo.portrait.CrmStatisticCustomerIndustryRespVO"> |
| 21 | - SELECT industry_id, COUNT(*) AS customerCount, SUM(deal_status) AS dealCount | 22 | + <bind name="trueValue" value="true"/> |
| 23 | + SELECT industry_id, COUNT(*) AS customerCount, SUM(CASE WHEN deal_status = #{trueValue} THEN 1 WHEN deal_status IS NULL THEN NULL ELSE 0 END) AS dealCount | ||
| 22 | FROM crm_customer | 24 | FROM crm_customer |
| 23 | WHERE deleted = 0 AND industry_id IS NOT NULL | 25 | WHERE deleted = 0 AND industry_id IS NOT NULL |
| 24 | AND owner_user_id IN | 26 | AND owner_user_id IN |
| @@ -32,7 +34,8 @@ | @@ -32,7 +34,8 @@ | ||
| 32 | 34 | ||
| 33 | <select id="selectCustomerSourceListGroupBySource" | 35 | <select id="selectCustomerSourceListGroupBySource" |
| 34 | resultType="cn.iocoder.yudao.module.crm.controller.admin.statistics.vo.portrait.CrmStatisticCustomerSourceRespVO"> | 36 | resultType="cn.iocoder.yudao.module.crm.controller.admin.statistics.vo.portrait.CrmStatisticCustomerSourceRespVO"> |
| 35 | - SELECT source, COUNT(*) AS customerCount, SUM(deal_status) AS dealCount | 37 | + <bind name="trueValue" value="true"/> |
| 38 | + SELECT source, COUNT(*) AS customerCount, SUM(CASE WHEN deal_status = #{trueValue} THEN 1 WHEN deal_status IS NULL THEN NULL ELSE 0 END) AS dealCount | ||
| 36 | FROM crm_customer | 39 | FROM crm_customer |
| 37 | WHERE deleted = 0 AND source IS NOT NULL | 40 | WHERE deleted = 0 AND source IS NOT NULL |
| 38 | AND owner_user_id IN | 41 | AND owner_user_id IN |
| @@ -46,7 +49,8 @@ | @@ -46,7 +49,8 @@ | ||
| 46 | 49 | ||
| 47 | <select id="selectCustomerLevelListGroupByLevel" | 50 | <select id="selectCustomerLevelListGroupByLevel" |
| 48 | resultType="cn.iocoder.yudao.module.crm.controller.admin.statistics.vo.portrait.CrmStatisticCustomerLevelRespVO"> | 51 | resultType="cn.iocoder.yudao.module.crm.controller.admin.statistics.vo.portrait.CrmStatisticCustomerLevelRespVO"> |
| 49 | - SELECT level, COUNT(*) AS customerCount, SUM(deal_status) AS dealCount | 52 | + <bind name="trueValue" value="true"/> |
| 53 | + SELECT level, COUNT(*) AS customerCount, SUM(CASE WHEN deal_status = #{trueValue} THEN 1 WHEN deal_status IS NULL THEN NULL ELSE 0 END) AS dealCount | ||
| 50 | FROM crm_customer | 54 | FROM crm_customer |
| 51 | WHERE deleted = 0 AND level IS NOT NULL | 55 | WHERE deleted = 0 AND level IS NOT NULL |
| 52 | AND owner_user_id IN | 56 | AND owner_user_id IN |
yudao-module-mall/yudao-module-statistics/src/main/resources/mapper/product/ProductStatisticsMapper.xml
| @@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
| 4 | 4 | ||
| 5 | <select id="selectStatisticsResultPageByTimeBetween" | 5 | <select id="selectStatisticsResultPageByTimeBetween" |
| 6 | resultType="cn.iocoder.yudao.module.statistics.dal.dataobject.product.ProductStatisticsDO"> | 6 | resultType="cn.iocoder.yudao.module.statistics.dal.dataobject.product.ProductStatisticsDO"> |
| 7 | + <bind name="trueValue" value="true"/> | ||
| 7 | SELECT spu.id AS spuId | 8 | SELECT spu.id AS spuId |
| 8 | -- 浏览量:一个用户可以有多次 | 9 | -- 浏览量:一个用户可以有多次 |
| 9 | , (SELECT COUNT(1) | 10 | , (SELECT COUNT(1) |
| @@ -55,7 +56,7 @@ | @@ -55,7 +56,7 @@ | ||
| 55 | FROM trade_order_item item | 56 | FROM trade_order_item item |
| 56 | JOIN trade_order o ON item.order_id = o.id | 57 | JOIN trade_order o ON item.order_id = o.id |
| 57 | WHERE spu_id = spu.id | 58 | WHERE spu_id = spu.id |
| 58 | - AND o.pay_status = TRUE | 59 | + AND o.pay_status = #{trueValue} |
| 59 | AND item.create_time BETWEEN #{beginTime} AND #{endTime} | 60 | AND item.create_time BETWEEN #{beginTime} AND #{endTime} |
| 60 | <if test="@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId() != null"> | 61 | <if test="@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId() != null"> |
| 61 | AND item.tenant_id = ${@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId()} | 62 | AND item.tenant_id = ${@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId()} |
| @@ -67,7 +68,7 @@ | @@ -67,7 +68,7 @@ | ||
| 67 | FROM trade_order_item item | 68 | FROM trade_order_item item |
| 68 | JOIN trade_order o ON item.order_id = o.id | 69 | JOIN trade_order o ON item.order_id = o.id |
| 69 | WHERE spu_id = spu.id | 70 | WHERE spu_id = spu.id |
| 70 | - AND o.pay_status = TRUE | 71 | + AND o.pay_status = #{trueValue} |
| 71 | AND item.create_time BETWEEN #{beginTime} AND #{endTime} | 72 | AND item.create_time BETWEEN #{beginTime} AND #{endTime} |
| 72 | <if test="@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId() != null"> | 73 | <if test="@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId() != null"> |
| 73 | AND item.tenant_id = ${@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId()} | 74 | AND item.tenant_id = ${@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId()} |
yudao-module-mall/yudao-module-statistics/src/main/resources/mapper/trade/TradeOrderStatisticsMapper.xml
| @@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
| 4 | 4 | ||
| 5 | <select id="selectSummaryListByAreaId" | 5 | <select id="selectSummaryListByAreaId" |
| 6 | resultType="cn.iocoder.yudao.module.statistics.service.member.bo.MemberAreaStatisticsRespBO"> | 6 | resultType="cn.iocoder.yudao.module.statistics.service.member.bo.MemberAreaStatisticsRespBO"> |
| 7 | + <bind name="trueValue" value="true"/> | ||
| 7 | SELECT receiver_area_id AS areaId, | 8 | SELECT receiver_area_id AS areaId, |
| 8 | (SELECT COUNT(DISTINCT s.user_id) | 9 | (SELECT COUNT(DISTINCT s.user_id) |
| 9 | FROM trade_order s | 10 | FROM trade_order s |
| @@ -15,7 +16,7 @@ | @@ -15,7 +16,7 @@ | ||
| 15 | (SELECT COUNT(DISTINCT s.user_id) | 16 | (SELECT COUNT(DISTINCT s.user_id) |
| 16 | FROM trade_order s | 17 | FROM trade_order s |
| 17 | WHERE s.receiver_area_id = m.receiver_area_id | 18 | WHERE s.receiver_area_id = m.receiver_area_id |
| 18 | - AND s.pay_status = TRUE | 19 | + AND s.pay_status = #{trueValue} |
| 19 | AND s.deleted = 0 | 20 | AND s.deleted = 0 |
| 20 | <if test="@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId() != null"> | 21 | <if test="@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId() != null"> |
| 21 | AND s.tenant_id = ${@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId()} | 22 | AND s.tenant_id = ${@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId()} |
| @@ -24,7 +25,7 @@ | @@ -24,7 +25,7 @@ | ||
| 24 | (SELECT SUM(s.pay_price) | 25 | (SELECT SUM(s.pay_price) |
| 25 | FROM trade_order s | 26 | FROM trade_order s |
| 26 | WHERE s.receiver_area_id = m.receiver_area_id | 27 | WHERE s.receiver_area_id = m.receiver_area_id |
| 27 | - AND s.pay_status = TRUE | 28 | + AND s.pay_status = #{trueValue} |
| 28 | AND s.deleted = 0 | 29 | AND s.deleted = 0 |
| 29 | <if test="@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId() != null"> | 30 | <if test="@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId() != null"> |
| 30 | AND s.tenant_id = ${@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId()} | 31 | AND s.tenant_id = ${@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId()} |
| @@ -49,10 +50,11 @@ | @@ -49,10 +50,11 @@ | ||
| 49 | </select> | 50 | </select> |
| 50 | 51 | ||
| 51 | <select id="selectUserCountByPayTimeBetween" resultType="java.lang.Integer"> | 52 | <select id="selectUserCountByPayTimeBetween" resultType="java.lang.Integer"> |
| 53 | + <bind name="trueValue" value="true"/> | ||
| 52 | SELECT COUNT(DISTINCT (user_id)) | 54 | SELECT COUNT(DISTINCT (user_id)) |
| 53 | FROM trade_order | 55 | FROM trade_order |
| 54 | WHERE pay_time BETWEEN #{beginTime} AND #{endTime} | 56 | WHERE pay_time BETWEEN #{beginTime} AND #{endTime} |
| 55 | - AND pay_status = TRUE | 57 | + AND pay_status = #{trueValue} |
| 56 | AND deleted = 0 | 58 | AND deleted = 0 |
| 57 | <if test="@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId() != null"> | 59 | <if test="@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId() != null"> |
| 58 | AND tenant_id = ${@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId()} | 60 | AND tenant_id = ${@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId()} |
| @@ -70,9 +72,10 @@ | @@ -70,9 +72,10 @@ | ||
| 70 | </select> | 72 | </select> |
| 71 | 73 | ||
| 72 | <select id="selectCountByPayTimeBetween" resultType="java.lang.Integer"> | 74 | <select id="selectCountByPayTimeBetween" resultType="java.lang.Integer"> |
| 75 | + <bind name="trueValue" value="true"/> | ||
| 73 | SELECT COUNT(1) | 76 | SELECT COUNT(1) |
| 74 | FROM trade_order | 77 | FROM trade_order |
| 75 | - WHERE pay_status = TRUE | 78 | + WHERE pay_status = #{trueValue} |
| 76 | AND create_time BETWEEN #{beginTime} AND #{endTime} | 79 | AND create_time BETWEEN #{beginTime} AND #{endTime} |
| 77 | AND deleted = 0 | 80 | AND deleted = 0 |
| 78 | <if test="@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId() != null"> | 81 | <if test="@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId() != null"> |
| @@ -81,9 +84,10 @@ | @@ -81,9 +84,10 @@ | ||
| 81 | </select> | 84 | </select> |
| 82 | 85 | ||
| 83 | <select id="selectSummaryPriceByPayTimeBetween" resultType="java.lang.Integer"> | 86 | <select id="selectSummaryPriceByPayTimeBetween" resultType="java.lang.Integer"> |
| 87 | + <bind name="trueValue" value="true"/> | ||
| 84 | SELECT SUM(pay_price) | 88 | SELECT SUM(pay_price) |
| 85 | FROM trade_order s | 89 | FROM trade_order s |
| 86 | - WHERE s.pay_status = TRUE | 90 | + WHERE s.pay_status = #{trueValue} |
| 87 | AND deleted = 0 | 91 | AND deleted = 0 |
| 88 | AND create_time BETWEEN #{beginTime} AND #{endTime} | 92 | AND create_time BETWEEN #{beginTime} AND #{endTime} |
| 89 | <if test="@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId() != null"> | 93 | <if test="@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId() != null"> |
| @@ -99,11 +103,12 @@ | @@ -99,11 +103,12 @@ | ||
| 99 | </resultMap> | 103 | </resultMap> |
| 100 | 104 | ||
| 101 | <select id="selectListByPayTimeBetweenAndGroupByDay" resultMap="TradeOrderTrendRespVOMap"> | 105 | <select id="selectListByPayTimeBetweenAndGroupByDay" resultMap="TradeOrderTrendRespVOMap"> |
| 106 | + <bind name="trueValue" value="true"/> | ||
| 102 | SELECT ${@cn.iocoder.yudao.framework.mybatis.core.util.SqlDialectUtils@castDateText('pay_time')} AS statDate, | 107 | SELECT ${@cn.iocoder.yudao.framework.mybatis.core.util.SqlDialectUtils@castDateText('pay_time')} AS statDate, |
| 103 | COUNT(1) AS order_pay_count, | 108 | COUNT(1) AS order_pay_count, |
| 104 | SUM(pay_price) AS order_pay_price | 109 | SUM(pay_price) AS order_pay_price |
| 105 | FROM trade_order | 110 | FROM trade_order |
| 106 | - WHERE pay_status = TRUE | 111 | + WHERE pay_status = #{trueValue} |
| 107 | AND create_time BETWEEN #{beginTime} AND #{endTime} | 112 | AND create_time BETWEEN #{beginTime} AND #{endTime} |
| 108 | AND deleted = 0 | 113 | AND deleted = 0 |
| 109 | <if test="@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId() != null"> | 114 | <if test="@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId() != null"> |
| @@ -114,11 +119,12 @@ | @@ -114,11 +119,12 @@ | ||
| 114 | </select> | 119 | </select> |
| 115 | 120 | ||
| 116 | <select id="selectListByPayTimeBetweenAndGroupByMonth" resultMap="TradeOrderTrendRespVOMap"> | 121 | <select id="selectListByPayTimeBetweenAndGroupByMonth" resultMap="TradeOrderTrendRespVOMap"> |
| 122 | + <bind name="trueValue" value="true"/> | ||
| 117 | SELECT ${@cn.iocoder.yudao.framework.mybatis.core.util.SqlDialectUtils@formatYearDashMonth('pay_time')} AS statDate, | 123 | SELECT ${@cn.iocoder.yudao.framework.mybatis.core.util.SqlDialectUtils@formatYearDashMonth('pay_time')} AS statDate, |
| 118 | COUNT(1) AS order_pay_count, | 124 | COUNT(1) AS order_pay_count, |
| 119 | SUM(pay_price) AS order_pay_price | 125 | SUM(pay_price) AS order_pay_price |
| 120 | FROM trade_order | 126 | FROM trade_order |
| 121 | - WHERE pay_status = TRUE | 127 | + WHERE pay_status = #{trueValue} |
| 122 | AND create_time BETWEEN #{beginTime} AND #{endTime} | 128 | AND create_time BETWEEN #{beginTime} AND #{endTime} |
| 123 | AND deleted = 0 | 129 | AND deleted = 0 |
| 124 | <if test="@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId() != null"> | 130 | <if test="@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId() != null"> |
yudao-module-mes/src/main/resources/mapper/qc/pendinginspect/MesQcPendingInspectMapper.xml
| @@ -10,9 +10,11 @@ | @@ -10,9 +10,11 @@ | ||
| 10 | 4. 销售出库单(OQC):单据状态=CONFIRMED(1),行的 oqc_check_flag=1 且 oqc_id 为空 | 10 | 4. 销售出库单(OQC):单据状态=CONFIRMED(1),行的 oqc_check_flag=1 且 oqc_id 为空 |
| 11 | 5. 生产退料单(RQC):单据状态=CONFIRMED(1),行的 rqc_check_flag=1 且 rqc_id 为空 且 quality_status=0(待检) | 11 | 5. 生产退料单(RQC):单据状态=CONFIRMED(1),行的 rqc_check_flag=1 且 rqc_id 为空 且 quality_status=0(待检) |
| 12 | 6. 销售退货单(RQC):单据状态=CONFIRMED(1),行的 rqc_check_flag=1 且 rqc_id 为空 且 quality_status=0(待检) | 12 | 6. 销售退货单(RQC):单据状态=CONFIRMED(1),行的 rqc_check_flag=1 且 rqc_id 为空 且 quality_status=0(待检) |
| 13 | + IQC、RQC 的检验标记为 bit(1) 布尔列,使用绑定的 Boolean true 比较;OQC 的 oqc_check_flag 为 tinyint(1),保持数值 1 比较 | ||
| 13 | 注意:各分支无值的 ID 列使用 CASE WHEN 1 = 0 THEN 本分支 bigint 列 END 产生“带类型的 NULL”,避免 UNION 中裸 NULL 的类型推断差异 | 14 | 注意:各分支无值的 ID 列使用 CASE WHEN 1 = 0 THEN 本分支 bigint 列 END 产生“带类型的 NULL”,避免 UNION 中裸 NULL 的类型推断差异 |
| 14 | --> | 15 | --> |
| 15 | <select id="selectQcPendingPage" resultType="cn.iocoder.yudao.module.mes.controller.admin.qc.pendinginspect.vo.MesQcPendingInspectRespVO"> | 16 | <select id="selectQcPendingPage" resultType="cn.iocoder.yudao.module.mes.controller.admin.qc.pendinginspect.vo.MesQcPendingInspectRespVO"> |
| 17 | + <bind name="trueValue" value="true"/> | ||
| 16 | SELECT * FROM ( | 18 | SELECT * FROM ( |
| 17 | <!-- 1. IQC 来源:到货通知单 --> | 19 | <!-- 1. IQC 来源:到货通知单 --> |
| 18 | SELECT | 20 | SELECT |
| @@ -32,7 +34,7 @@ | @@ -32,7 +34,7 @@ | ||
| 32 | FROM mes_wm_arrival_notice n | 34 | FROM mes_wm_arrival_notice n |
| 33 | JOIN mes_wm_arrival_notice_line l ON n.id = l.notice_id | 35 | JOIN mes_wm_arrival_notice_line l ON n.id = l.notice_id |
| 34 | WHERE n.status = ${@cn.iocoder.yudao.module.mes.enums.wm.MesWmArrivalNoticeStatusEnum@PENDING_QC.status} | 36 | WHERE n.status = ${@cn.iocoder.yudao.module.mes.enums.wm.MesWmArrivalNoticeStatusEnum@PENDING_QC.status} |
| 35 | - AND l.iqc_check_flag = 1 | 37 | + AND l.iqc_check_flag = #{trueValue} |
| 36 | AND l.iqc_id IS NULL | 38 | AND l.iqc_id IS NULL |
| 37 | AND n.deleted = 0 | 39 | AND n.deleted = 0 |
| 38 | AND l.deleted = 0 | 40 | AND l.deleted = 0 |
| @@ -57,7 +59,7 @@ | @@ -57,7 +59,7 @@ | ||
| 57 | FROM mes_wm_outsource_receipt r | 59 | FROM mes_wm_outsource_receipt r |
| 58 | JOIN mes_wm_outsource_receipt_line rl ON r.id = rl.receipt_id | 60 | JOIN mes_wm_outsource_receipt_line rl ON r.id = rl.receipt_id |
| 59 | WHERE r.status = ${@cn.iocoder.yudao.module.mes.enums.wm.MesWmOutsourceReceiptStatusEnum@CONFIRMED.status} | 61 | WHERE r.status = ${@cn.iocoder.yudao.module.mes.enums.wm.MesWmOutsourceReceiptStatusEnum@CONFIRMED.status} |
| 60 | - AND rl.iqc_check_flag = 1 | 62 | + AND rl.iqc_check_flag = #{trueValue} |
| 61 | AND rl.iqc_id IS NULL | 63 | AND rl.iqc_id IS NULL |
| 62 | AND r.deleted = 0 | 64 | AND r.deleted = 0 |
| 63 | AND rl.deleted = 0 | 65 | AND rl.deleted = 0 |
| @@ -132,7 +134,7 @@ | @@ -132,7 +134,7 @@ | ||
| 132 | FROM mes_wm_return_issue ri | 134 | FROM mes_wm_return_issue ri |
| 133 | JOIN mes_wm_return_issue_line ril ON ri.id = ril.issue_id | 135 | JOIN mes_wm_return_issue_line ril ON ri.id = ril.issue_id |
| 134 | WHERE ri.status = ${@cn.iocoder.yudao.module.mes.enums.wm.MesWmReturnIssueStatusEnum@CONFIRMED.status} | 136 | WHERE ri.status = ${@cn.iocoder.yudao.module.mes.enums.wm.MesWmReturnIssueStatusEnum@CONFIRMED.status} |
| 135 | - AND ril.rqc_check_flag = 1 | 137 | + AND ril.rqc_check_flag = #{trueValue} |
| 136 | AND ril.rqc_id IS NULL | 138 | AND ril.rqc_id IS NULL |
| 137 | AND ril.quality_status = ${@cn.iocoder.yudao.module.mes.enums.wm.MesWmQualityStatusEnum@PENDING.status} | 139 | AND ril.quality_status = ${@cn.iocoder.yudao.module.mes.enums.wm.MesWmQualityStatusEnum@PENDING.status} |
| 138 | AND ri.deleted = 0 | 140 | AND ri.deleted = 0 |
| @@ -158,7 +160,7 @@ | @@ -158,7 +160,7 @@ | ||
| 158 | FROM mes_wm_return_sales r | 160 | FROM mes_wm_return_sales r |
| 159 | JOIN mes_wm_return_sales_line rl ON r.id = rl.return_id | 161 | JOIN mes_wm_return_sales_line rl ON r.id = rl.return_id |
| 160 | WHERE r.status = ${@cn.iocoder.yudao.module.mes.enums.wm.MesWmReturnSalesStatusEnum@CONFIRMED.status} | 162 | WHERE r.status = ${@cn.iocoder.yudao.module.mes.enums.wm.MesWmReturnSalesStatusEnum@CONFIRMED.status} |
| 161 | - AND rl.rqc_check_flag = 1 | 163 | + AND rl.rqc_check_flag = #{trueValue} |
| 162 | AND rl.rqc_id IS NULL | 164 | AND rl.rqc_id IS NULL |
| 163 | AND rl.quality_status = ${@cn.iocoder.yudao.module.mes.enums.wm.MesWmQualityStatusEnum@PENDING.status} | 165 | AND rl.quality_status = ${@cn.iocoder.yudao.module.mes.enums.wm.MesWmQualityStatusEnum@PENDING.status} |
| 164 | AND r.deleted = 0 | 166 | AND r.deleted = 0 |