BuildInfoDao.xml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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.build.dao.BuildInfoDao">
  4. <select id="getBuildInfo" resultType="platform.modules.build.entity.BuildInfo">
  5. select * from y_info where name=#{name} and del_flag=0 limit 0,1
  6. </select>
  7. <select id="getBuildCountByStreet" resultType="Integer">
  8. SELECT count(id) FROM y_info u WHERE u.street_id = #{streetId}
  9. and u.del_flag=0
  10. </select>
  11. <select id="getBuildCountByStreetName" resultType="Integer">
  12. SELECT count(u.id) FROM y_info u
  13. left join s_street s on s.id=u.street_id
  14. WHERE s.name = #{name}
  15. and u.del_flag=0
  16. </select>
  17. <select id="getBuildCountByType" resultType="Integer">
  18. SELECT count(id) FROM y_info u WHERE u.type = #{type}
  19. and u.del_flag=0
  20. </select>
  21. <select id="countAllBuild" resultType="Integer">
  22. SELECT count(id) FROM y_info u WHERE is_start=true
  23. and u.del_flag=0
  24. </select>
  25. <select id="getParkListByCondition" resultType="platform.modules.build.entity.BuildInfo">
  26. select * from y_info
  27. where del_flag = 0
  28. <if test="condition.name != null and condition.name != ''">
  29. and name = #{condition.name}
  30. </if>
  31. <if test="condition.area != null and condition.area != ''">
  32. and area >= #{condition.area}
  33. </if>
  34. <if test="condition.restArea != null and condition.restArea != ''">
  35. and rest_area >= #{condition.restArea}
  36. </if>
  37. <if test="condition.restRentArea != null and condition.restRentArea != ''">
  38. and rest_rent_area >= #{condition.restRentArea}
  39. </if>
  40. <if test="condition.transformer != null and condition.transformer != ''">
  41. and transformer = #{condition.transformer}
  42. </if>
  43. </select>
  44. <select id="findParkList" resultType="platform.modules.build.entity.BuildInfo">
  45. select
  46. p.*,
  47. s.name as streetName
  48. from y_info p
  49. left join s_street s on s.id = p.street_id
  50. where
  51. p.del_flag = 0 and s.del_flag = 0
  52. <if test="condition.streetId != null and conition.streetId != ''">
  53. s.id = #{condition.streetId}
  54. </if>
  55. <if test="condition.parkName != null and conition.parkName != ''">
  56. p.name like concat('%', concat(#{condition.parkName}, '%'))
  57. </if>
  58. </select>
  59. </mapper>