HelpInitiateRecordMapper.xml 3.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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.HelpInitiateRecordMapper">
  4. <update id="updateEndGroupActivity">
  5. update ta_help_initiate_record t set t.status = 2
  6. where t.help_activity_id in
  7. <foreach collection="list" item="item" open="(" close=")" separator=",">
  8. #{item}
  9. </foreach>
  10. </update>
  11. <select id="selectPageList" resultType="com.huiju.estateagents.entity.HelpInitiateRecord">
  12. SELECT
  13. hi.*
  14. FROM
  15. ta_help_initiate_record as hi
  16. LEFT JOIN ta_help_activity ha ON hi.help_activity_id = ha.help_activity_id
  17. <where>
  18. hi.help_activity_id = #{helpActivityId}
  19. <if test="status == 'helpSucceed'">
  20. AND hi.verification !='null'
  21. AND hi.verification !=''
  22. </if>
  23. <if test="status == 'helpUnderway'">
  24. and (hi.verification is null OR hi.verification = '')
  25. AND hi.`status` = 1
  26. </if>
  27. <if test="status == 'helpUnfinished'">
  28. and (hi.verification is null
  29. OR hi.verification = '')
  30. AND hi.`status` = 2
  31. </if>
  32. <if test="tel != null and tel != ''">
  33. AND hi.phone = #{tel}
  34. </if>
  35. </where>
  36. </select>
  37. <select id="getHelpInitiateRecordSucceedExportList" resultType="com.huiju.estateagents.excel.HelpInitiateRecordSucceed">
  38. SELECT
  39. b.name as name,
  40. b.create_date as createDate,
  41. b.phone as phone,
  42. b.succeed_date as succeedDate,
  43. if(b.verification_status = 0, '未核销', if(b.verification_status = 1, '已核销', '未知')) as verificationStatus
  44. from ta_help_initiate_record b
  45. where b.help_activity_id = #{helpActivityId}
  46. and b.`status` = 0
  47. <if test="tel != null and tel != ''">
  48. AND b.phone = #{tel}
  49. </if>
  50. order by b.create_date desc
  51. limit #{pageCode}, #{pageSize}
  52. </select>
  53. <select id="getHelpProceedAndFinishExportList" resultType="com.huiju.estateagents.excel.HelpProceedAndFinish">
  54. SELECT
  55. b.name as name,
  56. b.create_date as createDate,
  57. b.phone as phone
  58. from ta_help_initiate_record b
  59. where b.help_activity_id = #{helpActivityId}
  60. <if test="condition == 'helpSucceed'">
  61. and b.status = 1
  62. </if>
  63. <if test="condition == 'helpUnfinished'">
  64. and b.status = 2
  65. </if>
  66. <if test="tel != null and tel != ''">
  67. AND b.phone = #{tel}
  68. </if>
  69. order by b.create_date desc
  70. limit #{pageCode}, #{pageSize}
  71. </select>
  72. <select id="getInitiateRecordList" resultType="com.huiju.estateagents.entity.HelpInitiateRecord">
  73. SELECT
  74. t.*,
  75. a.title,
  76. a.img,
  77. a.activity_status,
  78. a.end_date
  79. FROM
  80. ta_help_initiate_record t
  81. LEFT JOIN ta_help_activity a ON t.help_activity_id = a.help_activity_id
  82. WHERE
  83. t.org_id = #{orgId}
  84. AND t.persion_id = #{personId}
  85. </select>
  86. </mapper>