TaPointsExchangeMapper.xml 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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.huiju.estateagents.mapper.TaPointsExchangeMapper">
  4. <select id="selectListByParams" resultType="com.huiju.estateagents.entity.TaPointsExchange">
  5. SELECT
  6. t.rec_id,
  7. t.person_id,
  8. t.person_name,
  9. t.phone,
  10. t.avatar,
  11. t.target_id,
  12. t.target_name,
  13. t.image,
  14. t.points,
  15. t.address,
  16. t.`status`,
  17. t.expired_date,
  18. t.create_date,
  19. t.org_id,
  20. t.building_id,
  21. t.verify_date,
  22. p.person_type
  23. FROM
  24. ta_points_exchange t
  25. LEFT JOIN ta_person p ON t.person_id = p.person_id
  26. where 1=1
  27. <if test="taPointsExchange.status != null and taPointsExchange.status != '' or taPointsExchange.status ==0">
  28. and t.`status` = #{taPointsExchange.status}
  29. </if>
  30. <if test="taPointsExchange.orgId != null and taPointsExchange.orgId != ''">
  31. and t.org_id = #{taPointsExchange.orgId}
  32. </if>
  33. <if test="taPointsExchange.personName != null and taPointsExchange.personName != ''">
  34. and t.person_name like concat('%',#{taPointsExchange.personName},'%')
  35. </if>
  36. <if test="taPointsExchange.phone != null and taPointsExchange.phone != ''">
  37. and t.phone like concat('%',#{taPointsExchange.phone},'%')
  38. </if>
  39. <if test="taPointsExchange.tel != null and taPointsExchange.tel != ''">
  40. and t.phone = #{taPointsExchange.tel}
  41. </if>
  42. <if test="taPointsExchange.personType != null and taPointsExchange.personType != ''">
  43. and p.person_type = #{taPointsExchange.personType}
  44. </if>
  45. <if test="taPointsExchange.targetName != null and taPointsExchange.targetName != ''">
  46. and t.target_name like concat('%',#{taPointsExchange.targetName},'%')
  47. </if>
  48. <if test="taPointsExchange.startCreateDate != null and taPointsExchange.startCreateDate != ''">
  49. and date_format(t.create_date,'%Y-%m-%d') >= date_format(#{taPointsExchange.startCreateDate},'%Y-%m-%d')
  50. </if>
  51. <if test="taPointsExchange.endCreateDate != null and taPointsExchange.endCreateDate != ''">
  52. and date_format(t.create_date,'%Y-%m-%d') &lt;= date_format(#{taPointsExchange.endCreateDate},'%Y-%m-%d')
  53. </if>
  54. <if test="taPointsExchange.startVerifyDate != null and taPointsExchange.startVerifyDate != ''">
  55. and date_format(t.verify_date,'%Y-%m-%d') >= date_format(#{taPointsExchange.startVerifyDate},'%Y-%m-%d')
  56. </if>
  57. <if test="taPointsExchange.endVerifyDate != null and taPointsExchange.endVerifyDate != ''">
  58. and date_format(t.verify_date,'%Y-%m-%d') &lt;= date_format(#{taPointsExchange.endVerifyDate},'%Y-%m-%d')
  59. </if>
  60. <if test="personBuildingList != null and personBuildingList.size > 0">
  61. AND t.building_id in
  62. <foreach collection="personBuildingList" item="personBuilding" open="(" close=")" separator=",">
  63. #{personBuilding.buildingId}
  64. </foreach>
  65. </if>
  66. order by t.create_date desc
  67. </select>
  68. </mapper>