HostedEmailInfoMapper.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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.daq.HostedEmailInfoMapper">
  4. <resultMap id="BaseResultMap" type="com.simuwang.base.pojo.dos.HostedEmailInfoDO" >
  5. <id column="id" property="id" jdbcType="INTEGER" />
  6. <result column="company_id" property="companyId" jdbcType="VARCHAR" />
  7. <result column="company_name" property="companyName" jdbcType="VARCHAR" />
  8. <result column="email" property="email" jdbcType="VARCHAR" />
  9. <result column="creatorid" property="creatorId" jdbcType="INTEGER" />
  10. <result column="createtime" property="createTime" jdbcType="TIMESTAMP" />
  11. <result column="updaterid" property="updaterId" jdbcType="INTEGER" />
  12. <result column="updatetime" property="updateTime" jdbcType="TIMESTAMP" />
  13. <result column="isvalid" property="isvalid" jdbcType="INTEGER" />
  14. <result column="open_status" property="openStatus" jdbcType="INTEGER" />
  15. </resultMap>
  16. <insert id="saveHostedEmailInfoDO">
  17. insert into hosted_email_info(company_id,email,creatorid,createtime,updaterid,updatetime,isvalid,open_status)
  18. values
  19. (#{companyId},#{email},#{creatorId},#{createTime},#{updaterId},#{updateTime},#{isvalid},#{openStatus})
  20. </insert>
  21. <update id="deleteHostEmail">
  22. update hosted_email_info set isvalid=0,updaterid=#{userId} where id in
  23. <foreach item="id" collection="idList" open="(" separator="," close=")">
  24. #{id}
  25. </foreach>
  26. </update>
  27. <select id="selectHostedEmailInfoDO" resultMap="BaseResultMap">
  28. select hei.id,
  29. hei.company_id,
  30. ci.company_name,
  31. hei.open_status,
  32. hei.email,
  33. hei.creatorid,
  34. hei.createtime,
  35. hei.updaterid,
  36. hei.updatetime,
  37. hei.isvalid
  38. from hosted_email_info hei
  39. join pvn_company_info ci
  40. on ci.company_id = hei.company_id
  41. where hei.isvalid=1 and ci.isvalid=1 and hei.email=#{email}
  42. </select>
  43. <select id="searchHostEmailPage" resultMap="BaseResultMap">
  44. select hei.id,
  45. hei.company_id,
  46. ci.company_name,
  47. hei.email,
  48. hei.open_status,
  49. hei.creatorid,
  50. hei.createtime,
  51. hei.updaterid,
  52. hei.updatetime,
  53. hei.isvalid
  54. from hosted_email_info hei
  55. join pvn_company_info ci
  56. on ci.company_id = hei.company_id
  57. where hei.isvalid=1 and ci.isvalid=1
  58. <if test="companyName != null and companyName != ''">
  59. and (ci.company_name like concat('%',#{companyName},'%') or ci.company_short_name like concat('%',#{companyName},'%'))
  60. </if>
  61. <if test="email != null and email != ''">
  62. and hei.email like concat('%',#{email},'%')
  63. </if>
  64. <if test="openStatus != null">
  65. and hei.open_status =#{openStatus}
  66. </if>
  67. limit #{offset},#{pageSize}
  68. </select>
  69. <select id="countHostEmailPage" resultType="java.lang.Long">
  70. select count(hei.id)
  71. from hosted_email_info hei
  72. join pvn_company_info ci
  73. on ci.company_id = hei.company_id
  74. where hei.isvalid=1 and ci.isvalid=1
  75. <if test="companyName != null and companyName != ''">
  76. and (ci.company_name like concat('%',#{companyName},'%') or ci.company_short_name like concat('%',#{companyName},'%'))
  77. </if>
  78. <if test="email != null and email != ''">
  79. and hei.email like concat('%',#{email},'%')
  80. </if>
  81. <if test="openStatus != null">
  82. and hei.open_status =#{openStatus}
  83. </if>
  84. </select>
  85. <select id="getAllHostedEmail" resultType="java.lang.String">
  86. select email from hosted_email_info where isvalid=1 and open_status=1 group by email
  87. </select>
  88. </mapper>