demand: tms-运输管理-组批次规则维护-查询组批次规则支持根据多个供应商查询

This commit is contained in:
aike 2026-03-10 16:15:40 +08:00
parent 2d0b00d28b
commit 13a848403b

View File

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xdadan.erp.emis.mapper.EmisTransPlanRuleMapper"> <mapper namespace="com.xdadan.erp.emis.mapper.EmisTransPlanRuleMapper">
<resultMap type="EmisTransPlanRule" id="EmisTransPlanRuleResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult"> <resultMap type="EmisTransPlanRule" id="EmisTransPlanRuleResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="lineCode" column="line_code" /> <result property="lineCode" column="line_code" />
@ -30,13 +30,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
r.manager, r.supplier_code, r.start_date, r.end_date, r.remark, r.manager, r.supplier_code, r.start_date, r.end_date, r.remark,
r.del_flag, r.create_by, r.create_time, r.update_by, r.update_time, r.create_site, r.update_site, r.del_flag, r.create_by, r.create_time, r.update_by, r.update_time, r.create_site, r.update_site,
l.line_name,l.trans_manager, l.from_country, l.country, l.line_name,l.trans_manager, l.from_country, l.country,
(SELECT GROUP_CONCAT(s.name ORDER BY FIND_IN_SET(s.code, r.supplier_code)) (SELECT GROUP_CONCAT(s.name ORDER BY FIND_IN_SET(s.code, r.supplier_code))
FROM emis_supplier s FROM emis_supplier s
WHERE FIND_IN_SET(s.code, r.supplier_code) WHERE FIND_IN_SET(s.code, r.supplier_code)
AND s.del_flag = '0') as supplier_name, AND s.del_flag = '0') as supplier_name,
(SELECT GROUP_CONCAT(p.prod_name ORDER BY FIND_IN_SET(p.prod_code, r.product_type)) (SELECT GROUP_CONCAT(p.prod_name ORDER BY FIND_IN_SET(p.prod_code, r.product_type))
FROM emis_trans_product p FROM emis_trans_product p
WHERE FIND_IN_SET(p.prod_code, r.product_type) WHERE FIND_IN_SET(p.prod_code, r.product_type)
AND p.del_flag = '0') as product_type_name AND p.del_flag = '0') as product_type_name
from emis_trans_plan_rule r from emis_trans_plan_rule r
left join emis_site s1 on r.start_site_code = s1.site_code and s1.del_flag='0' left join emis_site s1 on r.start_site_code = s1.site_code and s1.del_flag='0'
@ -58,7 +58,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND l.trans_manager like concat('%', #{transManager}, '%') AND l.trans_manager like concat('%', #{transManager}, '%')
</if> </if>
<if test="productType != null and productType != ''"> and ( FIND_IN_SET(#{productType},r.product_type) )</if> <if test="productType != null and productType != ''"> and ( FIND_IN_SET(#{productType},r.product_type) )</if>
<if test="supplierCode != null and supplierCode != ''"> and ( FIND_IN_SET(#{supplierCode},r.supplier_code) )</if> <if test="supplierCode != null and supplierCode != ''">
and CONCAT(',', r.supplier_code, ',')
REGEXP CONCAT(',(', REPLACE(#{supplierCode}, ',', '|'), '),')
</if>
</where> </where>
order by id desc order by id desc
</select> </select>
@ -181,14 +184,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
order by id desc order by id desc
</select> </select>
<select id="selectEmisTransPlanRuleById" parameterType="Long" resultMap="EmisTransPlanRuleResult"> <select id="selectEmisTransPlanRuleById" parameterType="Long" resultMap="EmisTransPlanRuleResult">
<include refid="selectEmisTransPlanRuleVo"/> <include refid="selectEmisTransPlanRuleVo"/>
where r.id = #{id} and r.del_flag = '0' where r.id = #{id} and r.del_flag = '0'
</select> </select>
<select id="selectSupplierNamesByCodes" parameterType="String" resultType="String"> <select id="selectSupplierNamesByCodes" parameterType="String" resultType="String">
SELECT GROUP_CONCAT(s.name ORDER BY FIND_IN_SET(s.code, #{supplierCodes})) SELECT GROUP_CONCAT(s.name ORDER BY FIND_IN_SET(s.code, #{supplierCodes}))
FROM emis_supplier s FROM emis_supplier s
WHERE FIND_IN_SET(s.code, #{supplierCodes}) AND s.del_flag = 0 WHERE FIND_IN_SET(s.code, #{supplierCodes}) AND s.del_flag = 0
</select> </select>
@ -261,9 +264,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
<delete id="deleteEmisTransPlanRuleByIds" parameterType="String"> <delete id="deleteEmisTransPlanRuleByIds" parameterType="String">
update emis_trans_plan_rule set del_flag = '1' where id in update emis_trans_plan_rule set del_flag = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
@ -383,4 +386,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
</mapper> </mapper>