MailBoxInfoMapper.xml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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.simuwang.base.mapper.MailboxInfoMapper">
  4. <resultMap id="BaseResultMap" type="com.simuwang.base.pojo.dos.MailboxInfoDO">
  5. <id column="id" property="id"/>
  6. <result column="type" property="type"/>
  7. <result column="email" property="email"/>
  8. <result column="password" property="password"/>
  9. <result column="protocol" property="protocol"/>
  10. <result column="server" property="server"/>
  11. <result column="port" property="port"/>
  12. <result column="cron" property="cron"/>
  13. <result column="open_status" property="openStatus"/>
  14. <result column="description" property="description"/>
  15. <result column="creatorid" property="creatorId"/>
  16. <result column="createtime" property="createTime"/>
  17. <result column="updaterid" property="updaterId"/>
  18. <result column="updatetime" property="updateTime"/>
  19. <result column="isvalid" property="isvalid"/>
  20. </resultMap>
  21. <update id="deleteEmailConfigByIds">
  22. update PPW_EMAIL.mailbox_info set isvalid =0,updatetime=sysdate() where id in
  23. <foreach item="id" collection="ids" open="(" separator="," close=")">
  24. #{id}
  25. </foreach>
  26. </update>
  27. <select id="listMailboxInfo" resultMap="BaseResultMap">
  28. select *
  29. from PPW_EMAIL.mailbox_info
  30. where isvalid = 1
  31. and open_status = 1
  32. </select>
  33. <select id="searchEmailConfigList" resultMap="BaseResultMap">
  34. select id, type, email, password, protocol, server, port, cron, open_status,description,isvalid,creatorid,createtime,updaterid,updatetime from PPW_EMAIL.mailbox_info
  35. where isvalid = 1
  36. <if test="email != null and email != ''">
  37. and email like concat('%',#{email},'%')
  38. </if>
  39. limit #{offset},#{pageSize}
  40. </select>
  41. <sql id="selectConfigVo">
  42. select id, type, email, password, protocol, server, port, cron, open_status,description,isvalid,creatorid,createtime,updaterid,updatetime
  43. from PPW_EMAIL.mailbox_info
  44. </sql>
  45. <select id="checkEmailUnique" resultType="com.simuwang.base.pojo.dos.MailboxInfoDO">
  46. <include refid="selectConfigVo"/>
  47. where email = #{email} limit 1
  48. </select>
  49. <select id="countEmailConfig" resultType="java.lang.Long"
  50. parameterType="com.simuwang.base.pojo.dto.query.EmailPageQuery">
  51. select count(1) from PPW_EMAIL.mailbox_info
  52. where isvalid = 1
  53. <if test="email != null and email != ''">
  54. and email like concat('%',#{email},'%')
  55. </if>
  56. </select>
  57. <select id="searchEmailConfigById" resultMap="BaseResultMap"
  58. parameterType="java.lang.Integer">
  59. <include refid="selectConfigVo"/>
  60. where id = #{id}
  61. </select>
  62. </mapper>