SecondUserViolationMapper.xml 5.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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.second.SecondUserViolationMapper">
  4. <resultMap id="BaseResultMap" type="shop.alien.entity.second.vo.SecondUserViolationVo">
  5. <!--@mbggenerated-->
  6. <id column="id" property="id" jdbcType="INTEGER"/>
  7. <result column="reported_user_name" property="reportedUserName" jdbcType="VARCHAR"/>
  8. <result column="reported_user_phone" property="reportedUserPhone" jdbcType="VARCHAR"/>
  9. <result column="reporting_user_name" property="reportingUserName" jdbcType="VARCHAR"/>
  10. <result column="reporting_user_phone" property="reportingUserPhone" jdbcType="VARCHAR"/>
  11. <result column="report_context" property="reportContext" jdbcType="VARCHAR"/>
  12. <result column="report_context_type" property="reportContextType" jdbcType="VARCHAR"/>
  13. <result column="dict_detail" property="dictDetail" jdbcType="VARCHAR"/>
  14. <result column="processing_context" property="processingContext" jdbcType="VARCHAR"/>
  15. <result column="processing_status" property="processingStatus" jdbcType="VARCHAR"/>
  16. <result column="business_id" property="businessId" jdbcType="INTEGER"/>
  17. <result column="created_time" property="reportingDate" jdbcType="TIMESTAMP"/>
  18. <result column="other_reason_content" property="otherReasonContent" jdbcType="VARCHAR"/>
  19. <result column="report_evidence_img" property="reportEvidenceImg" jdbcType="VARCHAR"/>
  20. <result column="processing_time" property="processingTime" jdbcType="TIMESTAMP"/>
  21. <result column="report_result" property="reportResult" jdbcType="VARCHAR"/>
  22. <result column="video_first_frame" property="videoFirstFrame" jdbcType="VARCHAR"/>
  23. </resultMap>
  24. <!-- 分页查询举报信息 -->
  25. <select id="getUserViolationByPage" resultType="shop.alien.entity.second.vo.SecondUserViolationVo">
  26. select
  27. v.id,
  28. u.user_name reporting_user_name,
  29. u.user_phone reporting_user_phone,
  30. case when v.report_context_type = 4 then '二手商品' else '二手用户' end report_context,
  31. v.report_context_type,
  32. d.dict_detail dict_detail,
  33. case when v.processing_status = 0 then '待处理'
  34. when v.processing_status = 1 then '已通过'
  35. else '已驳回' end processing_context,
  36. v.processing_status,
  37. v.created_time as reportingDate,
  38. v.business_id
  39. from
  40. life_user_violation v
  41. left join store_dictionary d on v.dict_type = d.type_name and v.dict_id = d.dict_id
  42. left join life_user u on u.id = v.reporting_user_id
  43. where 1 = 1
  44. <if test="reportingUserName != null and reportingUserName != ''">
  45. and u.user_name like concat('%',#{reportingUserName},'%')
  46. </if>
  47. <if test="reportingDate != null and reportingDate != ''">
  48. and DATE_FORMAT(v.created_time, '%Y-%m-%d') = #{reportingDate}
  49. </if>
  50. <if test="processingStatus != null and processingStatus != ''">
  51. and v.processing_status = #{processingStatus}
  52. </if>
  53. <if test="reportContextType != null and reportContextType != ''">
  54. and v.report_context_type = #{reportContextType}
  55. </if>
  56. <if test="reportContextType == null or reportContextType == ''">
  57. and (v.report_context_type = 4 or v.report_context_type = 5)
  58. </if>
  59. order by v.created_time desc
  60. </select>
  61. <!-- 分页查询举报信息 -->
  62. <select id="getUserViolationInfo" resultType="shop.alien.entity.second.vo.SecondUserViolationDetailVo">
  63. select
  64. v.id,
  65. case when v.report_context_type = 4 then lu1.user_name else u.user_name end reported_user_name,
  66. case when v.report_context_type = 4 then lu1.user_phone else u.user_phone end reported_user_phone,
  67. lu.user_name reporting_user_name,
  68. lu.user_phone reporting_user_phone,
  69. v.created_time,
  70. case when v.processing_status = 0 then '待处理' when v.processing_status = 1 then '已通过' else '已驳回' end processing_status,
  71. d.dict_detail,
  72. v.business_id,
  73. v.report_context_type,
  74. v.processing_status,
  75. v.other_reason_content,
  76. v.report_evidence_img,
  77. v.processing_time,
  78. v.report_result,
  79. v.video_first_frame
  80. from
  81. life_user_violation v
  82. left join life_user u on v.reported_user_id = u.id
  83. left join life_user lu on v.reporting_user_id = lu.id
  84. left join store_dictionary d on v.dict_type = d.type_name
  85. and v.dict_id = d.dict_id
  86. left join second_goods g on g.id = v.business_id
  87. left join life_user lu1 on g.user_id = lu1.id
  88. <if test="id != null and id != ''">
  89. where v.id = #{id}
  90. </if>
  91. </select>
  92. </mapper>