emis-service/emis-biz/src/main/resources/mapper/EmisPrintTplRelMapper.xml
2024-06-02 10:57:46 +08:00

109 lines
6.3 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.EmisPrintTplRelMapper">
<resultMap type="EmisPrintTplRel" id="EmisPrintTplRelResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
<result property="id" column="id" />
<result property="merchId" column="merch_id" />
<result property="tplId" column="tpl_id" />
<result property="tplCode" column="tpl_code" />
<result property="tplName" column="tpl_name" />
</resultMap>
<sql id="selectEmisPrintTplRelVo">
select id, merch_id, tpl_id, tpl_code, tpl_name, del_flag, create_by, create_time, update_by, update_time, remark, create_site, update_site from emis_print_tpl_rel
</sql>
<select id="selectEmisPrintTplRelList" parameterType="EmisPrintTplRel" resultMap="EmisPrintTplRelResult">
<include refid="selectEmisPrintTplRelVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="merchId != null and merchId != ''"> and merch_id like concat('%', #{merchId}, '%')</if>
<if test="tplId != null "> and tpl_id = #{tplId}</if>
<if test="tplCode != null and tplCode != ''"> and tpl_code like concat('%', #{tplCode}, '%')</if>
<if test="tplName != null and tplName != ''"> and tpl_name like concat('%', #{tplName}, '%')</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>
<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>
</where>
order by create_time desc
</select>
<select id="selectEmisPrintTplRelById" parameterType="Long" resultMap="EmisPrintTplRelResult">
select id, merch_id, tpl_id, tpl_code, tpl_name, del_flag, create_by, create_time, update_by, update_time, remark, create_site, update_site
from emis_print_tpl_rel a
where a.id = #{id}
</select>
<insert id="insertEmisPrintTplRel" parameterType="EmisPrintTplRel">
insert into emis_print_tpl_rel
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="merchId != null and merchId != ''">merch_id,</if>
<if test="tplId != null">tpl_id,</if>
<if test="tplCode != null and tplCode != ''">tpl_code,</if>
<if test="tplName != null and tplName != ''">tpl_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>
<if test="updateTime != null">update_time,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createSite != null and createSite != ''">create_site,</if>
<if test="updateSite != null and updateSite != ''">update_site,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="merchId != null and merchId != ''">#{merchId},</if>
<if test="tplId != null">#{tplId},</if>
<if test="tplCode != null and tplCode != ''">#{tplCode},</if>
<if test="tplName != null and tplName != ''">#{tplName},</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>
<if test="createSite != null and createSite != ''">#{createSite},</if>
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
</trim>
</insert>
<update id="updateEmisPrintTplRel" parameterType="EmisPrintTplRel">
update emis_print_tpl_rel
<trim prefix="SET" suffixOverrides=",">
<if test="merchId != null and merchId != ''">merch_id = #{merchId},</if>
<if test="tplId != null">tpl_id = #{tplId},</if>
<if test="tplCode != null and tplCode != ''">tpl_code = #{tplCode},</if>
<if test="tplName != null and tplName != ''">tpl_name = #{tplName},</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>
<if test="createSite != null and createSite != ''">create_site = #{createSite},</if>
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteEmisPrintTplRelById" parameterType="Long">
delete from emis_print_tpl_rel where id = #{id}
</delete>
<delete id="deleteEmisPrintTplRelByIds" parameterType="String">
delete from emis_print_tpl_rel where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>