Commit 4552338f by xunj

心愿抽奖

1 parent 8559711e
......@@ -2,27 +2,57 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.polysoft.activity.mapper.WishMapper">
<select id="queryWishList" resultType="com.polysoft.activity.model.vo.WishVO"
parameterType="com.polysoft.activity.model.param.QueryWishParam">
SELECT
t1.wish_id,
t1.user_id,
t1.address,
t1.wish_context,
t1.user_name,
t1.prize_falg,
t1.create_time,
t1.push_date,
t2.pic_url
<!--<insert id="addWish" parameterType="com.polysoft.activity.model.dto.AddWishDto">
insert into t_wish (
wish_id,
user_id,
user_name,
address,
wish_context,
prize_falg,
create_time,
push_date,
delete_falg
)VALUES (
#{wishId},
#{wishId},
#{wishId},
#{wishId},
#{wishId},
#{wishId},
#{wishId},
#{wishId},
)
</insert>-->
FROM
t_wish t1
left join t_wish_pic t2 on(t1.wish_id = t2.wish_id)
<where>
1=1
<if test="pushDate !=null and pushDate != '' ">
and push_date = #{pushDate}
</if>
<if test="wishId != null and wishId != '' ">
and wish_id = #{wishId}
</if>
<if test="userId != null and userId != '' ">
and user_id = #{userId}
</if>
</where>
</select>
<select id="queryLuckDrawWish" resultType="com.polysoft.activity.model.vo.QueryLuckDrawWishVO">
SELECT
t.user_id,
t.wish_id
FROM
t_wish t
WHERE
t.push_date = DATE_FORMAT(NOW(),'%Y-%m-%d')
AND t.user_id NOT IN ( SELECT t2.user_id FROM t_wish_real_prize t2 )
GROUP by t.user_id
order by t.user_id asc
</select>
<select id="querRealPrize" resultType="com.polysoft.activity.model.vo.QueryRealPrizeVO">
SELECT
prize_id,
prize_name,
luck_draw_date,
prize_num,
prize_price
FROM
t_real_prize
WHERE
luck_draw_date = DATE_FORMAT( NOW( ), '%Y-%m-%d' )
</select>
</mapper>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!