|
|
|
<?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.SysPdfTemplateRelevanceCodeDao">
|
|
|
|
<resultMap id="BaseResultMap" autoMapping="true" type="com.glxp.api.entity.system.SysPdfTemplateRelevanceCodeEntity">
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
<!--@Table sys_pdf_template_relevance_code-->
|
|
|
|
<!-- <id column="id" jdbcType="INTEGER" property="id"/>-->
|
|
|
|
<result column="templateId" jdbcType="INTEGER" property="templateId"/>
|
|
|
|
<result column="customerId" jdbcType="BIGINT" property="customerId"/>
|
|
|
|
<result column="adminId" jdbcType="INTEGER" property="adminId"/>
|
|
|
|
<result column="moduleId" jdbcType="INTEGER" property="moduleId"/>
|
|
|
|
<result column="localAction" jdbcType="VARCHAR" property="localAction"/>
|
|
|
|
<result column="remark1" jdbcType="VARCHAR" property="remark1"/>
|
|
|
|
<result column="remark2" jdbcType="VARCHAR" property="remark2"/>
|
|
|
|
<result column="remark3" jdbcType="VARCHAR" property="remark3"/>
|
|
|
|
<result column="printType" jdbcType="TINYINT" property="printType"/>
|
|
|
|
<result column="modelKey" jdbcType="VARCHAR" property="modelKey"/>
|
|
|
|
</resultMap>
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
id,
|
|
|
|
templateId,
|
|
|
|
customerId,
|
|
|
|
adminId,
|
|
|
|
moduleId,
|
|
|
|
localAction,
|
|
|
|
remark1,
|
|
|
|
remark2,
|
|
|
|
remark3,
|
|
|
|
printType,
|
|
|
|
modelKey
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="filterList" parameterType="com.glxp.api.req.system.FilterPdfTemplateRelevanceRequest"
|
|
|
|
resultType="com.glxp.api.res.system.SystemPDFTemplateRelevanceResponse">
|
|
|
|
select basic_bussiness_type.`name` localActionName,
|
|
|
|
sys_pdf_template_relevance_code.id,
|
|
|
|
basic_bussiness_type.action localAction,
|
|
|
|
templateId,
|
|
|
|
moduleId,
|
|
|
|
sys_pdf_template.name templateName,
|
|
|
|
sys_pdf_template_relevance_code.remark1,
|
|
|
|
sys_pdf_template_relevance_code.remark2,
|
|
|
|
sys_pdf_template_relevance_code.remark3,
|
|
|
|
printType
|
|
|
|
from basic_bussiness_type
|
|
|
|
LEFT JOIN sys_pdf_template_relevance_code
|
|
|
|
on basic_bussiness_type.action = sys_pdf_template_relevance_code.localAction
|
|
|
|
LEFT JOIN sys_pdf_template on sys_pdf_template_relevance_code.templateId = sys_pdf_template.id
|
|
|
|
<where>
|
|
|
|
<if test="moduleId != null">
|
|
|
|
AND `moduleId` = #{moduleId}
|
|
|
|
</if>
|
|
|
|
<if test="localAction != null">
|
|
|
|
AND sys_pdf_template_relevance_code.`localAction` = #{localAction}
|
|
|
|
</if>
|
|
|
|
<if test="templateType != null">
|
|
|
|
AND sys_pdf_template_relevance_code.`templateType` = #{templateType}
|
|
|
|
</if>
|
|
|
|
<if test="modelKey != null">
|
|
|
|
AND sys_pdf_template_relevance_code.`modelKey` = #{modelKey}
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<insert id="upInsert" parameterType="com.glxp.api.entity.system.SysPdfTemplateRelevanceCodeEntity">
|
|
|
|
insert
|
|
|
|
ignore
|
|
|
|
INTO sys_pdf_template_relevance_code
|
|
|
|
(templateId, customerId, adminId, moduleId, localAction, remark1, remark2, remark3, printType, modelKey)
|
|
|
|
values (#{templateId},
|
|
|
|
#{customerId},
|
|
|
|
#{adminId},
|
|
|
|
#{moduleId},
|
|
|
|
#{localAction},
|
|
|
|
#{remark1},
|
|
|
|
#{remark2},
|
|
|
|
#{remark3},
|
|
|
|
#{printType},
|
|
|
|
#{modelKey})
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<select id="selectNameAndAction" resultType="com.glxp.api.entity.system.SysPdfTemplateRelevanceCodeEntity">
|
|
|
|
SELECT *
|
|
|
|
FROM sys_pdf_template_relevance_code
|
|
|
|
<where>
|
|
|
|
<if test="name != null">
|
|
|
|
AND `modelKey` = #{name}
|
|
|
|
</if>
|
|
|
|
<if test="localAction != null">
|
|
|
|
AND `localAction` = #{localAction}
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<insert id="insertOrUpdateEntity" keyColumn="id" keyProperty="id"
|
|
|
|
parameterType="com.glxp.api.entity.system.SysPdfTemplateRelevanceCodeEntity" useGeneratedKeys="true">
|
|
|
|
insert into sys_pdf_template_relevance_code
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="id != null">
|
|
|
|
id,
|
|
|
|
</if>
|
|
|
|
templateId,
|
|
|
|
customerId,
|
|
|
|
adminId,
|
|
|
|
moduleId,
|
|
|
|
localAction,
|
|
|
|
remark1,
|
|
|
|
remark2,
|
|
|
|
remark3,
|
|
|
|
printType,
|
|
|
|
modelKey,
|
|
|
|
updateTime,
|
|
|
|
</trim>
|
|
|
|
values
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="id != null">
|
|
|
|
#{id,jdbcType=INTEGER},
|
|
|
|
</if>
|
|
|
|
#{templateId,jdbcType=INTEGER},
|
|
|
|
#{customerId,jdbcType=BIGINT},
|
|
|
|
#{adminId,jdbcType=INTEGER},
|
|
|
|
#{moduleId,jdbcType=INTEGER},
|
|
|
|
#{localAction,jdbcType=VARCHAR},
|
|
|
|
#{remark1,jdbcType=VARCHAR},
|
|
|
|
#{remark2,jdbcType=VARCHAR},
|
|
|
|
#{remark3,jdbcType=VARCHAR},
|
|
|
|
#{printType,jdbcType=TINYINT},
|
|
|
|
#{modelKey,jdbcType=VARCHAR},
|
|
|
|
#{updateTime,jdbcType=DATE},
|
|
|
|
</trim>
|
|
|
|
on duplicate key update
|
|
|
|
<trim suffixOverrides=",">
|
|
|
|
<if test="id != null">
|
|
|
|
id = #{id,jdbcType=INTEGER},
|
|
|
|
</if>
|
|
|
|
templateId = #{templateId,jdbcType=INTEGER},
|
|
|
|
customerId = #{customerId,jdbcType=BIGINT},
|
|
|
|
adminId = #{adminId,jdbcType=INTEGER},
|
|
|
|
moduleId = #{moduleId,jdbcType=INTEGER},
|
|
|
|
localAction = #{localAction,jdbcType=VARCHAR},
|
|
|
|
remark1 = #{remark1,jdbcType=VARCHAR},
|
|
|
|
remark2 = #{remark2,jdbcType=VARCHAR},
|
|
|
|
remark3 = #{remark3,jdbcType=VARCHAR},
|
|
|
|
printType = #{printType,jdbcType=TINYINT},
|
|
|
|
modelKey = #{modelKey,jdbcType=VARCHAR},
|
|
|
|
updateTime = #{updateTime,jdbcType=DATE},
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
</mapper>
|