| | |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setCommunityId(this.getCommunityId()); |
| | | commonPage.setType(1); |
| | | commonPage.setUserId(this.getUserId()); |
| | | return this.communityService.selectAllComActRaffle(commonPage); |
| | | } |
| | | |
| | |
| | | |
| | | @ApiModelProperty(value = "参与状态 0 不可参与 1 可参与") |
| | | private Integer joinStatus; |
| | | |
| | | @ApiModelProperty("是否参与 0参与 1没参与") |
| | | private Integer isJoin; |
| | | } |
| | |
| | | </resultMap> |
| | | |
| | | <select id="pageList" resultType="com.panzhihua.common.model.vos.community.raffle.ComActRaffleVO"> |
| | | select t.*,t2.waitRaffleCount,t3.joinCount,t4.name as createName,t5.raffleCount,t6.prizeCount from com_act_raffle t |
| | | select t.*,t2.waitRaffleCount,t3.joinCount,t4.name as createName,t5.raffleCount,t6.prizeCount,ISNULL(t7.isJoin) as isJoin from com_act_raffle t |
| | | LEFT JOIN (select count(*) waitRaffleCount,raffle_id from com_act_raffle_record where status = 1 group by raffle_id) t2 on t.id = t2.raffle_id |
| | | LEFT JOIN (select count(*) as joinCount,raffle_id from com_act_raffle_record GROUP BY raffle_id) t3 on t.id = t3.raffle_id |
| | | LEFT JOIN sys_user t4 on t.create_by = t4.user_id |
| | | LEFT JOIN (select count(*) as raffleCount,raffle_id from com_act_raffle_record where status >0 GROUP BY raffle_id) t5 on t.id = t5.raffle_id |
| | | LEFT JOIN (select sum(total) as prizeCount,raffle_id from com_act_raffle_prize GROUP BY raffle_id) t6 on t.id = t6.raffle_id |
| | | LEFT JOIN (select count(*) as isJoin,raffle_id from com_act_raffle_record <if test="commonPage.userId !=null"> where user_id = ${commonPage.userId} </if> group by raffle_id) t7 on t.id = t7.raffle_id |
| | | |
| | | <where> |
| | | <if test="commonPage.communityId!=null"> |
| | | and t.community_id = #{commonPage.communityId} |
| | |
| | | </resultMap> |
| | | |
| | | <select id="selectByUserId" resultType="com.panzhihua.common.model.vos.community.raffle.ComActRaffleRecordVO"> |
| | | select t.*, t1.`name`, t1.image |
| | | select t.*, t1.image, t1.name as prizeName, t2.nick_name, t2.phone, t2.`name` as username, t3.name as staffName |
| | | from com_act_raffle_record t |
| | | LEFT JOIN com_act_raffle_prize t1 on t.prize_id = t1.id |
| | | left join com_act_raffle_prize t1 on t.prize_id = t1.id |
| | | left join sys_user t2 on t.user_id = t2.user_id |
| | | left join sys_user t3 on t.staff_id = t3.user_id |
| | | where 1=1 <if test="userId !=null and userId !=0"> and t.user_id = #{userId} </if> |
| | | and t.raffle_id = #{raffleId} |
| | | </select> |
| | |
| | | 1=1 |
| | | <if test="commonPage.paramId2==null"> |
| | | <if test="commonPage.communityId !=0 and commonPage.communityId !=null"> |
| | | and t.community_id =#{commonPage.communityId} |
| | | and (t.community_id =#{commonPage.communityId} or t.responsibility_id =#{commonPage.communityId}) |
| | | </if> |
| | | <if test="commonPage.streetId !=0 and commonPage.streetId !=null"> |
| | | and t.street_id =#{commonPage.streetId} |