MailTemplateMapper.xml 1.4 KB

1234567891011121314151617181920212223242526272829
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.usoftchina.saas.mail.mapper.MailTemplateMapper">
  4. <insert id="insert" parameterType="com.usoftchina.saas.mail.po.MailTemplate">
  5. insert into `m_template`(`id`,`subject`,`text`)
  6. values (#{id,jdbcType=VARCHAR},#{subject,jdbcType=VARCHAR},#{text,jdbcType=VARCHAR})
  7. </insert>
  8. <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.mail.po.MailTemplate">
  9. update `m_template` set `subject`=#{subject,jdbcType=VARCHAR},`text`=#{text,jdbcType=VARCHAR}
  10. where `id`=#{id,jdbcType=VARCHAR}
  11. </update>
  12. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  13. delete from `m_template` where `id`=#{id}
  14. </delete>
  15. <resultMap id="BaseResultMap" type="com.usoftchina.saas.mail.po.MailTemplate">
  16. <id column="id" jdbcType="VARCHAR" property="id"/>
  17. <result column="subject" jdbcType="VARCHAR" property="subject"/>
  18. <result column="text" jdbcType="VARCHAR" property="text"/>
  19. </resultMap>
  20. <sql id="baseColumns">
  21. `id`,`subject`,`text`
  22. </sql>
  23. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  24. select <include refid="baseColumns"/> from `m_template` where `id`=#{id}
  25. </select>
  26. </mapper>