1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <?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.simuwang.base.mapper.EmailTemplateMappingMapper">
- <resultMap id="BaseResultMap" type="com.simuwang.base.pojo.dos.EmailTemplateMappingDO">
- <id column="id" property="id"/>
- <result column="template_id" property="templateId"/>
- <result column="title" property="title"/>
- <result column="email" property="email"/>
- <result column="company_name" property="companyName"/>
- <result column="description" property="description"/>
- <result column="status" property="status"/>
- <result column="isvalid" property="isvalid"/>
- <result column="creatorid" property="creatorId"/>
- <result column="createtime" property="createTime"/>
- <result column="updaterid" property="updaterId"/>
- <result column="updatetime" property="updateTime"/>
- <result column="template_name" property="templateName"/>
- </resultMap>
- <insert id="saveEmailTemplateMappingDO">
- insert into PPW_EMAIL.email_template_mapping(template_id,title,email,company_name,description,status,isvalid,creatorid,createtime,updaterid,updatetime)
- values
- (#{templateId},#{title},#{email},#{companyName},#{description},#{status},#{isvalid},#{creatorId},#{createTime},#{updaterId},#{updateTime})
- </insert>
- <update id="deleteTemplateSetting">
- update PPW_EMAIL.email_template_mapping set isvalid=0,updatetime=sysdate(),updaterid=#{userId}
- where isvalid=1 and id in
- <foreach item="id" collection="idList" open="(" separator="," close=")">
- #{id}
- </foreach>
- </update>
- <update id="updateEmailTemplateMappingDO">
- update PPW_EMAIL.email_template_mapping set template_id=#{templateId},title=#{title},email=#{email},company_name=#{companyName},
- description=#{description}, status=#{status},updatetime=#{updateTime},updaterid=#{updaterId}
- where isvalid=1 and id=#{id}
- </update>
- <select id="queryByEmail" resultType="com.simuwang.base.pojo.dos.EmailTemplateInfoDO">
- select t1.template_id as id,
- t2.direction as direction,
- t2.type as type,
- t2.start_index as startIndex,
- t2.end_index as endIndex
- from PPW_EMAIL.email_template_mapping t1
- join PPW_EMAIL.email_template_info t2 on t2.id = t1.template_id and t2.isvalid = 1 and t2.status = 1
- where t1.email = #{email}
- and t2.type = #{type}
- and t1.isvalid = 1
- and t2.status = 1
- </select>
- <select id="searchTemplateSettingList" resultMap="BaseResultMap">
- select mapping.id,mapping.template_id,mapping.title,mapping.email,mapping.company_name,mapping.description,mapping.status,
- t.name as template_name
- from PPW_EMAIL.email_template_mapping mapping
- join PPW_EMAIL.email_template_info t on t.id = mapping.template_id and t.isvalid = 1 and t.status = 1
- where mapping.isvalid=1
- <if test="title != null and title != ''">
- mapping.title like concat('%',#{title},'%')
- </if>
- <if test="email != null and email != ''">
- mapping.email like concat('%',#{email},'%')
- </if>
- <if test="companyName != null and companyName != ''">
- mapping.company_name like concat('%',#{companyName},'%')
- </if>
- <if test="templateName != null and templateName != ''">
- t.name like concat('%',#{templateName},'%')
- </if>
- <if test="status != null">
- mapping.status=#{status}
- </if>
- limit #{offset},#{pageSize}
- </select>
- <select id="countTemplateSettingList" resultType="java.lang.Long">
- select count(mapping.id)
- from PPW_EMAIL.email_template_mapping mapping
- join PPW_EMAIL.email_template_info t on t.id = mapping.template_id and t.isvalid = 1 and t.status = 1
- where mapping,isvalid=1
- <if test="title != null and title != ''">
- mapping.title like concat('%',#{title},'%')
- </if>
- <if test="email != null and email != ''">
- mapping.email like concat('%',#{email},'%')
- </if>
- <if test="companyName != null and companyName != ''">
- mapping.company_name like concat('%',#{companyName},'%')
- </if>
- <if test="templateName != null and templateName != ''">
- t.name like concat('%',#{templateName},'%')
- </if>
- <if test="status != null">
- mapping.status=#{status}
- </if>
- </select>
- </mapper>
|