207 lines
7.1 KiB
XML
207 lines
7.1 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.zhwl.printset.mapper.ZdyPrintTemplateMapper">
|
||
|
|
||
|
<resultMap type="ZdyPrintTemplate" id="ZdyPrintTemplateResult">
|
||
|
<result property="id" column="id"/>
|
||
|
<result property="deptId" column="dept_id"/>
|
||
|
<result property="name" column="name"/>
|
||
|
<result property="type" column="type"/>
|
||
|
<result property="width" column="width"/>
|
||
|
<result property="height" column="height"/>
|
||
|
<result property="margins" column="margins"/>
|
||
|
<result property="image" column="image"/>
|
||
|
<result property="createTime" column="create_time"/>
|
||
|
<result property="imageModule" column="image_module"/>
|
||
|
<result property="useFlag" column="use_flag"/>
|
||
|
<result property="printDevice" column="print_device"/>
|
||
|
<result property="category" column="category"/>
|
||
|
</resultMap>
|
||
|
|
||
|
<sql id="selectZdyPrintTemplateVo">
|
||
|
select te.id,
|
||
|
te.dept_id,
|
||
|
te.name,
|
||
|
te.type,
|
||
|
te.width,
|
||
|
te.height,
|
||
|
te.margins,
|
||
|
te.image,
|
||
|
te.create_time,
|
||
|
te.image_module,
|
||
|
te.use_flag,
|
||
|
te.print_device,
|
||
|
te.category
|
||
|
from zdy_print_template te
|
||
|
</sql>
|
||
|
|
||
|
<select id="selectZdyPrintTemplateList" parameterType="ZdyPrintTemplate" resultMap="ZdyPrintTemplateResult">
|
||
|
<include refid="selectZdyPrintTemplateVo"/>
|
||
|
left join sys_dept d on d.dept_id = te.dept_id
|
||
|
<where>
|
||
|
<if test="deptId != null ">
|
||
|
and dept_id = #{deptId}
|
||
|
</if>
|
||
|
<if test="name != null and name != ''">
|
||
|
and name like concat('%', #{name}, '%')
|
||
|
</if>
|
||
|
<if test="type != null ">
|
||
|
and type = #{type}
|
||
|
</if>
|
||
|
<if test="width != null ">
|
||
|
and width = #{width}
|
||
|
</if>
|
||
|
<if test="height != null ">
|
||
|
and height = #{height}
|
||
|
</if>
|
||
|
<if test="margins != null ">
|
||
|
and margins = #{margins}
|
||
|
</if>
|
||
|
<if test="image != null and image != ''">
|
||
|
and image = #{image}
|
||
|
</if>
|
||
|
<if test="useFlag != null and useFlag != ''">
|
||
|
and use_flag = #{useFlag}
|
||
|
</if>
|
||
|
<if test="category != null and category != ''">
|
||
|
and category = #{category}
|
||
|
</if>
|
||
|
${params.dataScope}
|
||
|
</where>
|
||
|
</select>
|
||
|
|
||
|
<select id="selectZdyPrintTemplateById" parameterType="Integer"
|
||
|
resultMap="ZdyPrintTemplateResult">
|
||
|
<include refid="selectZdyPrintTemplateVo"/>
|
||
|
where id = #{id}
|
||
|
</select>
|
||
|
<select id="selectZdyPrintTemplateByType" resultMap="ZdyPrintTemplateResult">
|
||
|
<include refid="selectZdyPrintTemplateVo"/>
|
||
|
<where>
|
||
|
and use_flag = "Y"
|
||
|
<if test="deptId != null">and dept_id = #{deptId}</if>
|
||
|
<if test="type != null">and type= #{type}</if>
|
||
|
</where>
|
||
|
|
||
|
</select>
|
||
|
|
||
|
<insert id="insertZdyPrintTemplate" parameterType="ZdyPrintTemplate" useGeneratedKeys="true"
|
||
|
keyProperty="id">
|
||
|
insert into zdy_print_template
|
||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
<if test="deptId != null">dept_id,
|
||
|
</if>
|
||
|
<if test="name != null and name != ''">name,
|
||
|
</if>
|
||
|
<if test="type != null">type,
|
||
|
</if>
|
||
|
<if test="width != null">width,
|
||
|
</if>
|
||
|
<if test="height != null">height,
|
||
|
</if>
|
||
|
<if test="margins != null">margins,
|
||
|
</if>
|
||
|
<if test="image != null">image,
|
||
|
</if>
|
||
|
<if test="createTime != null">create_time,
|
||
|
</if>
|
||
|
<if test="imageModule != null and imageModule != ''">
|
||
|
image_module,
|
||
|
</if>
|
||
|
<if test="useFlag != null and useFlag != ''">
|
||
|
use_flag,
|
||
|
</if>
|
||
|
<if test="printDevice != null and printDevice != ''">
|
||
|
print_device,
|
||
|
</if>
|
||
|
<if test="category != null and category != ''">
|
||
|
category,
|
||
|
</if>
|
||
|
</trim>
|
||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
<if test="deptId != null">#{deptId},
|
||
|
</if>
|
||
|
<if test="name != null and name != ''">#{name},
|
||
|
</if>
|
||
|
<if test="type != null">#{type},
|
||
|
</if>
|
||
|
<if test="width != null">#{width},
|
||
|
</if>
|
||
|
<if test="height != null">#{height},
|
||
|
</if>
|
||
|
<if test="margins != null">#{margins},
|
||
|
</if>
|
||
|
<if test="image != null">#{image},
|
||
|
</if>
|
||
|
<if test="createTime != null">#{createTime},
|
||
|
</if>
|
||
|
<if test="imageModule != null and imageModule != ''">#{imageModule},
|
||
|
</if>
|
||
|
<if test="useFlag != null and useFlag != ''">#{useFlag},
|
||
|
</if>
|
||
|
<if test="printDevice != null and printDevice != ''">#{printDevice},
|
||
|
</if>
|
||
|
<if test="category != null and category != ''">#{category},
|
||
|
</if>
|
||
|
</trim>
|
||
|
</insert>
|
||
|
|
||
|
<update id="updateZdyPrintTemplate" parameterType="ZdyPrintTemplate">
|
||
|
update zdy_print_template
|
||
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
<if test="deptId != null">dept_id =
|
||
|
#{deptId},
|
||
|
</if>
|
||
|
<if test="name != null and name != ''">name =
|
||
|
#{name},
|
||
|
</if>
|
||
|
<if test="type != null">type =
|
||
|
#{type},
|
||
|
</if>
|
||
|
<if test="width != null">width =
|
||
|
#{width},
|
||
|
</if>
|
||
|
<if test="height != null">height =
|
||
|
#{height},
|
||
|
</if>
|
||
|
<if test="margins != null">margins =
|
||
|
#{margins},
|
||
|
</if>
|
||
|
<if test="image != null">image =
|
||
|
#{image},
|
||
|
</if>
|
||
|
<if test="createTime != null">create_time =
|
||
|
#{createTime},
|
||
|
</if>
|
||
|
<if test="imageModule != null">image_module =
|
||
|
#{imageModule},
|
||
|
</if>
|
||
|
<if test="useFlag != null">use_flag =
|
||
|
#{useFlag},
|
||
|
</if>
|
||
|
<if test="printDevice != null">print_device =
|
||
|
#{printDevice},
|
||
|
</if>
|
||
|
<if test="category != null">category =
|
||
|
#{category},
|
||
|
</if>
|
||
|
</trim>
|
||
|
where id = #{id}
|
||
|
</update>
|
||
|
|
||
|
<delete id="deleteZdyPrintTemplateById" parameterType="Integer">
|
||
|
delete
|
||
|
from zdy_print_template
|
||
|
where id = #{id}
|
||
|
</delete>
|
||
|
|
||
|
<delete id="deleteZdyPrintTemplateByIds" parameterType="String">
|
||
|
delete from zdy_print_template where id in
|
||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||
|
#{id}
|
||
|
</foreach>
|
||
|
</delete>
|
||
|
</mapper>
|