补充4.2.0提交xml文件
master
xs 4 months ago
parent 106a314a38
commit dc0486883d

@ -78,12 +78,6 @@
<artifactId>hw-common-swagger</artifactId>
</dependency>
<dependency>
<groupId>com.hw</groupId>
<artifactId>hw-api-printer</artifactId>
<version>3.6.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.hw</groupId>
<artifactId>hw-api-jindie</artifactId>
@ -98,6 +92,16 @@
<groupId>com.hw</groupId>
<artifactId>hw-api-system</artifactId>
</dependency>
<dependency>
<groupId>com.hw</groupId>
<artifactId>hw-api-mes</artifactId>
</dependency>
<dependency>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j</artifactId>
<version>61.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

@ -0,0 +1,142 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hw.mes.mapper.MesBomAttachChangeMapper">
<resultMap type="MesBomAttachChange" id="MesBomAttachChangeResult">
<result property="attachChangeId" column="attach_change_id" />
<result property="materialBomId" column="material_bom_id" />
<result property="attachType" column="attach_type" />
<result property="oldAttachId" column="old_attach_id" />
<result property="newAttachId" column="new_attach_id" />
<result property="changeType" column="change_type" />
<result property="planId" column="plan_id" />
<result property="planCode" column="plan_code" />
<result property="changeUserId" column="change_user_id" />
<result property="changeBy" column="change_by" />
<result property="changeTime" column="change_time" />
<result property="attachName" column="attach_name" />
<result property="attachPath" column="attach_path" />
</resultMap>
<sql id="selectMesBomAttachChangeVo">
select attach_change_id, material_bom_id,attach_type, old_attach_id, new_attach_id, change_type, plan_id, plan_code, change_user_id, change_by, change_time from mes_bom_attach_change
</sql>
<select id="selectMesBomAttachChangeList" parameterType="MesBomAttachChange" resultMap="MesBomAttachChangeResult">
<include refid="selectMesBomAttachChangeVo"/>
<where>
<if test="materialBomId != null "> and material_bom_id = #{materialBomId}</if>
<if test="attachType != null "> and attach_type = #{attachType}</if>
<if test="oldAttachId != null "> and old_attach_id = #{oldAttachId}</if>
<if test="newAttachId != null "> and new_attach_id = #{newAttachId}</if>
<if test="changeType != null and changeType != ''"> and change_type = #{changeType}</if>
<if test="planId != null "> and plan_id = #{planId}</if>
<if test="planCode != null and planCode != ''"> and plan_code = #{planCode}</if>
<if test="changeUserId != null "> and change_user_id = #{changeUserId}</if>
<if test="changeBy != null and changeBy != ''"> and change_by = #{changeBy}</if>
<if test="changeTime != null "> and change_time = #{changeTime}</if>
</where>
</select>
<select id="selectMesBomAttachChangeByAttachChangeId" parameterType="Long" resultMap="MesBomAttachChangeResult">
<include refid="selectMesBomAttachChangeVo"/>
where attach_change_id = #{attachChangeId}
</select>
<insert id="insertMesBomAttachChange" parameterType="MesBomAttachChange" useGeneratedKeys="true" keyProperty="attachChangeId">
insert into mes_bom_attach_change
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="materialBomId != null">material_bom_id,</if>
<if test="attachType != null">attach_type,</if>
<if test="oldAttachId != null">old_attach_id,</if>
<if test="newAttachId != null">new_attach_id,</if>
<if test="changeType != null">change_type,</if>
<if test="planId != null">plan_id,</if>
<if test="planCode != null">plan_code,</if>
<if test="changeUserId != null">change_user_id,</if>
<if test="changeBy != null">change_by,</if>
<if test="changeTime != null">change_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="materialBomId != null">#{materialBomId},</if>
<if test="attachType != null">#{attachType},</if>
<if test="oldAttachId != null">#{oldAttachId},</if>
<if test="newAttachId != null">#{newAttachId},</if>
<if test="changeType != null">#{changeType},</if>
<if test="planId != null">#{planId},</if>
<if test="planCode != null">#{planCode},</if>
<if test="changeUserId != null">#{changeUserId},</if>
<if test="changeBy != null">#{changeBy},</if>
<if test="changeTime != null">#{changeTime},</if>
</trim>
</insert>
<update id="updateMesBomAttachChange" parameterType="MesBomAttachChange">
update mes_bom_attach_change
<trim prefix="SET" suffixOverrides=",">
<if test="materialBomId != null">material_bom_id = #{materialBomId},</if>
<if test="oldAttachId != null">old_attach_id = #{oldAttachId},</if>
<if test="newAttachId != null">new_attach_id = #{newAttachId},</if>
<if test="changeType != null">change_type = #{changeType},</if>
<if test="planId != null">plan_id = #{planId},</if>
<if test="planCode != null">plan_code = #{planCode},</if>
<if test="changeUserId != null">change_user_id = #{changeUserId},</if>
<if test="changeBy != null">change_by = #{changeBy},</if>
<if test="changeTime != null">change_time = #{changeTime},</if>
</trim>
where attach_change_id = #{attachChangeId}
</update>
<delete id="deleteMesBomAttachChangeByAttachChangeId" parameterType="Long">
delete from mes_bom_attach_change where attach_change_id = #{attachChangeId}
</delete>
<delete id="deleteMesBomAttachChangeByAttachChangeIds" parameterType="String">
delete from mes_bom_attach_change where attach_change_id in
<foreach item="attachChangeId" collection="array" open="(" separator="," close=")">
#{attachChangeId}
</foreach>
</delete>
<insert id="batchMesBomAttachChange">
insert into mes_bom_attach_change( material_bom_id,attach_type, old_attach_id, new_attach_id, change_type, plan_id, plan_code, change_user_id, change_by, change_time) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.materialBomId}, #{item.attachType}, #{item.oldAttachId}, #{item.newAttachId}, #{item.changeType}, #{item.planId}, #{item.planCode}, #{item.changeUserId}, #{item.changeBy}, #{item.changeTime})
</foreach>
</insert>
<select id="selectMesBomAttachChangeJoinList" parameterType="MesBomAttachChange" resultMap="MesBomAttachChangeResult">
select
a.attach_change_id,
a.material_bom_id,
a.attach_type,
a.old_attach_id,
a.new_attach_id,
a.change_type,
a.plan_id,
a.plan_code,
a.change_user_id,
a.change_by,
a.change_time,
b.attach_name,
b.attach_path
from mes_bom_attach_change a
left join mes_base_attach_info b on a.new_attach_id = b.attach_id
<where>
<if test="materialBomId != null "> and material_bom_id = #{materialBomId}</if>
<if test="attachType != null "> and a.attach_type = #{attachType}</if>
<if test="oldAttachId != null "> and old_attach_id = #{oldAttachId}</if>
<if test="newAttachId != null "> and new_attach_id = #{newAttachId}</if>
<if test="changeType != null and changeType != ''"> and a.change_type = #{changeType}</if>
<if test="changeBy != null and changeBy != ''"> and change_by like concat( '%', #{changeBy}, '%')</if>
<if test="changeTime != null "> and change_time = #{changeTime}</if>
</where>
</select>
</mapper>

@ -30,6 +30,8 @@
<result property="materialSpec" column="material_spec"/>
<result property="attachId" column="attach_id"/>
<result property="sopId" column="sop_id"/>
<result property="attachChangeFlag" column="attach_change_flag"/>
<result property="sopChangeFlag" column="sop_change_flag"/>
</resultMap>
<sql id="selectMesMaterialBomVo">
@ -55,7 +57,7 @@
attach_id,
sop_id,
CONCAT(material_name, '-', material_bom_desc) materialNameDesc
from mes_material_bom
from mes_material_bom mmb
</sql>
<select id="selectMesMaterialBomList" parameterType="MesMaterialBom" resultMap="MesMaterialBomResult">
@ -155,6 +157,8 @@
<if test="assembleTime != null">assemble_time = #{assembleTime},</if>
<if test="attachId != null">attach_id = #{attachId},</if>
<if test="sopId != null">sop_id = #{sopId},</if>
<if test="attachChangeFlag != null">attach_change_flag = #{attachChangeFlag},</if>
<if test="sopChangeFlag != null">sop_change_flag = #{sopChangeFlag},</if>
</trim>
where material_bom_id = #{materialBomId}
</update>
@ -224,4 +228,24 @@
</foreach>
</insert>
<select id="selectParentMesMaterialBomList" parameterType="MesMaterialBom" resultMap="MesMaterialBomResult">
<include refid="selectMesMaterialBomVo"/>
<where>
<if test="materialId != null ">exists (select 1 from mes_material_bom mmb2 where mmb.material_bom_id =mmb2.parent_id and mmb2.material_id = #{materialId}) </if>
<if test="activeFlag != null and activeFlag != ''">and active_flag = #{activeFlag}</if>
<if test="parentId != null ">and parent_id = #{parentId}</if>
</where>
order by material_bom_id desc
</select>
<select id="selectMesMaterialBomWithChildSopList" parameterType="Long" resultMap="MesMaterialBomResult">
select mmb.material_bom_id,mmb.sop_id from mes_material_bom mmb where (mmb.material_bom_id =#{materialBomId} or mmb.parent_id =#{materialBomId}) and mmb.sop_id is not null
order by material_bom_id desc
</select>
</mapper>

@ -670,6 +670,7 @@
<if test="planStatus != null and planStatus != ''">and mpp.plan_status = #{planStatus}</if>
<if test="isFlag != null and isFlag != ''">and mpp.is_flag = #{isFlag}</if>
</where>
order by mpp.create_time desc
</select>

@ -547,7 +547,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
join mes_base_material_info mbmi on mprb.material_id = mbmi.erp_id
<where>
<if test="poNo != null and poNo != ''"> and mpo.po_no like concat('%', #{poNo}, '%')</if>
<if test="materialId != null "> and mpo.material_id = #{materialId}</if>
<if test="materialId != null "> and mbmi.material_id = #{materialId}</if>
</where>
order by mpo.create_time desc
</select>

@ -197,7 +197,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mpo.purchase_order_id,
CASE WHEN mbbi.receive_bill_id IS NOT NULL THEN '1' ELSE '0' END AS has_barcode_flag
from mes_purchase_receive_bill mprb
left join mes_purchase_order mpo on mprb.fs_id = mpo.fentry_id
left join mes_purchase_order mpo on mprb.fs_id = mpo.fentry_id and mpo.material_id=mprb.material_id
left join mes_base_material_info mbmi on mprb.material_id = mbmi.erp_id
LEFT JOIN (SELECT DISTINCT receive_bill_id FROM mes_base_barcode_info) mbbi
ON mprb.receive_bill_id = mbbi.receive_bill_id

Loading…
Cancel
Save