| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="shop.alien.mapper.second.SecondUserViolationMapper">
- <resultMap id="BaseResultMap" type="shop.alien.entity.second.vo.SecondUserViolationVo">
- <!--@mbggenerated-->
- <id column="id" property="id" jdbcType="INTEGER"/>
- <result column="reported_user_name" property="reportedUserName" jdbcType="VARCHAR"/>
- <result column="reported_user_phone" property="reportedUserPhone" jdbcType="VARCHAR"/>
- <result column="reporting_user_name" property="reportingUserName" jdbcType="VARCHAR"/>
- <result column="reporting_user_phone" property="reportingUserPhone" jdbcType="VARCHAR"/>
- <result column="report_context" property="reportContext" jdbcType="VARCHAR"/>
- <result column="report_context_type" property="reportContextType" jdbcType="VARCHAR"/>
- <result column="dict_detail" property="dictDetail" jdbcType="VARCHAR"/>
- <result column="processing_context" property="processingContext" jdbcType="VARCHAR"/>
- <result column="processing_status" property="processingStatus" jdbcType="VARCHAR"/>
- <result column="business_id" property="businessId" jdbcType="INTEGER"/>
- <result column="created_time" property="reportingDate" jdbcType="TIMESTAMP"/>
- <result column="other_reason_content" property="otherReasonContent" jdbcType="VARCHAR"/>
- <result column="report_evidence_img" property="reportEvidenceImg" jdbcType="VARCHAR"/>
- <result column="processing_time" property="processingTime" jdbcType="TIMESTAMP"/>
- <result column="report_result" property="reportResult" jdbcType="VARCHAR"/>
- <result column="video_first_frame" property="videoFirstFrame" jdbcType="VARCHAR"/>
- </resultMap>
- <!-- 分页查询举报信息 -->
- <select id="getUserViolationByPage" resultType="shop.alien.entity.second.vo.SecondUserViolationVo">
- select
- v.id,
- u.user_name reporting_user_name,
- u.user_phone reporting_user_phone,
- case when v.report_context_type = 4 then '二手商品' else '二手用户' end report_context,
- v.report_context_type,
- d.dict_detail dict_detail,
- case when v.processing_status = 0 then '待处理'
- when v.processing_status = 1 then '已通过'
- else '已驳回' end processing_context,
- v.processing_status,
- v.created_time as reportingDate,
- v.business_id
- from
- life_user_violation v
- left join store_dictionary d on v.dict_type = d.type_name and v.dict_id = d.dict_id
- left join life_user u on u.id = v.reporting_user_id
- where 1 = 1
- <if test="reportingUserName != null and reportingUserName != ''">
- and u.user_name like concat('%',#{reportingUserName},'%')
- </if>
- <if test="reportingDate != null and reportingDate != ''">
- and DATE_FORMAT(v.created_time, '%Y-%m-%d') = #{reportingDate}
- </if>
- <if test="processingStatus != null and processingStatus != ''">
- and v.processing_status = #{processingStatus}
- </if>
- <if test="reportContextType != null and reportContextType != ''">
- and v.report_context_type = #{reportContextType}
- </if>
- <if test="reportContextType == null or reportContextType == ''">
- and (v.report_context_type = 4 or v.report_context_type = 5)
- </if>
- order by v.created_time desc
- </select>
- <!-- 分页查询举报信息 -->
- <select id="getUserViolationInfo" resultType="shop.alien.entity.second.vo.SecondUserViolationDetailVo">
- select
- v.id,
- case when v.report_context_type = 4 then lu1.user_name else u.user_name end reported_user_name,
- case when v.report_context_type = 4 then lu1.user_phone else u.user_phone end reported_user_phone,
- lu.user_name reporting_user_name,
- lu.user_phone reporting_user_phone,
- v.created_time,
- case when v.processing_status = 0 then '待处理' when v.processing_status = 1 then '已通过' else '已驳回' end processing_status,
- d.dict_detail,
- v.business_id,
- v.report_context_type,
- v.processing_status,
- v.other_reason_content,
- v.report_evidence_img,
- v.processing_time,
- v.report_result,
- v.video_first_frame
- from
- life_user_violation v
- left join life_user u on v.reported_user_id = u.id
- left join life_user lu on v.reporting_user_id = lu.id
- left join store_dictionary d on v.dict_type = d.type_name
- and v.dict_id = d.dict_id
- left join second_goods g on g.id = v.business_id
- left join life_user lu1 on g.user_id = lu1.id
- <if test="id != null and id != ''">
- where v.id = #{id}
- </if>
- </select>
- </mapper>
|