BNoticeInfoMapper.xml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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="bus.mapper.BNoticeInfoMapper">
  4. <select id="list" parameterType="bus.model.dto.page.BNoticeInfoPageDto" resultType="bus.model.dto.BNoticeInfoDto">
  5. select
  6. id,
  7. title,
  8. content,
  9. type,
  10. pub_time,
  11. status
  12. from
  13. b_notice_info
  14. <where>
  15. is_delete = 0
  16. <if test="title != null and title != ''">
  17. and title like concat('%',#{title},'%')
  18. </if>
  19. <if test="type != null and type != ''">
  20. and type = #{type}
  21. </if>
  22. <if test="status != null and status != ''">
  23. and status = #{status}
  24. </if>
  25. <if test="pubBeginTime != null ">
  26. and pub_time &gt;= #{pubBeginTime}
  27. </if>
  28. <if test="pubEndTime != null">
  29. and pub_time &lt;= #{pubEndTime}
  30. </if>
  31. </where>
  32. order by pub_time desc
  33. </select>
  34. <select id="getNoticeInfoList" resultType="bus.model.dto.BNoticeInfoDto">
  35. SELECT
  36. a.id,
  37. a.title,
  38. a.content,
  39. a.type,
  40. a.pub_time,
  41. a.status
  42. FROM
  43. b_notice_info a
  44. WHERE
  45. a.status = '1'
  46. AND a.is_delete = 0
  47. ORDER BY
  48. a.pub_time DESC
  49. </select>
  50. </mapper>