guoyujia il y a 8 mois
Parent
commit
68e3a261f3

+ 5 - 1
src/main/resources/mybatis/business/carrier/BizCarrierMapper.xml

@@ -18,7 +18,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="tenantId != null  and tenantId != 0"> AND tenant_id = #{tenantId}</if>
             <if test="code != null  and code != ''"> AND code LIKE CONCAT('%', #{code}, '%')</if>
             <if test="isPrint != null"> AND is_print = #{isPrint}</if>
-
+            <if test="isAbandoned != null and isAbandoned == 1"> AND exists(select 1 from biz_carrier_reject t2 where t2.carrier_id = t1.id and t2.is_abandoned = #{isAbandoned})</if>
+            <if test="isAbandoned != null and isAbandoned == 0">  AND NOT EXISTS (
+                SELECT 1 FROM biz_carrier_reject t2
+                WHERE t2.carrier_id = t1.id AND t2.is_abandoned = 1
+                )</if>
         </trim>
 
     </select>

+ 1 - 1
src/main/resources/mybatis/business/carrier/BizCarrierRejectMapper.xml

@@ -14,7 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         left join biz_carrier_category t3 on t2.category_id = t3.id
         <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
             t1.deleted = 0
-            <if test="categoryId != null  and categoryId != ''"> AND category_id = #{categoryId}</if>
+            <if test="categoryId != null  and categoryId != ''"> AND t2.category_id = #{categoryId}</if>
             <if test="code != null  and code != ''"> AND t2.code like concat('%',#{code},'%')</if>
             <if test="isAbandoned != null "> AND t1.is_abandoned = #{isAbandoned}</if>
         </trim>