NoticeInfoMapper.xml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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.dragon.tj.portal.mapper.NoticeInfoMapper">
  4. <select id="queryPage" resultType="com.dragon.tj.portal.entity.NoticeInfo">
  5. SELECT b.id,member_id,scope_type,scope_id,message_type,read_status,title,content,attachment_path,a.id as target_id,b.message_level, b.create_user, b.create_time,a.read_status,
  6. b.create_org_name
  7. from notice_info_scope a
  8. LEFT JOIN notice_info b on a.notice_info_id = b.id
  9. where b.del_flag = 0
  10. <if test="req.messageType != null">
  11. and b.message_type = #{req.messageType}
  12. </if>
  13. <if test="req.title != null and req.title != ''">
  14. and b.title = #{req.title}
  15. </if>
  16. <if test="idCard != null and idCard != ''">
  17. and a.member_id = #{idCard}
  18. </if>
  19. <if test="req.content != null and req.content != ''">
  20. and b.content = #{req.content}
  21. </if>
  22. <if test="req.deptCode != null and req.deptCode != ''">
  23. and a.scope_id = #{req.deptCode}
  24. </if>
  25. <if test="req.readStatus != null">
  26. and a.read_status = #{req.readStatus}
  27. </if>
  28. <if test="req.publishTimeStart != null and req.publishTimeEnd != null ">
  29. and b.create_time >= #{req.publishTimeStart} and b.create_time &lt;= #{req.publishTimeEnd}
  30. </if>
  31. order by b.create_time desc
  32. </select>
  33. <select id="getCount" resultType="java.lang.Integer">
  34. SELECT COUNT(1) from notice_info_scope a
  35. LEFT JOIN notice_info b on a.notice_info_id = b.id
  36. where b.del_flag = 0
  37. and a.read_status = #{readStatus}
  38. and a.member_id = #{idCard}
  39. </select>
  40. </mapper>