|
@@ -0,0 +1,71 @@
|
|
|
+<?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.daq.EmailTemplateMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.simuwang.base.pojo.dos.EmailTemplateDO">
|
|
|
+ <id column="id" property="id"/>
|
|
|
+ <result column="template_code" property="templateCode"/>
|
|
|
+ <result column="email_title" property="emailTitle"/>
|
|
|
+ <result column="email_body" property="emailBody"/>
|
|
|
+ <result column="open_status" property="openStatus"/>
|
|
|
+ <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"/>
|
|
|
+ </resultMap>
|
|
|
+ <insert id="saveTemplateInfo" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into email_template(template_code,email_title,email_body,open_status,isvalid,creatorid,createtime,updaterid,updatetime)
|
|
|
+ values
|
|
|
+ (#{templateCode},#{emailTitle},#{emailBody},#{openStatus},#{isvalid},#{creatorId},#{createTime},#{updaterId},#{updateTime})
|
|
|
+ </insert>
|
|
|
+ <update id="deleteTemplateList">
|
|
|
+ update email_template set isvalid=0,updatetime=now(),updaterid=#{userId} where isvalid=1
|
|
|
+ and id in
|
|
|
+ <foreach item="id" collection="idList" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+ <update id="updateTemplateInfo">
|
|
|
+ update email_template set template_code=#{templateCode},email_title=#{emailTitle},email_body=#{emailBody},open_status=#{openStatus},updatetime=#{updateTime},updaterid=#{updaterId}
|
|
|
+ where id=#{id} and isvalid=1
|
|
|
+ </update>
|
|
|
+ <update id="updateOpenStatus">
|
|
|
+ update email_template set open_status =#{item.status},updatetime=now(),updaterid=#{userId} where id=#{item.id}
|
|
|
+ </update>
|
|
|
+ <select id="searchEmailTemplateList" resultMap="BaseResultMap">
|
|
|
+ select id,template_code,email_title,email_body,open_status,isvalid,creatorid,createtime,updaterid,updatetime
|
|
|
+ from email_template where isvalid=1
|
|
|
+ <if test="emailTitle != null and emailTitle !=''">
|
|
|
+ and email_title like concat('%',#{emailTitle},'%')
|
|
|
+ </if>
|
|
|
+ <if test="openStatus != null">
|
|
|
+ and open_status =#{openStatus}
|
|
|
+ </if>
|
|
|
+ order by updatetime desc
|
|
|
+ limit #{offset},#{pageSize}
|
|
|
+ </select>
|
|
|
+ <select id="countEmailTemplateList" resultType="java.lang.Long">
|
|
|
+ select count(1)
|
|
|
+ from email_template where isvalid=1
|
|
|
+ <if test="emailTitle != null and emailTitle !=''">
|
|
|
+ and email_title like concat('%',#{emailTitle},'%')
|
|
|
+ </if>
|
|
|
+ <if test="openStatus != null">
|
|
|
+ and open_status =#{openStatus}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="searchTemplateById" resultMap="BaseResultMap">
|
|
|
+ select id,template_code,email_title,email_body,open_status,isvalid,creatorid,createtime,updaterid,updatetime
|
|
|
+ from email_template where isvalid=1 and id=#{id}
|
|
|
+ </select>
|
|
|
+ <select id="searchTemplateByName" resultMap="BaseResultMap">
|
|
|
+ select id,template_code,email_title,email_body,open_status,isvalid,creatorid,createtime,updaterid,updatetime
|
|
|
+ from email_template where isvalid=1 and email_title=#{emailTitle} limit 1
|
|
|
+ </select>
|
|
|
+ <select id="selectByCode" resultMap="BaseResultMap">
|
|
|
+ select id,template_code,email_title,email_body,open_status,isvalid,creatorid,createtime,updaterid,updatetime
|
|
|
+ from email_template where isvalid=1 and template_code=#{templateCode}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+</mapper>
|