|
@@ -59,17 +59,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="applyEndTime" column="apply_end_time"/>
|
|
|
<result property="businessId" column="business_id"/>
|
|
|
<result property="beforeCount" column="before_count"/>
|
|
|
+ <result property="beforeName" column="before_name"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="listSubscribe" parameterType="com.zhongzheng.modules.user.bo.UserSubscribeQueryBo" resultMap="UserSubscribeVo">
|
|
|
SELECT
|
|
|
- us.*,
|
|
|
+ us.*, eb.before_name,
|
|
|
(SELECT g.goods_name FROM goods g where us.goods_id = g.goods_id) as goods_name,
|
|
|
(SELECT g.code FROM goods g where us.goods_id = g.goods_id) as goods_code,
|
|
|
(SELECT g.stand_price FROM goods g where us.goods_id = g.goods_id) as stand_price,
|
|
|
(SELECT m.category_name FROM goods g LEFT JOIN major m on g.major_id= m.id where us.goods_id = g.goods_id) as category_name,
|
|
|
- (SELECT u.realname FROM `user` u where us.user_id = u.user_id) as realname,
|
|
|
- (SELECT u.id_card FROM `user` u where us.user_id = u.user_id) as id_card,
|
|
|
+ u.realname,
|
|
|
+ u.id_card,
|
|
|
(SELECT ea.apply_name FROM exam_apply ea where ea.apply_id = us.apply_id) as apply_name,
|
|
|
(SELECT ea.apply_start_time FROM exam_apply ea where ea.apply_id = us.apply_id) as apply_start_time,
|
|
|
(SELECT ea.apply_end_time FROM exam_apply ea where ea.apply_id = us.apply_id) as apply_end_time,
|
|
@@ -77,8 +78,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
(SELECT ueg.do_number-ueg.expend_before FROM user_exam_goods ueg where ueg.goods_id = us.goods_id and ueg.user_id = us.user_id) as before_count
|
|
|
FROM
|
|
|
user_subscribe us
|
|
|
+ LEFT JOIN exam_before eb ON us.before_id = eb.before_id
|
|
|
+ LEFT JOIN `user` u ON us.user_id = u.user_id
|
|
|
+
|
|
|
WHERE
|
|
|
1 =1
|
|
|
+ <if test="idCards != null and idCards.size()!=0 ">
|
|
|
+ AND u.id_card in
|
|
|
+ <foreach collection="idCards" item="item" index="index" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
<if test="userId != null and userId != '' ">
|
|
|
and us.user_id = #{userId}
|
|
|
</if>
|
|
@@ -193,4 +203,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
where 1=1
|
|
|
and g.goods_id = #{goodsId}
|
|
|
</select>
|
|
|
-</mapper>
|
|
|
+
|
|
|
+ <select id="listSubscribeByUser" parameterType="com.zhongzheng.modules.user.bo.UserSubscribeQueryBo" resultMap="UserSubscribeVo">
|
|
|
+ SELECT
|
|
|
+ us.user_id,
|
|
|
+ u.realname,
|
|
|
+ u.id_card
|
|
|
+ FROM
|
|
|
+ ( SELECT user_id FROM user_subscribe GROUP BY user_id ) us
|
|
|
+ LEFT JOIN `user` u ON us.user_id = u.user_id
|
|
|
+ </select>
|
|
|
+</mapper>
|