<?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="com.sinata.rest.modular.mall.dao.MallUserReportMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.sinata.rest.modular.mall.model.MallUserReport">
|
<id column="id" property="id"/>
|
<result column="user_id" property="userId"/>
|
<result column="goods_type" property="goodsType"/>
|
<result column="goods_id" property="goodsId"/>
|
<result column="order_id" property="orderId"/>
|
<result column="detail" property="detail"/>
|
<result column="rep_image" property="repImage"/>
|
<result column="state" property="state"/>
|
<result column="is_delete" property="isDelete"/>
|
<result column="create_time" property="createTime"/>
|
</resultMap>
|
<update id="updateForId">
|
UPDATE mall_user_report
|
SET state = 1
|
WHERE id = {id}
|
</update>
|
<select id="selectReoortList" resultType="java.util.Map">
|
SELECT
|
mur.id,
|
mur.create_time AS createTime,
|
mur.goods_type AS goodsType,
|
mur.detail,
|
mur.rep_image,
|
mur.state,
|
mg.goods_name AS goodName,
|
mu.nick_name AS nickName,
|
mu.id AS userId
|
mu.phone,
|
mm.merchant_name AS merchantName,
|
mm.id AS merchantId
|
FROM
|
mall_user_report mur
|
LEFT JOIN mem_user mu ON mu.id = mur.user_id
|
LEFT JOIN mall_goods mg ON mg.id = mur.goods_id
|
LEFT JOIN mem_merchant mm ON mm.id = mg.merchant_id
|
WHERE 1=1
|
<if test="beginTime !=null and beginTime !=''">
|
<![CDATA[ AND mur.createTime >= CONCAT(#{beginTime},' 00:00:00') ]]>
|
</if>
|
<if test="endTime !=null and endTime !=''">
|
<![CDATA[ AND mur.createTime <= CONCAT(#{endTime},' 23:59:59') ]]>
|
</if>
|
<if test="nickName !=null and nickName !=''">
|
AND mu.nickName like '%${nickName}%'
|
</if>
|
<if test="merchantName !=null and merchantName !=''">
|
AND mm.merchantName like '%${merchantName}%'
|
</if>
|
<if test="goodName !=null and goodName !=''">
|
AND mg.goodName like '%${goodName}%'
|
</if>
|
<if test="goodName !=null and goodName !=''">
|
AND mg.goodName like '%${goodName}%'
|
</if>
|
<if test="id !=null and id !=''">
|
AND mur.id = #{id}'
|
</if>
|
<if test="state !=null and state !=''">
|
AND mur.state = #{state}
|
</if>
|
<if test="merchantId !=null and merchantId !=''">
|
AND mm.id = #{merchantId}
|
</if>
|
<if test="userId !=null and userId !=''">
|
AND mu.id = #{userId}
|
</if>
|
</select>
|
|
</mapper>
|