IndustrialLandDao.xml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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="platform.modules.government.dao.IndustrialLandDao">
  4. <select id="findByCondition" resultType="platform.modules.government.entity.IndustrialLand">
  5. select
  6. a.*
  7. from industrial_land a
  8. where a.del_flag = 0
  9. <if test="condition.pageType != null and condition.pageType == 'apply'">
  10. <if test="condition.userId != null and condition.userId != ''">
  11. and a.create_by = #{condition.userId}
  12. </if>
  13. </if>
  14. <if test="condition.street_id != null and condition.street_id != ''">
  15. and a.street_id = #{condition.street_id}
  16. </if>
  17. <if test="condition.status != null and condition.status != ''">
  18. and a.status = #{condition.status}
  19. </if>
  20. <if test="condition.investment_subject != null and condition.investment_subject != ''">
  21. and a.investment_subject like CONCAT ('%',#{condition.investment_subject},'%')
  22. </if>
  23. <if test="condition.legal_representative != null and condition.legal_representative != ''">
  24. and a.legal_representative like CONCAT ('%',#{condition.legal_representative},'%')
  25. </if>
  26. <if test="condition.contact != null and condition.contact != ''">
  27. and a.contact like CONCAT ('%',#{condition.contact},'%')
  28. </if>
  29. <!--待审核-->
  30. <if test="condition.pageType != null and condition.pageType == 'audit'">
  31. and a.id in (
  32. SELECT DISTINCT APPLY_ID FROM z_approval WHERE (NEXTCHECKER = #{condition.userId}
  33. or NEXTCHECKER LIKE CONCAT(#{condition.userId}, ',%')
  34. or NEXTCHECKER LIKE CONCAT(CONCAT('%,',#{condition.userId}), ',%'))
  35. and (
  36. id in
  37. (
  38. select temp.maxId from (select APPLY_ID,max(id) maxId
  39. from z_approval
  40. <if test="condition.type != null and condition.type != '' ">
  41. where type = #{condition.type}
  42. </if>
  43. and del_flag = 0
  44. AND IS_WITHDRAW IS NULL
  45. GROUP BY APPLY_ID
  46. ) temp )
  47. )
  48. )
  49. </if>
  50. <!--已审核-->
  51. <if test="condition.pageType != null and condition.pageType == 'done'">
  52. and a.id in (
  53. SELECT DISTINCT APPLY_ID FROM z_approval WHERE
  54. (
  55. (
  56. CHECKER = #{condition.userId}
  57. or
  58. CHECKER LIKE CONCAT(CONCAT(#{condition.userId},','), '%')
  59. or
  60. CHECKER LIKE CONCAT(CONCAT('%,',#{condition.userId}), ',%')
  61. )
  62. <if test=" condition.checker_ids!=null ">OR ( CHECKER in
  63. <foreach
  64. collection="condition.checker_ids" index="index" item="item" open="(" separator="," close=")">
  65. #{item}
  66. </foreach>
  67. )
  68. </if>
  69. )
  70. AND IS_WITHDRAW IS NULL
  71. )
  72. </if>
  73. order by a.create_time DESC
  74. </select>
  75. </mapper>