LifeAppealManageMapper.xml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. </mapper>