emis-service/emis-biz/src/main/resources/mapper/EmisPrintTplMapper.xml
2024-08-08 10:39:13 +08:00

162 lines
9.9 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.EmisPrintTplMapper">
<resultMap type="EmisPrintTpl" id="EmisPrintTplResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
<result property="id" column="id" />
<result property="code" column="code" />
<result property="name" column="name" />
<result property="version" column="version" />
<result property="isPublic" column="is_public" />
<result property="merchId" column="merch_id" />
<result property="expressType" column="express_type" />
<result property="tplData" column="tpl_data" />
<result property="tplEncData" column="tpl_enc_data" />
<result property="tplPdfData" column="tpl_pdf_data" />
<result property="tplPicUrl" column="tpl_pic_url" />
<result property="orderNum" column="order_num" />
<result property="status" column="status" />
</resultMap>
<sql id="selectEmisPrintTplVo">
select id, code, name, version, is_public, merch_id, express_type, tpl_data, tpl_pdf_data, tpl_pic_url, order_num, status, del_flag, create_by, create_time, update_by, update_time, remark, create_site, update_site from emis_print_tpl
</sql>
<select id="selectEmisPrintTplList" parameterType="EmisPrintTpl" resultMap="EmisPrintTplResult">
<include refid="selectEmisPrintTplVo"/>
<where>
del_flag='0'
<if test="id != null "> and id = #{id}</if>
<if test="code != null and code != ''"> and code=#{code}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="version != null and version != ''"> and version like concat('%', #{version}, '%')</if>
<if test="isPublic != null "> and is_public = #{isPublic}</if>
<if test="merchId != null "> and merch_id = #{merchId}</if>
<if test="expressType != null and expressType != ''"> and express_type like concat('%', #{expressType}, '%')</if>
<if test="tplData != null and tplData != ''"> and tpl_data like concat('%', #{tplData}, '%')</if>
<if test="tplEncData != null and tplEncData != ''"> and tpl_enc_data like concat('%', #{tplEncData}, '%')</if>
<if test="tplPdfData != null and tplPdfData != ''"> and tpl_pdf_data like concat('%', #{tplPdfData}, '%')</if>
<if test="tplPicUrl != null and tplPicUrl != ''"> and tpl_pic_url like concat('%', #{tplPicUrl}, '%')</if>
<if test="orderNum != null "> and order_num = #{orderNum}</if>
<if test="status != null "> and status = #{status}</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 order_num desc
</select>
<select id="selectPrintTplListByPrinter" parameterType="EmisPrintTpl" resultMap="EmisPrintTplResult">
select id, code, name, version,express_type,tpl_enc_data from emis_print_tpl
where del_flag='0' and status=1
order by order_num desc
</select>
<select id="selectEmisPrintTplById" parameterType="Long" resultMap="EmisPrintTplResult">
select id, code, name, version, is_public, merch_id, express_type, tpl_data, tpl_enc_data, tpl_pdf_data, tpl_pic_url, order_num, status, del_flag, create_by, create_time, update_by, update_time, remark, create_site, update_site
from emis_print_tpl a
where del_flag='0' and a.id = #{id}
</select>
<select id="selectAppPrintTplByCode" parameterType="String" resultMap="EmisPrintTplResult">
select id, code, name, version, is_public, merch_id, express_type, tpl_data
from emis_print_tpl a
where del_flag='0' and a.code = #{code}
</select>
<insert id="insertEmisPrintTpl" parameterType="EmisPrintTpl">
insert into emis_print_tpl
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="code != null and code != ''">code,</if>
<if test="name != null and name != ''">name,</if>
<if test="version != null and version != ''">version,</if>
<if test="isPublic != null">is_public,</if>
<if test="merchId != null">merch_id,</if>
<if test="expressType != null and expressType != ''">express_type,</if>
<if test="tplData != null and tplData != ''">tpl_data,</if>
<if test="tplEncData != null and tplEncData != ''">tpl_enc_data,</if>
<if test="tplPdfData != null and tplPdfData != ''">tpl_pdf_data,</if>
<if test="tplPicUrl != null and tplPicUrl != ''">tpl_pic_url,</if>
<if test="orderNum != null">order_num,</if>
<if test="status != null">status,</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="code != null and code != ''">#{code},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="version != null and version != ''">#{version},</if>
<if test="isPublic != null">#{isPublic},</if>
<if test="merchId != null">#{merchId},</if>
<if test="expressType != null and expressType != ''">#{expressType},</if>
<if test="tplData != null and tplData != ''">#{tplData},</if>
<if test="tplEncData != null and tplEncData != ''">#{tplEncData},</if>
<if test="tplPdfData != null and tplPdfData != ''">#{tplPdfData},</if>
<if test="tplPicUrl != null and tplPicUrl != ''">#{tplPicUrl},</if>
<if test="orderNum != null">#{orderNum},</if>
<if test="status != null">#{status},</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="updateEmisPrintTpl" parameterType="EmisPrintTpl">
update emis_print_tpl
<trim prefix="SET" suffixOverrides=",">
<if test="code != null and code != ''">code = #{code},</if>
<if test="name != null and name != ''">name = #{name},</if>
<if test="version != null and version != ''">version = #{version},</if>
<if test="isPublic != null">is_public = #{isPublic},</if>
<if test="merchId != null">merch_id = #{merchId},</if>
<if test="expressType != null and expressType != ''">express_type = #{expressType},</if>
<if test="tplData != null and tplData != ''">tpl_data = #{tplData},</if>
<if test="tplEncData != null and tplEncData != ''">tpl_enc_data = #{tplEncData},</if>
<if test="tplPdfData != null and tplPdfData != ''">tpl_pdf_data = #{tplPdfData},</if>
<if test="tplPicUrl != null and tplPicUrl != ''">tpl_pic_url = #{tplPicUrl},</if>
<if test="orderNum != null">order_num = #{orderNum},</if>
<if test="status != null">status = #{status},</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="deleteEmisPrintTplById" parameterType="Long">
delete from emis_print_tpl where id = #{id}
</delete>
<delete id="deleteEmisPrintTplByIds" parameterType="String">
delete from emis_print_tpl where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>