You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
udi-spms-java/src/main/resources/mybatis/mapper/system/SystemPDFModuleDao.xml

189 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.glxp.api.dao.system.SystemPDFModuleDao">
<select id="queryPage" parameterType="com.glxp.api.req.system.FilterPdfModuleRequest"
resultType="com.glxp.api.entity.system.SystemPDFModuleEntity">
SELECT id
, name
, param
, fieldExplain
, remark
, templateId
, create_time
, update_time
, templateDlUrl
, templateType
, remark1
, remark2
, remark3
, modelKey
FROM sys_pdf_module
<where>
<if test="templateId != null and '' != templateId">
AND `templateId` LIKE CONCAT(#{templateId}, '%')
</if>
<if test="modelKey != null and '' != modelKey">
AND `modelKey` LIKE CONCAT(#{modelKey}, '%')
</if>
<if test="name != null and '' != name">
AND `name` LIKE CONCAT('%', #{name}, '%')
</if>
<if test="templateType != null">
AND templateType = #{templateType}
</if>
</where>
</select>
<select id="findSystemPDFModule" parameterType="com.glxp.api.req.system.FilterPdfModuleRequest"
resultType="com.glxp.api.entity.system.SystemPDFModuleEntity">
SELECT *
FROM sys_pdf_module
WHERE id = #{id}
</select>
<select id="findSystemPDFModuleByKey" parameterType="com.glxp.api.req.system.FilterPdfModuleRequest"
resultType="com.glxp.api.entity.system.SystemPDFModuleEntity">
SELECT *
FROM sys_pdf_module
WHERE modelKey = #{modelKey}
</select>
<select id="selectById" parameterType="java.lang.String"
resultType="com.glxp.api.entity.system.SystemPDFModuleEntity">
select *
FROM sys_pdf_module
WHERE id = #{id}
</select>
<update id="updateById" parameterType="com.glxp.api.entity.system.SystemPDFModuleEntity">
UPDATE sys_pdf_module
<set>
<if test="name != null">
name=#{name},
</if>
<if test="param != null">
param=#{param},
</if>
<if test="fieldExplain != null">
fieldExplain=#{fieldExplain},
</if>
<if test="remark != null">
remark=#{remark},
</if>
<if test="templateId != null">
templateId=#{templateId},
</if>
<if test="create_time != null">
create_time=#{create_time},
</if>
<if test="update_time != null">
update_time=#{update_time},
</if>
<if test="templateDlUrl != null">
templateDlUrl=#{templateDlUrl},
</if>
<if test="templateType != null">
templateType=#{templateType},
</if>
<if test="remark1 != null">
remark1=#{remark1},
</if>
<if test="remark2 != null">
remark2=#{remark2},
</if>
<if test="remark3 != null">
remark3=#{remark3},
</if>
</set>
WHERE id = #{id}
</update>
<insert id="insert" parameterType="com.glxp.api.entity.system.SystemPDFModuleEntity">
insert INTO sys_pdf_module( name, param, fieldExplain, remark, templateId, create_time, update_time
, templateDlUrl, templateType
, remark1, remark2, remark3)
values (#{name},
#{param},
#{fieldExplain},
#{templateId},
#{remark},
#{create_time},
#{update_time}, #{templateDlUrl}, #{templateType}, #{remark1}, #{remark2}, #{remark3})
</insert>
<select id="listPDFModules" parameterType="java.lang.Integer"
resultType="com.glxp.api.entity.system.SystemPDFModuleEntity">
SELECT id, name
FROM sys_pdf_module
</select>
<delete id="deleteById" parameterType="java.lang.Integer">
delete
from sys_pdf_module
where id = #{id}
</delete>
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id"
parameterType="com.glxp.api.entity.system.SystemPDFModuleEntity" useGeneratedKeys="true">
insert into sys_pdf_module
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
`name`,
param,
fieldExplain,
remark,
templateId,
create_time,
update_time,
templateDlUrl,
templateType,
remark1,
remark2,
remark3,
modelKey,
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
#{name,jdbcType=VARCHAR},
#{param,jdbcType=VARCHAR},
#{fieldExplain,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR},
#{templateId,jdbcType=INTEGER},
#{create_time,jdbcType=TIMESTAMP},
#{update_time,jdbcType=TIMESTAMP},
#{templateDlUrl,jdbcType=VARCHAR},
#{templateType,jdbcType=INTEGER},
#{remark1,jdbcType=VARCHAR},
#{remark2,jdbcType=VARCHAR},
#{remark3,jdbcType=VARCHAR},
#{modelKey,jdbcType=VARCHAR},
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
`name` = #{name,jdbcType=VARCHAR},
param = #{param,jdbcType=VARCHAR},
fieldExplain = #{fieldExplain,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
templateId = #{templateId,jdbcType=INTEGER},
create_time = #{create_time,jdbcType=TIMESTAMP},
update_time = #{update_time,jdbcType=TIMESTAMP},
templateDlUrl = #{templateDlUrl,jdbcType=VARCHAR},
templateType = #{templateType,jdbcType=INTEGER},
remark1 = #{remark1,jdbcType=VARCHAR},
remark2 = #{remark2,jdbcType=VARCHAR},
remark3 = #{remark3,jdbcType=VARCHAR},
modelKey = #{modelKey,jdbcType=VARCHAR},
</trim>
</insert>
</mapper>