| | |
| | | SELECT * FROM (
|
| | | SELECT SUBSTRING_INDEX(GROUP_CONCAT(s.s_id ORDER BY s.s_createtime DESC), ',', 1)AS hid
|
| | | FROM yeshi_ec_scanhistory_v2 s
|
| | | <if test="source != null">
|
| | | LEFT JOIN `yeshi_ec_common_goods` g ON s.`s_common_goods_id` = g.`cg_id`
|
| | | </if>
|
| | | WHERE
|
| | | <trim prefix="(" suffix=")" suffixOverrides="or">
|
| | | <if test="uid != null"> s.`s_uid`=#{uid,jdbcType=BIGINT} or</if>
|
| | | <if test="device != null">s.`s_device`=#{device,jdbcType=VARCHAR} or</if>
|
| | | </trim>
|
| | | <if test="source != null">AND g.`cg_goods_type` = #{source}</if>
|
| | | <if test="notBackSuVip == true"><![CDATA[AND g.`cg_goods_type` <> 4 AND g.`cg_goods_type` <> 5]]></if>
|
| | | GROUP BY s.s_common_goods_id
|
| | | )A
|
| | | LEFT JOIN yeshi_ec_scanhistory_v2 B ON B.s_id = A.hid
|
| | |
| | | <!-- 根据UID或者设备号获取浏览记录条数 -->
|
| | | <select id="selectCountByDeviceOrUid" resultType="java.lang.Long">
|
| | | SELECT IFNULL(COUNT(DISTINCT s.`s_common_goods_id`),0) FROM yeshi_ec_scanhistory_v2 s
|
| | | <if test="source != null">
|
| | | LEFT JOIN `yeshi_ec_common_goods` g ON s.`s_common_goods_id` = g.`cg_id`
|
| | | </if>
|
| | | WHERE
|
| | | <trim prefix="(" suffix=")" suffixOverrides="or">
|
| | | <if test="uid != null"> s.`s_uid`=#{uid,jdbcType=BIGINT} or</if>
|
| | | <if test="device != null">s.`s_device`=#{device,jdbcType=VARCHAR} or</if>
|
| | | </trim>
|
| | | <if test="source != null">AND g.`cg_goods_type` = #{source}</if>
|
| | | <if test="notBackSuVip == true"><![CDATA[AND g.`cg_goods_type` <> 4 AND g.`cg_goods_type` <> 5]]></if>
|
| | | </select>
|
| | |
|
| | |
|