MailLogMapper.xml 1.7 KB

12345678910111213141516171819202122232425262728293031
  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.MailLogMapper">
  4. <insert id="insert" parameterType="com.usoftchina.saas.mail.po.MailLog"
  5. useGeneratedKeys="true" keyProperty="id">
  6. insert into m_log(template_id,subject,text,to,company_id,creator_id,create_time)
  7. values (#{templateId,jdbcType=VARCHAR},#{subject,jdbcType=VARCHAR},#{text,jdbcType=VARCHAR},
  8. #{from,jdbcType=VARCHAR},#{to,jdbcType=VARCHAR},#{companyId,jdbcType=BIGINT},
  9. #{creatorId,jdbcType=BIGINT},#{createTime,jdbcType=TIMESTAMP})
  10. </insert>
  11. <resultMap id="BaseResultMap" type="com.usoftchina.saas.mail.po.MailLog">
  12. <id column="id" jdbcType="BIGINT" property="id"/>
  13. <result column="template_id" jdbcType="BIGINT" property="templateId"/>
  14. <result column="subject" jdbcType="VARCHAR" property="subject"/>
  15. <result column="text" jdbcType="VARCHAR" property="text"/>
  16. <result column="from" jdbcType="VARCHAR" property="from"/>
  17. <result column="to" jdbcType="VARCHAR" property="to"/>
  18. <result column="company_id" jdbcType="INTEGER" property="companyId"/>
  19. <result column="creator_id" jdbcType="BIGINT" property="creatorId"/>
  20. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  21. </resultMap>
  22. <sql id="baseColumns">
  23. id,template_id,subject,text,from,to,company_id,create_time
  24. </sql>
  25. <select id="selectAll" resultMap="BaseResultMap">
  26. select <include refid="baseColumns"/> from m_log order by create_time desc
  27. </select>
  28. </mapper>