NoticeMapper.xml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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.unis.transaction.server.dao.NoticeDao">
  4. <sql id="NoticeColumns">
  5. tzbm,apcc,htbh,lsxz,pz,ccmc,sgmc,tzzt,tzztmc,title,tzsj,ccdw,sgdw,wtzt,khzt,ccdws,sgdws,ckztmc
  6. </sql>
  7. <sql id="NoticeJoins">
  8. </sql>
  9. <select id="selectPageList" resultType="com.unis.transaction.common.vo.givebackbail.NoticeVO"
  10. parameterType="com.unis.transaction.common.vo.givebackbail.NoticeVO">
  11. select
  12. <include refid="NoticeColumns" />
  13. from
  14. ty_jytz tz <include refid="NoticeJoins" />
  15. <where>
  16. <if test="title != null and title != ''">
  17. and tz.title like '%' || #{title} || '%'
  18. </if>
  19. <if test="htbh != null and htbh != ''">
  20. and tz.htbh like '%' || #{htbh} || '%'
  21. </if>
  22. <if test="tzzt != null">
  23. and tz.tzzt = #{tzzt}
  24. </if>
  25. <if test="ztList!=null">
  26. and tz.tzzt in
  27. <foreach collection="ztList" index="index" item="item" open="(" separator="," close=")">
  28. #{item}
  29. </foreach>
  30. </if>
  31. </where>
  32. order by tz.tzsj desc
  33. </select>
  34. <select id="selectPageLists" resultType="com.unis.transaction.common.vo.givebackbail.NoticeVO">
  35. select * from (
  36. select
  37. <include refid="NoticeColumns"/>
  38. from
  39. ty_jytz
  40. <where>
  41. <if test=" title!= null and title != ''">
  42. and title like '%' || #{title} || '%'
  43. </if>
  44. <if test="htbh != null and htbh != ''">
  45. and htbh like '%' || #{htbh} || '%'
  46. </if>
  47. <if test="tzzt != null and tzzt != ''">
  48. and tzzt =#{tzzt}
  49. </if>
  50. <if test="ccdw != null and ccdw != ''">
  51. and ccdws =#{ccdw}
  52. </if>
  53. <if test="ztList!=null">
  54. and tzzt in
  55. <foreach collection="ztList" index="index" item="item" open="(" separator="," close=")">
  56. #{item}
  57. </foreach>
  58. </if>
  59. </where>
  60. union
  61. select
  62. <include refid="NoticeColumns"/>
  63. from
  64. ty_jytz
  65. <where>
  66. <if test=" title!= null and title != ''">
  67. and title like '%' || #{title} || '%'
  68. </if>
  69. <if test="htbh != null and htbh != ''">
  70. and htbh like '%' || #{htbh} || '%'
  71. </if>
  72. <if test="tzzt != null and tzzt != ''">
  73. and tzzt =#{tzzt}
  74. </if>
  75. <if test="ccdw != null and ccdw != ''">
  76. and sgdws=#{ccdw}
  77. </if>
  78. <if test="ztList!=null">
  79. and tzzt in
  80. <foreach collection="ztList" index="index" item="item" open="(" separator="," close=")">
  81. #{item}
  82. </foreach>
  83. </if>
  84. </where>
  85. ) notice
  86. order by tzsj desc
  87. </select>
  88. </mapper>