| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <?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.sqx.modules.activity.dao.ActivityShopDao">
- <select id="pageShopByActivityId" resultType="com.sqx.modules.activity.vo.ActivityShopVO">
- select
- ach.id as activityShopId,
- ach.shop_id,
- ach.activity_id,
- gs.shop_name,
- gs.phone as shopPhone,
- st.shop_type_name,
- gs.shop_cover as shopImg,
- gs.shop_banner as shopSwiperImg
- from activity_shop ach
- left join goods_shop gs on gs.shop_id = ach.shop_id
- left join shop_type st on st.id = gs.shop_type_id
- where ach.activity_id = ${activityId}
- </select>
- <resultMap id="shopActivityGroupVO" type="com.sqx.modules.activity.vo.ShopActivityGroupVO">
- <result column="shop_id" property="shopId"/>
- <collection property="activityTypeGroups" ofType="com.sqx.modules.activity.vo.ShopActivityGroupVO$ActivityTypeGroup">
- <result column="type" property="activityType"/>
- <collection property="activityInGroups" ofType="com.sqx.modules.activity.vo.ShopActivityGroupVO$ActivityInGroup">
- <result column="title" property="activityTitle"/>
- <result column="end_time" property="activityEndTime"/>
- <result column="suit_type" property="suitType"/>
- <result column="limit_type" property="limitType"/>
- <result column="limit_value" property="limitValue"/>
- </collection>
- </collection>
- </resultMap>
- <select id="getShopActivityGroup" resultMap="shopActivityGroupVO">
- select
- ach.shop_id,
- a.type,
- a.title,
- a.end_time,
- ach.suit_type,
- ach.limit_type,
- ach.limit_value
- from activity_shop ach
- left join activity a on a.id = ach.activity_id
- where ach.shop_id = #{shopId}
- </select>
- <select id="getActivityByShopIds" resultType="com.sqx.modules.activity.vo.ShopActivityVO">
- select
- ach.id activityShopId,
- ach.shop_id,
- ach.activity_id,
- a.type activityType,
- a.title activityName,
- a.image activityImage,
- a.start_time,
- a.end_time
- from activity_shop ach
- left join activity a on a.id = ach.activity_id
- where
- ach.shop_id in
- <foreach collection="shopIds" index="index" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </select>
- <select id="getShopActivityBOByShopId" resultType="com.sqx.modules.activity.bo.ShopActivityBO">
- select
- a.id activityId,
- ach.id activityShopId,
- ach.shop_id,
- ach.suit_type,
- ach.limit_type,
- ach.limit_value,
- a.title,
- a.content,
- a.type,
- a.start_time,
- a.end_time,
- a.config
- from activity_shop ach
- left join activity a on ach.activity_id = a.id
- where ach.shop_id = #{shopId}
- and a.enable_flag = '1'
- and a.del_flag = '0'
- </select>
- </mapper>
|