emis-service/emis-biz/src/main/resources/mapper/EmisTmsPackDtlMapper.xml

132 lines
8.1 KiB
XML
Raw Normal View History

2024-03-01 09:13:00 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
2024-05-21 23:10:51 +00:00
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
2024-03-01 09:13:00 +00:00
<mapper namespace="com.xdadan.erp.emis.mapper.EmisTmsPackDtlMapper">
2024-05-21 23:10:51 +00:00
2024-03-01 09:13:00 +00:00
<resultMap type="EmisTmsPackDtl" id="EmisTmsPackDtlResult">
<result property="id" column="id" />
2024-05-21 23:10:51 +00:00
<result property="packNo" column="pack_no" />
2024-03-01 09:13:00 +00:00
<result property="billCode" column="bill_code" />
2024-05-21 23:10:51 +00:00
<result property="scanDate" column="scan_date" />
<result property="scanStatus" column="scan_status" />
<result property="packStatus" column="pack_status" />
2024-05-21 23:29:50 +00:00
<result property="scanMan" column="scan_man" />
2024-05-21 23:10:51 +00:00
<result property="remark" column="remark" />
<result property="tenantId" column="tenant_id" />
2024-03-01 09:13:00 +00:00
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
2024-05-21 23:10:51 +00:00
<result property="createSite" column="create_site" />
<result property="updateSite" column="update_site" />
2024-03-01 09:13:00 +00:00
</resultMap>
<sql id="selectEmisTmsPackDtlVo">
2024-05-21 23:29:50 +00:00
select id, pack_no, bill_code, scan_date, scan_status, pack_status, scan_man, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_tms_pack_dtl
2024-03-01 09:13:00 +00:00
</sql>
<select id="selectEmisTmsPackDtlList" parameterType="EmisTmsPackDtl" resultMap="EmisTmsPackDtlResult">
<include refid="selectEmisTmsPackDtlVo"/>
2024-05-21 23:10:51 +00:00
<where>
del_flag='0'
2024-03-01 09:13:00 +00:00
<if test="id != null "> and id = #{id}</if>
2024-05-21 23:10:51 +00:00
<if test="packNo != null and packNo != ''"> and pack_no like concat('%', #{packNo}, '%')</if>
2024-03-01 09:13:00 +00:00
<if test="billCode != null "> and bill_code = #{billCode}</if>
2024-05-21 23:10:51 +00:00
<if test="scanDate != null "> and scan_date = #{scanDate}</if>
<if test="scanStatus != null and scanStatus != ''"> and scan_status like concat('%', #{scanStatus}, '%')</if>
<if test="packStatus != null and packStatus != ''"> and pack_status like concat('%', #{packStatus}, '%')</if>
2024-05-21 23:29:50 +00:00
<if test="scanMan != null and scanMan != ''"> and scan_man like concat('%', #{scanMan}, '%')</if>
2024-05-21 23:10:51 +00:00
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
<if test="tenantId != null and tenantId != ''"> and tenant_id like concat('%', #{tenantId}, '%')</if>
2024-03-01 09:13:00 +00:00
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
2024-05-21 23:10:51 +00:00
<if test="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
<if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>
2024-03-01 09:13:00 +00:00
</where>
order by create_time desc
</select>
2024-05-21 23:10:51 +00:00
2024-03-01 09:13:00 +00:00
<select id="selectEmisTmsPackDtlById" parameterType="Long" resultMap="EmisTmsPackDtlResult">
2024-05-21 23:29:50 +00:00
select id, pack_no, bill_code, scan_date, scan_status, pack_status, scan_man, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
2024-03-01 09:13:00 +00:00
from emis_tms_pack_dtl a
where a.id = #{id}
</select>
2024-05-21 23:10:51 +00:00
<insert id="insertEmisTmsPackDtl" parameterType="EmisTmsPackDtl" useGeneratedKeys="true" keyProperty="id">
2024-03-01 09:13:00 +00:00
insert into emis_tms_pack_dtl
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
2024-05-21 23:10:51 +00:00
<if test="packNo != null and packNo != ''">pack_no,</if>
2024-03-01 09:13:00 +00:00
<if test="billCode != null">bill_code,</if>
2024-05-21 23:10:51 +00:00
<if test="scanDate != null">scan_date,</if>
<if test="scanStatus != null and scanStatus != ''">scan_status,</if>
<if test="packStatus != null and packStatus != ''">pack_status,</if>
2024-05-21 23:29:50 +00:00
<if test="scanMan != null and scanMan != ''">scan_man,</if>
2024-05-21 23:10:51 +00:00
<if test="remark != null and remark != ''">remark,</if>
<if test="tenantId != null and tenantId != ''">tenant_id,</if>
2024-03-01 09:13:00 +00:00
<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>
<if test="updateTime != null">update_time,</if>
2024-05-21 23:10:51 +00:00
<if test="createSite != null and createSite != ''">create_site,</if>
<if test="updateSite != null and updateSite != ''">update_site,</if>
</trim>
2024-03-01 09:13:00 +00:00
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
2024-05-21 23:10:51 +00:00
<if test="packNo != null and packNo != ''">#{packNo},</if>
2024-03-01 09:13:00 +00:00
<if test="billCode != null">#{billCode},</if>
2024-05-21 23:10:51 +00:00
<if test="scanDate != null">#{scanDate},</if>
<if test="scanStatus != null and scanStatus != ''">#{scanStatus},</if>
<if test="packStatus != null and packStatus != ''">#{packStatus},</if>
2024-05-21 23:29:50 +00:00
<if test="scanMan != null and scanMan != ''">#{scanMan},</if>
2024-05-21 23:10:51 +00:00
<if test="remark != null and remark != ''">#{remark},</if>
<if test="tenantId != null and tenantId != ''">#{tenantId},</if>
2024-03-01 09:13:00 +00:00
<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>
<if test="updateTime != null">#{updateTime},</if>
2024-05-21 23:10:51 +00:00
<if test="createSite != null and createSite != ''">#{createSite},</if>
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
</trim>
2024-03-01 09:13:00 +00:00
</insert>
<update id="updateEmisTmsPackDtl" parameterType="EmisTmsPackDtl">
update emis_tms_pack_dtl
<trim prefix="SET" suffixOverrides=",">
2024-05-21 23:10:51 +00:00
<if test="packNo != null and packNo != ''">pack_no = #{packNo},</if>
2024-03-01 09:13:00 +00:00
<if test="billCode != null">bill_code = #{billCode},</if>
2024-05-21 23:10:51 +00:00
<if test="scanDate != null">scan_date = #{scanDate},</if>
<if test="scanStatus != null and scanStatus != ''">scan_status = #{scanStatus},</if>
<if test="packStatus != null and packStatus != ''">pack_status = #{packStatus},</if>
2024-05-21 23:29:50 +00:00
<if test="scanMan != null and scanMan != ''">scan_man = #{scanMan},</if>
2024-05-21 23:10:51 +00:00
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="tenantId != null and tenantId != ''">tenant_id = #{tenantId},</if>
2024-03-01 09:13:00 +00:00
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
2024-05-21 23:10:51 +00:00
<if test="createSite != null and createSite != ''">create_site = #{createSite},</if>
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
2024-03-01 09:13:00 +00:00
</trim>
where id = #{id}
</update>
<delete id="deleteEmisTmsPackDtlById" parameterType="Long">
delete from emis_tms_pack_dtl where id = #{id}
</delete>
<delete id="deleteEmisTmsPackDtlByIds" parameterType="String">
2024-05-21 23:10:51 +00:00
delete from emis_tms_pack_dtl where id in
2024-03-01 09:13:00 +00:00
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>