LifeAppealManageMapper.xml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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="shop.alien.mapper.LifeAppealManageMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="shop.alien.entity.store.EssentialHolidayComparison">
  6. <id column="id" property="id" />
  7. <result column="festival_name" property="festivalName" />
  8. <result column="festival_date" property="festivalDate" />
  9. <result column="particular_year" property="particularYear" />
  10. </resultMap>
  11. <!-- 通用查询结果列 -->
  12. <sql id="Base_Column_List">
  13. id, festival_name, festival_date, particular_year
  14. </sql>
  15. <select id="getAppealManagement" resultType="shop.alien.entity.store.vo.LifeAppealManageVo">
  16. SELECT
  17. appeal.id,
  18. appeal.store_id,
  19. store.store_name,
  20. su.`name` AS store_contact,
  21. lu.user_phone AS user_phone,
  22. store.store_tel AS store_phone,
  23. `comment`.comment_content AS customer_report,
  24. appeal.appeal_reason,
  25. appeal.appeal_status AS appeal_type,
  26. si.img_url as appeal_image,
  27. sg.img_url AS commentImage,
  28. CASE
  29. appeal.appeal_status
  30. WHEN 0 THEN
  31. "待处理"
  32. WHEN 1 THEN
  33. "成功"
  34. WHEN 2 THEN
  35. "失败"
  36. END AS appeal_type_name,
  37. `comment`.business_type,
  38. CASE
  39. `comment`.business_type
  40. WHEN 1 THEN
  41. "订单评论"
  42. WHEN 2 THEN
  43. "动态社区评论"
  44. WHEN 3 THEN
  45. "活动评论"
  46. END AS business_type_name,
  47. appeal.created_time AS appeal_time
  48. FROM
  49. store_comment_appeal appeal
  50. LEFT JOIN store_info store ON appeal.store_id = store.id
  51. LEFT JOIN store_user su ON su.store_id = store.id and su.delete_flag = 0
  52. LEFT JOIN store_comment `comment` ON `comment`.id = appeal.comment_id
  53. LEFT JOIN life_user lu ON `comment`.user_id = lu.id
  54. LEFT JOIN store_img si ON appeal.img_id = si.id
  55. LEFT JOIN store_img sg ON sg.id = `comment`.img_id
  56. WHERE
  57. 1 = 1
  58. <if test="storeName != null and storeName != ''">
  59. AND store.store_name LIKE CONCAT('%', #{storeName}, '%')
  60. </if>
  61. <if test="storeContact != null and storeContact != ''">
  62. AND `comment`.comment_content LIKE CONCAT('%', #{storeContact}, '%')
  63. </if>
  64. <if test="storePhone != null and storePhone != ''">
  65. AND lu.user_phone LIKE CONCAT('%', #{storePhone}, '%')
  66. </if>
  67. <if test="appealType != null and appealType != ''">
  68. AND appeal.appeal_status = #{appealType}
  69. </if>
  70. ORDER BY
  71. appeal.created_time DESC
  72. </select>
  73. <!-- 与 getAppealManagement 同字段,按评论申诉主键查单条,供平台端详情 -->
  74. <select id="getAppealDetailById" resultType="shop.alien.entity.store.vo.LifeAppealManageVo">
  75. SELECT
  76. appeal.id,
  77. appeal.store_id,
  78. store.store_name,
  79. su.`name` AS store_contact,
  80. lu.user_phone AS user_phone,
  81. store.store_tel AS store_phone,
  82. `comment`.comment_content AS customer_report,
  83. appeal.appeal_reason,
  84. appeal.appeal_status AS appeal_type,
  85. si.img_url as appeal_image,
  86. sg.img_url AS commentImage,
  87. CASE
  88. appeal.appeal_status
  89. WHEN 0 THEN
  90. "待处理"
  91. WHEN 1 THEN
  92. "成功"
  93. WHEN 2 THEN
  94. "失败"
  95. END AS appeal_type_name,
  96. `comment`.business_type,
  97. CASE
  98. `comment`.business_type
  99. WHEN 1 THEN
  100. "订单评论"
  101. WHEN 2 THEN
  102. "动态社区评论"
  103. WHEN 3 THEN
  104. "活动评论"
  105. END AS business_type_name,
  106. appeal.created_time AS appeal_time
  107. FROM
  108. store_comment_appeal appeal
  109. LEFT JOIN store_info store ON appeal.store_id = store.id
  110. LEFT JOIN store_user su ON su.store_id = store.id and su.delete_flag = 0
  111. LEFT JOIN store_comment `comment` ON `comment`.id = appeal.comment_id
  112. LEFT JOIN life_user lu ON `comment`.user_id = lu.id
  113. LEFT JOIN store_img si ON appeal.img_id = si.id
  114. LEFT JOIN store_img sg ON sg.id = `comment`.img_id
  115. WHERE
  116. appeal.id = #{id}
  117. LIMIT 1
  118. </select>
  119. </mapper>