|
@@ -4,20 +4,25 @@
|
|
|
<mapper namespace="com.tld.mapper.InviteMapper">
|
|
<mapper namespace="com.tld.mapper.InviteMapper">
|
|
|
<!-- 查询要货单id+物料id是否存在 -->
|
|
<!-- 查询要货单id+物料id是否存在 -->
|
|
|
<select id="getAskGoods" resultType="int">
|
|
<select id="getAskGoods" resultType="int">
|
|
|
- select count(*) from tld_ask_goods where ask_goods_id = #{askGoodsId} and material_id = #{materialId}
|
|
|
|
|
|
|
+ select count(*) from tld_invite where ask_goods_id = #{askGoodsId} and material_id = #{materialId}
|
|
|
</select>
|
|
</select>
|
|
|
<!-- 修改要料申请单数量 -->
|
|
<!-- 修改要料申请单数量 -->
|
|
|
<update id="updateAskGoodsNum">
|
|
<update id="updateAskGoodsNum">
|
|
|
update tld_ask_goods
|
|
update tld_ask_goods
|
|
|
set
|
|
set
|
|
|
- num = (select num from tld_ask_goods where ask_goods_id = #{askGoodsId} and material_id = #{materialId})
|
|
|
|
|
|
|
+ num = (select num from tld_invite where ask_goods_id = #{askGoodsId} and material_id = #{materialId})
|
|
|
where ask_goods_id = #{askGoodsId} and material_id = #{materialId}
|
|
where ask_goods_id = #{askGoodsId} and material_id = #{materialId}
|
|
|
</update>
|
|
</update>
|
|
|
<!-- 新增要料申请单 -->
|
|
<!-- 新增要料申请单 -->
|
|
|
<insert id="addAskGoods">
|
|
<insert id="addAskGoods">
|
|
|
- insert into tld_ask_goods(ask_goods_id,entry_number,production_code,material_id,wbs,measurement_id,num,out_num)
|
|
|
|
|
|
|
+ insert into tld_invite(ask_goods_id,entry_number,production_code,material_id,wbs,measurement_id,num,out_num)
|
|
|
values(#{askGoodsId},#{entryNumber},#{productionCode},#{materialId},#{wbs},#{measurementId},#{outNum})
|
|
values(#{askGoodsId},#{entryNumber},#{productionCode},#{materialId},#{wbs},#{measurementId},#{outNum})
|
|
|
</insert>
|
|
</insert>
|
|
|
|
|
+ <!-- 新增要料申请单父级 -->
|
|
|
|
|
+ <insert id="addAskGoodsf">
|
|
|
|
|
+ insert into tld_invite_f(ask_goods_id,ask_goods_code,company_number,sqrq,department,source_type,move_type,ask_goods_apply_type)
|
|
|
|
|
+ values(#{askGoodsId},#{askGoodsCode},#{companyNumber},#{sqrq},#{department},#{sourceType},#{moveType},#{askGoodsApplyType})
|
|
|
|
|
+ </insert>
|
|
|
<!-- 新增要料日志 -->
|
|
<!-- 新增要料日志 -->
|
|
|
<insert id="addAskGoodsLog">
|
|
<insert id="addAskGoodsLog">
|
|
|
insert into tld_ask_goods_log(ask_goods_id,entry_number,production_code,material_id,wbs,measurement_id,num,out_num,ask_goods_code,company_number,sqrq,department_id,source_type,move_type,ask_goods_type)
|
|
insert into tld_ask_goods_log(ask_goods_id,entry_number,production_code,material_id,wbs,measurement_id,num,out_num,ask_goods_code,company_number,sqrq,department_id,source_type,move_type,ask_goods_type)
|
|
@@ -25,11 +30,11 @@
|
|
|
</insert>
|
|
</insert>
|
|
|
<!-- 查询次要货单是否存在 -->
|
|
<!-- 查询次要货单是否存在 -->
|
|
|
<select id="getAskGoodsf" resultType="int">
|
|
<select id="getAskGoodsf" resultType="int">
|
|
|
- select count(*) from tld_ask_goods_f where ask_goods_id = #{askGoodsId} and ask_goods_code = #{askGoodsCode}
|
|
|
|
|
|
|
+ select count(*) from tld_invite_f where ask_goods_id = #{askGoodsId} and ask_goods_code = #{askGoodsCode}
|
|
|
</select>
|
|
</select>
|
|
|
<!-- 新增要料申请单父级 -->
|
|
<!-- 新增要料申请单父级 -->
|
|
|
<insert id="addAskGoodsNumf">
|
|
<insert id="addAskGoodsNumf">
|
|
|
- insert into tld_ask_goods_f(ask_goods_id,ask_goods_code,company_number,sqrq,department,source_type,move_type)
|
|
|
|
|
|
|
+ insert into tld_invite_f(ask_goods_id,ask_goods_code,company_number,sqrq,department,source_type,move_type)
|
|
|
values(#{askGoodsId},#{askGoodsCode},#{companyNumber},#{sqrq},#{department},#{sourceType},#{moveType})
|
|
values(#{askGoodsId},#{askGoodsCode},#{companyNumber},#{sqrq},#{department},#{sourceType},#{moveType})
|
|
|
</insert>
|
|
</insert>
|
|
|
<!-- 查询生产领料单 -->
|
|
<!-- 查询生产领料单 -->
|