EmailParseInfoMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  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.smppw.modaq.domain.mapper.EmailParseInfoMapper">
  4. <resultMap id="BaseResultMap" type="com.smppw.modaq.domain.entity.EmailParseInfoDO">
  5. <id column="id" property="id"/>
  6. <result column="email" property="email"/>
  7. <result column="email_key" property="emailKey"/>
  8. <result column="sender_email" property="senderEmail"/>
  9. <result column="email_date" property="emailDate" />
  10. <result column="parse_date" property="parseDate" />
  11. <result column="email_title" property="emailTitle"/>
  12. <result column="email_type" property="emailType"/>
  13. <result column="parse_status" property="parseStatus"/>
  14. <result column="fail_reason" property="failReason"/>
  15. <result column="attr_size" property="attrSize"/>
  16. <result column="isvalid" property="isvalid"/>
  17. <result column="creatorid" property="creatorId"/>
  18. <result column="createtime" property="createTime"/>
  19. <result column="updaterid" property="updaterId"/>
  20. <result column="updatetime" property="updateTime"/>
  21. <result column="sender_email" property="senderEmail"/>
  22. </resultMap>
  23. <insert id="insertAndId" parameterType="com.smppw.modaq.domain.entity.EmailParseInfoDO" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
  24. insert into mo_email_parse_info(email,email_key, sender_email, email_date, parse_date, email_title, email_type, parse_status, fail_reason,
  25. attr_size,isvalid, creatorid, createtime, updaterid, updatetime)
  26. values (#{itemDo.email}, #{itemDo.emailKey}, #{itemDo.senderEmail}, #{itemDo.emailDate}, #{itemDo.parseDate}, #{itemDo.emailTitle}, #{itemDo.emailType}, #{itemDo.parseStatus},
  27. #{itemDo.failReason}, #{itemDo.attrSize}, #{itemDo.isvalid}, #{itemDo.creatorId}, #{itemDo.createTime}, #{itemDo.updaterId}, #{itemDo.updateTime})
  28. </insert>
  29. <update id="updateParseStatus">
  30. update mo_email_parse_info
  31. set parse_status = #{parseStatus},
  32. fail_reason = #{failReason}
  33. where isvalid = 1
  34. and id = #{id}
  35. </update>
  36. <sql id="selectEmailParse">
  37. SELECT
  38. epi.id,
  39. epi.email,
  40. epi.email_key,
  41. epi.email_date,
  42. epi.parse_date,
  43. epi.email_title,
  44. epi.email_type,
  45. epi.parse_status,
  46. epi.fail_reason,
  47. epi.attr_size,
  48. epi.isvalid,
  49. epi.creatorid,
  50. epi.createtime,
  51. epi.updatetime,
  52. epi.updaterid,
  53. epi.sender_email
  54. FROM
  55. mo_email_parse_info epi
  56. </sql>
  57. <!-- 查询条件 -->
  58. <!-- <sql id="sqlwhereSearch">-->
  59. <!-- <where>-->
  60. <!-- epi.isvalid=1-->
  61. <!-- <if test="emailTitle !=null and emailTitle !=''">-->
  62. <!-- and epi.email_title like concat('%',#{emailTitle},'%')-->
  63. <!-- </if>-->
  64. <!-- <if test="emailType !=null">-->
  65. <!-- and epi.email_type = #{emailType}-->
  66. <!-- </if>-->
  67. <!-- <if test="parseStatus !=null">-->
  68. <!-- and epi.parse_status = #{parseStatus}-->
  69. <!-- </if>-->
  70. <!-- <if test="startDate !=null and startDate != ''">-->
  71. <!-- and epi.parse_date <![CDATA[ >= ]]> #{startDate}-->
  72. <!-- </if>-->
  73. <!-- <if test="endDate !=null and endDate != ''">-->
  74. <!-- and epi.parse_date <![CDATA[ <= ]]> #{endDate}-->
  75. <!-- </if>-->
  76. <!-- <if test="emailStartDate !=null and emailStartDate != ''">-->
  77. <!-- and epi.email_date <![CDATA[ >= ]]> #{emailStartDate}-->
  78. <!-- </if>-->
  79. <!-- <if test="emailEndDate !=null and emailEndDate != ''">-->
  80. <!-- and epi.email_date <![CDATA[ <= ]]> #{emailEndDate}-->
  81. <!-- </if>-->
  82. <!-- <if test="id !=null">-->
  83. <!-- and epi.id = #{id}-->
  84. <!-- </if>-->
  85. <!-- <if test="email !=null and email !=''">-->
  86. <!-- and epi.email like concat('%',#{email},'%')-->
  87. <!-- </if>-->
  88. <!-- <if test="senderEmail !=null and senderEmail !=''">-->
  89. <!-- and epi.sender_email like concat('%',#{senderEmail},'%')-->
  90. <!-- </if>-->
  91. <!-- </where>-->
  92. <!-- </sql>-->
  93. <!-- <select id="searchEmailList" resultMap="BaseResultMap">-->
  94. <!-- <include refid="selectEmailParse"/>-->
  95. <!-- <include refid="sqlwhereSearch"/>-->
  96. <!-- <choose>-->
  97. <!-- <when test="sort != null and sort !='' and sort=='parseDate' and order != null and order !=''">-->
  98. <!-- order by epi.parse_date ${order}-->
  99. <!-- </when>-->
  100. <!-- <when test="sort != null and sort !='' and sort=='emailDate' and order != null and order !=''">-->
  101. <!-- order by epi.email_date ${order}-->
  102. <!-- </when>-->
  103. <!-- <otherwise>-->
  104. <!-- order by epi.parse_date desc-->
  105. <!-- </otherwise>-->
  106. <!-- </choose>-->
  107. <!-- limit #{offset},#{pageSize}-->
  108. <!-- </select>-->
  109. <!-- <select id="searchEmailById" resultMap="BaseResultMap">-->
  110. <!-- <include refid="selectEmailParse"/>-->
  111. <!-- where epi.isvalid =1 and epi.id =#{id}-->
  112. <!-- </select>-->
  113. <!-- <select id="searchEmailCount" resultType="java.lang.Integer">-->
  114. <!-- select count(1) from mo_email_parse_info where isvalid=1-->
  115. <!-- <if test="parseStatus != null and parseStatus != -1">-->
  116. <!-- and parse_status=#{parseStatus}-->
  117. <!-- </if>-->
  118. <!-- <if test="parseStatus != null and parseStatus == -1">-->
  119. <!-- and parse_status != 1-->
  120. <!-- </if>-->
  121. <!-- <if test="startDate != null and startDate != ''">-->
  122. <!-- and parse_date >= #{startDate}-->
  123. <!-- </if>-->
  124. <!-- <if test="endDate != null and endDate != ''">-->
  125. <!-- and parse_date <![CDATA[ <= ]]> #{endDate}-->
  126. <!-- </if>-->
  127. <!-- </select>-->
  128. <!-- <select id="queryById" resultMap="BaseResultMap">-->
  129. <!-- select id, email,email_key, email_date, parse_date, email_title, email_type, sender_email,parse_status,attr_size-->
  130. <!-- from mo_email_parse_info-->
  131. <!-- where isvalid = 1-->
  132. <!-- and id = #{id}-->
  133. <!-- </select>-->
  134. <!-- <select id="countEmailList" resultType="java.lang.Long"-->
  135. <!-- parameterType="com.simuwang.base.pojo.dto.query.EmailParseQuery">-->
  136. <!-- select count(*) from PPW_EMAIL.email_parse_info epi-->
  137. <!-- <include refid="sqlwhereSearch"/>-->
  138. <!-- </select>-->
  139. <update id="updateParseTime">
  140. update mo_email_parse_info
  141. set updatetime = #{parseDate},
  142. parse_date = #{parseDate}
  143. where isvalid = 1
  144. and id = #{id}
  145. </update>
  146. <!-- <select id="queryValuationEmailByFileId" resultType="com.simuwang.base.pojo.dto.EmailInfoDTO">-->
  147. <!-- select t1.id as id,-->
  148. <!-- t1.email as email,-->
  149. <!-- t1.email_date as emailDate,-->
  150. <!-- t1.email_title as emailTitle,-->
  151. <!-- t1.email_type as emailType,-->
  152. <!-- t2.id as fileId,-->
  153. <!-- t2.file_name as fileName,-->
  154. <!-- t2.file_path as filePath-->
  155. <!-- from PPW_EMAIL.email_parse_info t1-->
  156. <!-- join PPW_EMAIL.email_file_info t2 on t1.id = t2.email_id and t2.isvalid = 1-->
  157. <!-- where t1.isvalid = 1-->
  158. <!-- and t1.email_type = 2-->
  159. <!-- and t2.id in-->
  160. <!-- <foreach collection="fileIdList" item="fileId" index="index" open="(" separator="," close=")">-->
  161. <!-- #{fileId}-->
  162. <!-- </foreach>-->
  163. <!-- </select>-->
  164. <!-- <select id="searchEmailDataBoard" resultType="java.util.Map"-->
  165. <!-- parameterType="com.simuwang.base.pojo.dto.query.DataboardQuery">-->
  166. <!-- select parse_status as "parse_status",count(id) as "total" from PPW_EMAIL.email_parse_info-->
  167. <!-- where isvalid=1-->
  168. <!-- <if test="startDate != null and startDate != ''">-->
  169. <!-- and email_date >= #{startDate}-->
  170. <!-- </if>-->
  171. <!-- <if test="endDate != null and endDate != ''">-->
  172. <!-- and email_date <![CDATA[ <= ]]> #{endDate}-->
  173. <!-- </if>-->
  174. <!-- <if test="email !=null and email !=''">-->
  175. <!-- and email like concat('%',#{email},'%')-->
  176. <!-- </if>-->
  177. <!-- <if test="senderEmail !=null and senderEmail !=''">-->
  178. <!-- and sender_email like concat('%',#{senderEmail},'%')-->
  179. <!-- </if>-->
  180. <!-- <if test="emailType !=null">-->
  181. <!-- and email_type = #{emailType}-->
  182. <!-- </if>-->
  183. <!-- group by parse_status-->
  184. <!-- order by parse_status-->
  185. <!-- </select>-->
  186. <!-- <select id="searchEmailTypeCount" resultType="java.util.Map"-->
  187. <!-- parameterType="com.simuwang.base.pojo.dto.query.DataboardQuery">-->
  188. <!-- select email_type as "email_type",count(id) as "total" from PPW_EMAIL.email_parse_info-->
  189. <!-- where isvalid=1-->
  190. <!-- <if test="startDate != null and startDate != ''">-->
  191. <!-- and email_date >= #{startDate}-->
  192. <!-- </if>-->
  193. <!-- <if test="endDate != null and endDate != ''">-->
  194. <!-- and email_date <![CDATA[ <= ]]> #{endDate}-->
  195. <!-- </if>-->
  196. <!-- <if test="email !=null and email !=''">-->
  197. <!-- and email like concat('%',#{email},'%')-->
  198. <!-- </if>-->
  199. <!-- <if test="senderEmail !=null and senderEmail !=''">-->
  200. <!-- and sender_email like concat('%',#{senderEmail},'%')-->
  201. <!-- </if>-->
  202. <!-- group by email_type-->
  203. <!-- order by email_type-->
  204. <!-- </select>-->
  205. <!-- <select id="countpdfNoData" resultType="java.lang.Long">-->
  206. <!-- select count(1) from PPW_EMAIL.email_parse_info-->
  207. <!-- where isvalid=1-->
  208. <!-- <if test="item.startDate != null and item.startDate != ''">-->
  209. <!-- and email_date >= #{item.startDate}-->
  210. <!-- </if>-->
  211. <!-- <if test="item.endDate != null and item.endDate != ''">-->
  212. <!-- and email_date <![CDATA[ <= ]]> #{item.endDate}-->
  213. <!-- </if>-->
  214. <!-- <if test="item.email !=null and item.email !=''">-->
  215. <!-- and email like concat('%',#{item.email},'%')-->
  216. <!-- </if>-->
  217. <!-- <if test="item.senderEmail !=null and item.senderEmail !=''">-->
  218. <!-- and sender_email like concat('%',#{item.senderEmail},'%')-->
  219. <!-- </if>-->
  220. <!-- <if test="item.emailType !=null">-->
  221. <!-- and email_type = #{item.emailType}-->
  222. <!-- </if>-->
  223. <!-- <if test="errorInfo !=null">-->
  224. <!-- and fail_reason like concat('%',#{errorInfo},'%')-->
  225. <!-- </if>-->
  226. <!-- </select>-->
  227. <!-- <select id="countEmailTotal" resultType="java.lang.Long">-->
  228. <!-- select count(1) from mo_email_parse_info where isvalid=1-->
  229. <!-- <if test="emailType !=null">-->
  230. <!-- and email_type = #{emailType}-->
  231. <!-- </if>-->
  232. <!-- </select>-->
  233. <!-- <select id="searchEmail" parameterType="com.smppw.modaq.domain.entity.EmailParseInfoDO" resultMap="BaseResultMap">-->
  234. <!-- select *-->
  235. <!-- from mo_email_parse_info where isvalid = 1-->
  236. <!-- <if test="senderEmail !=null and senderEmail != ''">-->
  237. <!-- and sender_email = #{senderEmail}-->
  238. <!-- </if>-->
  239. <!-- <if test="email != null and email != ''">-->
  240. <!-- and email = #{email}-->
  241. <!-- </if>-->
  242. <!-- <if test="emailDate != null">-->
  243. <!-- and email_date = #{emailDate}-->
  244. <!-- </if>-->
  245. <!-- <if test="emailTitle != null and emailTitle != ''">-->
  246. <!-- and email_title = #{emailTitle}-->
  247. <!-- </if>-->
  248. <!-- limit 1-->
  249. <!-- </select>-->
  250. <!-- <select id="countEmailByInfoAndStatus" resultType="java.lang.Integer">-->
  251. <!-- select count(1)-->
  252. <!-- from mo_email_parse_info t-->
  253. <!-- where t.sender_email = #{entity.senderAddress}-->
  254. <!-- and t.email = #{entity.email}-->
  255. <!-- and t.email_date = #{entity.emailDate}-->
  256. <!-- and t.email_title = #{entity.emailTitle}-->
  257. <!-- and t.parse_status = 1-->
  258. <!-- </select>-->
  259. </mapper>