emis-service/emis-biz/src/main/resources/mapper/EmisTmsPackMapper.xml
2024-03-01 17:13:00 +08:00

111 lines
6.6 KiB
XML

<?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.xdadan.erp.emis.mapper.EmisTmsPackMapper">
<resultMap type="EmisTmsPack" id="EmisTmsPackResult">
<result property="id" column="id" />
<result property="packCode" column="pack_code" />
<result property="packName" column="pack_name" />
<result property="packDate" column="pack_date" />
<result property="createSiteCode" column="create_site_code" />
<result property="modifySiteCode" column="modify_site_code" />
<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" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectEmisTmsPackVo">
select id, pack_code, pack_name, pack_date, create_site_code, modify_site_code, del_flag, create_by, create_time, update_by, update_time, remark from emis_tms_pack
</sql>
<select id="selectEmisTmsPackList" parameterType="EmisTmsPack" resultMap="EmisTmsPackResult">
<include refid="selectEmisTmsPackVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="packCode != null and packCode != ''"> and pack_code like concat('%', #{packCode}, '%')</if>
<if test="packName != null and packName != ''"> and pack_name like concat('%', #{packName}, '%')</if>
<if test="packDate != null and packDate != ''"> and pack_date like concat('%', #{packDate}, '%')</if>
<if test="createSiteCode != null and createSiteCode != ''"> and create_site_code like concat('%', #{createSiteCode}, '%')</if>
<if test="modifySiteCode != null and modifySiteCode != ''"> and modify_site_code like concat('%', #{modifySiteCode}, '%')</if>
<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>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
</where>
order by create_time desc
</select>
<select id="selectEmisTmsPackById" parameterType="Long" resultMap="EmisTmsPackResult">
select id, pack_code, pack_name, pack_date, create_site_code, modify_site_code, del_flag, create_by, create_time, update_by, update_time, remark
from emis_tms_pack a
where a.id = #{id}
</select>
<insert id="insertEmisTmsPack" parameterType="EmisTmsPack">
insert into emis_tms_pack
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="packCode != null and packCode != ''">pack_code,</if>
<if test="packName != null and packName != ''">pack_name,</if>
<if test="packDate != null and packDate != ''">pack_date,</if>
<if test="createSiteCode != null and createSiteCode != ''">create_site_code,</if>
<if test="modifySiteCode != null and modifySiteCode != ''">modify_site_code,</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>
<if test="updateTime != null">update_time,</if>
<if test="remark != null and remark != ''">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="packCode != null and packCode != ''">#{packCode},</if>
<if test="packName != null and packName != ''">#{packName},</if>
<if test="packDate != null and packDate != ''">#{packDate},</if>
<if test="createSiteCode != null and createSiteCode != ''">#{createSiteCode},</if>
<if test="modifySiteCode != null and modifySiteCode != ''">#{modifySiteCode},</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>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null and remark != ''">#{remark},</if>
</trim>
</insert>
<update id="updateEmisTmsPack" parameterType="EmisTmsPack">
update emis_tms_pack
<trim prefix="SET" suffixOverrides=",">
<if test="packCode != null and packCode != ''">pack_code = #{packCode},</if>
<if test="packName != null and packName != ''">pack_name = #{packName},</if>
<if test="packDate != null and packDate != ''">pack_date = #{packDate},</if>
<if test="createSiteCode != null and createSiteCode != ''">create_site_code = #{createSiteCode},</if>
<if test="modifySiteCode != null and modifySiteCode != ''">modify_site_code = #{modifySiteCode},</if>
<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>
<if test="remark != null and remark != ''">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteEmisTmsPackById" parameterType="Long">
delete from emis_tms_pack where id = #{id}
</delete>
<delete id="deleteEmisTmsPackByIds" parameterType="String">
delete from emis_tms_pack where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>