<?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="cn.lili.modules.lmk.mapper.MyCollectMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="cn.lili.modules.lmk.domain.vo.MyCollectVO">
|
<id column="id" property="id"/>
|
<result column="user_id" property="userId" />
|
<result column="collect_type" property="collectType" />
|
<result column="ref_id" property="refId" />
|
</resultMap>
|
|
|
|
|
|
|
|
<select id="getById" resultMap="BaseResultMap">
|
SELECT
|
LMC.user_id,
|
LMC.collect_type,
|
LMC.ref_id,
|
LMC.id
|
FROM
|
lmk_my_collect LMC
|
WHERE
|
LMC.id = #{id} AND LMC.delete_flag = 0
|
</select>
|
|
|
<select id="getPage" resultMap="BaseResultMap">
|
SELECT
|
LMC.user_id,
|
LMC.collect_type,
|
LMC.ref_id,
|
LMC.id
|
FROM
|
lmk_my_collect LMC
|
WHERE
|
LMC.delete_flag = 0
|
</select>
|
|
<select id="getCollectsByVideoIds" resultType="cn.lili.modules.lmk.domain.vo.SimpleMyCollectVO">
|
SELECT
|
id,
|
ref_id as refId
|
FROM
|
lmk_my_collect
|
WHERE
|
user_id = #{userId}
|
AND delete_flag = 0
|
AND collect_type = 'video'
|
AND ref_id IN <foreach collection="videoIds" open="(" item="videoId" close=")" separator=",">#{videoId}</foreach>
|
</select>
|
|
<select id="countNumGroupByType" parameterType="string" resultType="cn.lili.modules.lmk.domain.vo.CollectTypeNumVO">
|
SELECT
|
ref_id as id,
|
count(id) as countNum
|
FROM
|
lmk_my_collect
|
WHERE
|
collect_type = #{type} AND delete_flag = 0
|
GROUP BY
|
ref_id
|
</select>
|
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="activityBaseResult" type="cn.lili.modules.lmk.domain.vo.ActivityVO">
|
<result column="activity_name" property="activityName" />
|
<result column="activity_type" property="activityType"/>
|
<result column="report_start_time" property="reportStartTime" />
|
<result column="report_end_time" property="reportEndTime" />
|
<result column="start_time" property="startTime" />
|
|
<result column="end_time" property="endTime" />
|
<result column="status" property="status" />
|
<result column="recommend" property="recommend" />
|
<result column="cover" property="cover" />
|
<result column="cover_type" property="coverType" />
|
<result column="limit_user_num" property="limitUserNum" />
|
<result column="activity_location" property="activityLocation" />
|
<result column="activity_content" property="activityContent" />
|
</resultMap>
|
<select id="getActivityCollectPage" resultMap="activityBaseResult">
|
SELECT
|
LA.*
|
FROM lmk_my_collect LMC
|
LEFT JOIN lmk_activity LA
|
ON LMC.ref_id = LA.id
|
WHERE LMC.collect_type = 'activity' and LMC.user_id = #{userId}
|
</select>
|
<resultMap id="videoBaseResult" type="cn.lili.modules.lmk.domain.vo.VideoVO">
|
<id column="id" property="id"/>
|
<result column="author_id" property="authorId" />
|
<result column="authorName" property="authorName" />
|
<result column="cover_url" property="coverUrl" />
|
<result column="video_file_key" property="videoFileKey" />
|
<result column="video_fit" property="videoFit" />
|
<result column="title" property="title" />
|
<result column="goods_id" property="goodsId" />
|
<result column="goods_view_num" property="goodsViewNum" />
|
<result column="video_duration" property="videoDuration" />
|
<result column="goods_order_num" property="goodsOrderNum" />
|
<result column="recommend" property="recommend" />
|
<result column="status" property="status" />
|
<result column="play_num" property="playNum" />
|
<result column="collect_num" property="collectNum" />
|
<result column="comment_num" property="commentNum" />
|
<result column="weight" property="weight" />
|
<result column="audit_pass_time" property="auditPassTime" />
|
<result column="update_time" property="updateTime" />
|
</resultMap>
|
|
<select id="getVideoCollectPage" resultMap="videoBaseResult">
|
SELECT
|
LV.*,
|
LM.nick_name as authorName
|
FROM lmk_my_collect LMC
|
LEFT JOIN lmk_video LV
|
ON LMC.ref_id = LV.id
|
LEFT JOIN li_member LM ON LV.author_id = LM.id
|
WHERE LMC.collect_type = 'video' and LMC.user_id = #{userId}
|
and LV.delete_flag = 0 and LM.delete_flag= 0 and LMC.delete_flag =0
|
</select>
|
|
<resultMap id="storeBaseResult" type="cn.lili.modules.store.entity.vos.StoreBasicInfoVO">
|
<id column="id" property="storeId"/>
|
<result column="store_name" property="storeName"/>
|
<result column="company_address_path" property="companyAddressPath"/>
|
<result column="store_logo" property="storeLogo"/>
|
<result column="store_desc" property="storeDesc"/>
|
</resultMap>
|
|
<select id="getStoreCollectPage" resultMap="storeBaseResult">
|
SELECT
|
LS.*
|
FROM lmk_my_collect LMC
|
LEFT JOIN li_store LS
|
ON LMC.ref_id = LS.id
|
WHERE LMC.collect_type = 'store' and LMC.user_id = #{userId}
|
and LS.delete_flag= 0 and LMC.delete_flag =0
|
</select>
|
|
<resultMap id="goodsBaseResult" type="cn.lili.modules.goods.entity.vos.GoodsVO">
|
<id column="id" property="id"/>
|
<result column="goods_name" property="goodsName"/>
|
<result column="price" property="price"/>
|
<result column="mobile_intro" property="mobileIntro"/>
|
<result column="original" property="original"/>
|
</resultMap>
|
|
<select id="getGoodsCollectPage" resultMap="goodsBaseResult">
|
SELECT
|
LG.*
|
FROM lmk_my_collect LMC
|
LEFT JOIN li_goods LG
|
ON LMC.ref_id = LG.id
|
WHERE LMC.collect_type = 'goods' and LMC.user_id = #{userId}
|
and LG.delete_flag= 0 and LMC.delete_flag =0
|
</select>
|
</mapper>
|