demand: TMS系统财务销账优化
committer: heyu
This commit is contained in:
parent
22b4aa7813
commit
3a24888794
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xdadan.erp.emis.mapper.EmisWriteoffApplyDetailMapper">
|
||||
|
||||
<resultMap type="EmisWriteoffApplyDetail" id="EmisWriteoffApplyDetailResult">
|
||||
<resultMap type="EmisWriteoffApplyDetail" id="EmisWriteoffApplyDetailResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="applyId" column="apply_id" />
|
||||
<result property="applyNo" column="apply_no" />
|
||||
@ -194,7 +194,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmisWriteoffApplyDetailVo">
|
||||
select wad.id, wad.apply_id, wad.apply_no, wad.bill_code, wad.apply_money, wad.settle_bill_no,
|
||||
select wad.id, wad.apply_id, wad.apply_no, wad.bill_code, wad.apply_money, wad.settle_bill_no, wad.del_flag,
|
||||
CONCAT(IFNULL(send_site.site_name, ''), '-', IFNULL(dest_site.site_name, '')) as express_type,
|
||||
w.id as w_id, w.order_sn as w_order_sn, w.cust_order_id as w_cust_order_id, w.bill_code as w_bill_code, w.bill_code_sub as w_bill_code_sub,
|
||||
w.order_status as w_order_status, w.waybill_status as w_waybill_status, w.order_type as w_order_type, w.order_date as w_order_date,
|
||||
@ -255,6 +255,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectEmisWriteoffApplyDetailList" parameterType="EmisWriteoffApplyDetail" resultMap="EmisWriteoffApplyDetailResult">
|
||||
<include refid="selectEmisWriteoffApplyDetailVo"/>
|
||||
<where>
|
||||
wad.del_flag = '0'
|
||||
<if test="applyId != null "> and wad.apply_id = #{applyId}</if>
|
||||
<if test="applyNo != null and applyNo != ''"> and wad.apply_no = #{applyNo}</if>
|
||||
<if test="billCode != null and billCode != ''"> and wad.bill_code = #{billCode}</if>
|
||||
@ -266,12 +267,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selectEmisWriteoffApplyDetailById" parameterType="Long" resultMap="EmisWriteoffApplyDetailResult">
|
||||
<include refid="selectEmisWriteoffApplyDetailVo"/>
|
||||
where id = #{id}
|
||||
where wad.id = #{id} and wad.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectEmisWriteoffApplyDetailListByApplyId" parameterType="Long" resultMap="EmisWriteoffApplyDetailResult">
|
||||
<include refid="selectEmisWriteoffApplyDetailVo"/>
|
||||
where apply_id = #{applyId}
|
||||
where wad.apply_id = #{applyId} and wad.del_flag = '0'
|
||||
order by wad.create_time desc
|
||||
</select>
|
||||
|
||||
@ -283,6 +284,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="billCode != null and billCode != ''">bill_code,</if>
|
||||
<if test="applyMoney != null">apply_money,</if>
|
||||
<if test="settleBillNo != null and settleBillNo != ''">settle_bill_no,</if>
|
||||
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="applyId != null">#{applyId},</if>
|
||||
@ -290,14 +292,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="billCode != null and billCode != ''">#{billCode},</if>
|
||||
<if test="applyMoney != null">#{applyMoney},</if>
|
||||
<if test="settleBillNo != null and settleBillNo != ''">#{settleBillNo},</if>
|
||||
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertEmisWriteoffApplyDetailBatch" parameterType="java.util.List">
|
||||
insert into emis_writeoff_apply_detail (apply_id, apply_no, bill_code, apply_money, settle_bill_no)
|
||||
insert into emis_writeoff_apply_detail (apply_id, apply_no, bill_code, apply_money, settle_bill_no, del_flag)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.applyId}, #{item.applyNo}, #{item.billCode}, #{item.applyMoney}, #{item.settleBillNo})
|
||||
(#{item.applyId}, #{item.applyNo}, #{item.billCode}, #{item.applyMoney}, #{item.settleBillNo}, '0')
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
@ -313,25 +316,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEmisWriteoffApplyDetailById" parameterType="Long">
|
||||
delete from emis_writeoff_apply_detail where id = #{id}
|
||||
</delete>
|
||||
<update id="deleteEmisWriteoffApplyDetailById" parameterType="Long">
|
||||
update emis_writeoff_apply_detail set del_flag = '2' where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEmisWriteoffApplyDetailByApplyId" parameterType="Long">
|
||||
delete from emis_writeoff_apply_detail where apply_id = #{applyId}
|
||||
</delete>
|
||||
<update id="deleteEmisWriteoffApplyDetailByApplyId" parameterType="Long">
|
||||
update emis_writeoff_apply_detail set del_flag = '2' where apply_id = #{applyId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEmisWriteoffApplyDetailByIds" parameterType="String">
|
||||
delete from emis_writeoff_apply_detail where id in
|
||||
<update id="deleteEmisWriteoffApplyDetailByIds" parameterType="String">
|
||||
update emis_writeoff_apply_detail set del_flag = '2' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</update>
|
||||
|
||||
<!-- 根据申请ID查询明细列表(只包含emisWaybill、emisSettleBill、emisSettleSubBill) -->
|
||||
<select id="selectEmisWriteoffApplyDetailListByApplyIdWithDetails" parameterType="Long" resultMap="EmisWriteoffApplyDetailResult">
|
||||
<include refid="selectEmisWriteoffApplyDetailVo"/>
|
||||
where apply_id = #{applyId}
|
||||
where wad.apply_id = #{applyId} and wad.del_flag = '0'
|
||||
order by wad.create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xdadan.erp.emis.mapper.EmisWriteoffApplyImageMapper">
|
||||
|
||||
<resultMap type="EmisWriteoffApplyImage" id="EmisWriteoffApplyImageResult">
|
||||
<resultMap type="EmisWriteoffApplyImage" id="EmisWriteoffApplyImageResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="applyId" column="apply_id" />
|
||||
<result property="applyNo" column="apply_no" />
|
||||
@ -15,20 +15,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="uploadDate" column="upload_date" />
|
||||
<result property="uploadManCode" column="upload_man_code" />
|
||||
<result property="uploadManName" column="upload_man_name" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmisWriteoffApplyImageVo">
|
||||
select id, apply_id, apply_no, image_name, image_path, image_size, image_type, upload_date, upload_man_code, upload_man_name, create_by, create_time, update_by, update_time, remark from emis_writeoff_apply_image
|
||||
select id, apply_id, apply_no, image_name, image_path, image_size, image_type, upload_date, upload_man_code, upload_man_name, del_flag, create_by, create_time, update_by, update_time, remark from emis_writeoff_apply_image
|
||||
</sql>
|
||||
|
||||
<select id="selectEmisWriteoffApplyImageList" parameterType="EmisWriteoffApplyImage" resultMap="EmisWriteoffApplyImageResult">
|
||||
<include refid="selectEmisWriteoffApplyImageVo"/>
|
||||
<where>
|
||||
del_flag = '0'
|
||||
<if test="applyId != null "> and apply_id = #{applyId}</if>
|
||||
<if test="applyNo != null and applyNo != ''"> and apply_no = #{applyNo}</if>
|
||||
<if test="imageName != null and imageName != ''"> and image_name like concat('%', #{imageName}, '%')</if>
|
||||
@ -44,12 +40,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selectEmisWriteoffApplyImageById" parameterType="Long" resultMap="EmisWriteoffApplyImageResult">
|
||||
<include refid="selectEmisWriteoffApplyImageVo"/>
|
||||
where id = #{id}
|
||||
where id = #{id} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectEmisWriteoffApplyImageListByApplyId" parameterType="Long" resultMap="EmisWriteoffApplyImageResult">
|
||||
<include refid="selectEmisWriteoffApplyImageVo"/>
|
||||
where apply_id = #{applyId}
|
||||
where apply_id = #{applyId} and del_flag = '0'
|
||||
order by upload_date desc
|
||||
</select>
|
||||
|
||||
@ -65,6 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="uploadDate != null">upload_date,</if>
|
||||
<if test="uploadManCode != null and uploadManCode != ''">upload_man_code,</if>
|
||||
<if test="uploadManName != null and uploadManName != ''">upload_man_name,</if>
|
||||
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
||||
@ -81,6 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="uploadDate != null">#{uploadDate},</if>
|
||||
<if test="uploadManCode != null and uploadManCode != ''">#{uploadManCode},</if>
|
||||
<if test="uploadManName != null and uploadManName != ''">#{uploadManName},</if>
|
||||
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
||||
@ -90,10 +88,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</insert>
|
||||
|
||||
<insert id="insertEmisWriteoffApplyImageBatch" parameterType="java.util.List">
|
||||
insert into emis_writeoff_apply_image (apply_id, apply_no, image_name, image_path, image_size, image_type, upload_date, upload_man_code, upload_man_name, create_by, create_time, update_by, update_time, remark)
|
||||
insert into emis_writeoff_apply_image (apply_id, apply_no, image_name, image_path, image_size, image_type, upload_date, upload_man_code, upload_man_name, del_flag, create_by, create_time, update_by, update_time, remark)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.applyId}, #{item.applyNo}, #{item.imageName}, #{item.imagePath}, #{item.imageSize}, #{item.imageType}, #{item.uploadDate}, #{item.uploadManCode}, #{item.uploadManName}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.remark})
|
||||
(#{item.applyId}, #{item.applyNo}, #{item.imageName}, #{item.imagePath}, #{item.imageSize}, #{item.imageType}, #{item.uploadDate}, #{item.uploadManCode}, #{item.uploadManName}, '0', #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.remark})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
@ -116,20 +114,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEmisWriteoffApplyImageById" parameterType="Long">
|
||||
delete from emis_writeoff_apply_image where id = #{id}
|
||||
</delete>
|
||||
<update id="deleteEmisWriteoffApplyImageById" parameterType="Long">
|
||||
update emis_writeoff_apply_image set del_flag = '2' where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEmisWriteoffApplyImageByApplyId" parameterType="Long">
|
||||
delete from emis_writeoff_apply_image where apply_id = #{applyId}
|
||||
</delete>
|
||||
<update id="deleteEmisWriteoffApplyImageByApplyId" parameterType="Long">
|
||||
update emis_writeoff_apply_image set del_flag = '2' where apply_id = #{applyId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEmisWriteoffApplyImageByIds" parameterType="String">
|
||||
delete from emis_writeoff_apply_image where id in
|
||||
<update id="deleteEmisWriteoffApplyImageByIds" parameterType="String">
|
||||
update emis_writeoff_apply_image set del_flag = '2' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xdadan.erp.emis.mapper.EmisWriteoffApplyMapper">
|
||||
|
||||
<resultMap type="EmisWriteoffApply" id="EmisWriteoffApplyResult">
|
||||
<resultMap type="EmisWriteoffApply" id="EmisWriteoffApplyResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="applyNo" column="apply_no" />
|
||||
<result property="applyManCode" column="apply_man_code" />
|
||||
@ -33,11 +33,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="revokeManCode" column="revoke_man_code" />
|
||||
<result property="revokeManName" column="revoke_man_name" />
|
||||
<result property="revokeReason" column="revoke_reason" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<!-- 关联明细列表 -->
|
||||
<collection property="detailList" ofType="EmisWriteoffApplyDetail"
|
||||
select="com.xdadan.erp.emis.mapper.EmisWriteoffApplyDetailMapper.selectEmisWriteoffApplyDetailListByApplyId"
|
||||
@ -49,7 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmisWriteoffApplyVo">
|
||||
select id, apply_no, apply_man_code, apply_man_name, apply_site_code, apply_site_name, apply_date, writeoff_amount, pay_type, trade_date, recipient, apply_memo, bl_center_confirmed, center_confirm_man_code, center_confirm_man_name, center_confirm_date, center_confirm_note, center_reject_reason, bl_headquarters_confirmed, headquarters_confirm_man_code, headquarters_confirm_man_name, headquarters_confirm_date, headquarters_confirm_note, headquarters_reject_reason, revoke_date, revoke_man_code, revoke_man_name, revoke_reason, create_by, create_time, update_by, update_time, remark from emis_writeoff_apply
|
||||
select id, apply_no, apply_man_code, apply_man_name, apply_site_code, apply_site_name, apply_date, writeoff_amount, pay_type, trade_date, recipient, apply_memo, bl_center_confirmed, center_confirm_man_code, center_confirm_man_name, center_confirm_date, center_confirm_note, center_reject_reason, bl_headquarters_confirmed, headquarters_confirm_man_code, headquarters_confirm_man_name, headquarters_confirm_date, headquarters_confirm_note, headquarters_reject_reason, revoke_date, revoke_man_code, revoke_man_name, revoke_reason, del_flag, create_by, create_time, update_by, update_time, remark from emis_writeoff_apply
|
||||
</sql>
|
||||
|
||||
<select id="selectEmisWriteoffApplyList" parameterType="EmisWriteoffApply" resultMap="EmisWriteoffApplyResult">
|
||||
@ -59,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
wa.center_confirm_note, wa.center_reject_reason, wa.bl_headquarters_confirmed, wa.headquarters_confirm_man_code,
|
||||
wa.headquarters_confirm_man_name, wa.headquarters_confirm_date, wa.headquarters_confirm_note,
|
||||
wa.headquarters_reject_reason, wa.revoke_date, wa.revoke_man_code, wa.revoke_man_name, wa.revoke_reason,
|
||||
wa.create_by, wa.create_time, wa.update_by, wa.update_time, wa.remark
|
||||
wa.del_flag, wa.create_by, wa.create_time, wa.update_by, wa.update_time, wa.remark
|
||||
from emis_writeoff_apply wa
|
||||
<if test="(params != null and params.queryParams != null and params.queryParams != '') or (settleBillName != null and settleBillName != '')">
|
||||
left join emis_writeoff_apply_detail wad on wa.id = wad.apply_id and wad.del_flag = '0'
|
||||
@ -68,6 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
left join emis_settle_bill sb on wad.settle_bill_no = sb.settle_bill_no and sb.del_flag = '0'
|
||||
</if>
|
||||
<where>
|
||||
wa.del_flag = '0'
|
||||
<if test="applyNo != null and applyNo != ''"> and wa.apply_no = #{applyNo}</if>
|
||||
<if test="applyManCode != null and applyManCode != ''"> and wa.apply_man_code = #{applyManCode}</if>
|
||||
<if test="applyManName != null and applyManName != ''"> and wa.apply_man_name like concat('%', #{applyManName}, '%')</if>
|
||||
@ -146,6 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="revokeManCode != null and revokeManCode != ''">revoke_man_code,</if>
|
||||
<if test="revokeManName != null and revokeManName != ''">revoke_man_name,</if>
|
||||
<if test="revokeReason != null and revokeReason != ''">revoke_reason,</if>
|
||||
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
||||
@ -180,6 +177,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="revokeManCode != null and revokeManCode != ''">#{revokeManCode},</if>
|
||||
<if test="revokeManName != null and revokeManName != ''">#{revokeManName},</if>
|
||||
<if test="revokeReason != null and revokeReason != ''">#{revokeReason},</if>
|
||||
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
||||
@ -224,16 +222,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEmisWriteoffApplyById" parameterType="Long">
|
||||
delete from emis_writeoff_apply where id = #{id}
|
||||
</delete>
|
||||
<update id="deleteEmisWriteoffApplyById" parameterType="Long">
|
||||
update emis_writeoff_apply set del_flag = '2' where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEmisWriteoffApplyByIds" parameterType="String">
|
||||
delete from emis_writeoff_apply where id in
|
||||
<update id="deleteEmisWriteoffApplyByIds" parameterType="String">
|
||||
update emis_writeoff_apply set del_flag = '2' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</update>
|
||||
|
||||
<update id="auditCenterPass" parameterType="EmisWriteoffApply">
|
||||
update emis_writeoff_apply set
|
||||
|
||||
Loading…
Reference in New Issue
Block a user