Merge branch 'hemenkou_dev' into dev
# Conflicts:
# springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngVolunteerMngDAO.java
# springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActActivityMapper.xml
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.social.SocialProjectVO; |
| | |
| | | @Api(tags = {"项目管理"}) |
| | | @RestController |
| | | @RequestMapping("comActSocialProject") |
| | | public class ComActSocialProjectApi { |
| | | public class ComActSocialProjectApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | |
| | | @ApiOperation(value = "分页查询接口",response =SocialProjectVO.class ) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setCommunityId(this.getCommunityId()); |
| | | return communityService.selectAllComActSocialProject(commonPage); |
| | | } |
| | | |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.social.ComActSocialProjectPublicityVO; |
| | |
| | | @Api(tags = {"项目宣传管理"}) |
| | | @RestController |
| | | @RequestMapping("comActSocialProjectPublicity") |
| | | public class ComActSocialProjectPublicityApi { |
| | | public class ComActSocialProjectPublicityApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | |
| | | @ApiOperation(value = "分页查询",response = ComActSocialProjectPublicityVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setCommunityId(this.getCommunityId()); |
| | | return communityService.selectAllComActSocialProjectPublicity(commonPage); |
| | | } |
| | | |
| | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.listen.ComActSocialWorkerExcelListen; |
| | | import com.panzhihua.common.model.dtos.civil.*; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.civil.ComActSocialWorkerDetailsVO; |
| | | import com.panzhihua.common.model.vos.civil.ComActSocialWorkerVO; |
| | |
| | | // public R getTemplate(){ |
| | | // return R.ok(comactsocialworkerUrl); |
| | | // } |
| | | @ApiOperation("根据社工获取活动") |
| | | @PostMapping("/activityList") |
| | | R activityList(@RequestBody CommonPage commonPage){ |
| | | return communityService.activityList(commonPage); |
| | | } |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "是否证件 0否 1是") |
| | | private Integer credential; |
| | | |
| | | private Integer age; |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("社工数") |
| | | private Integer socialCount; |
| | | |
| | | |
| | | /** |
| | | * 党员参与者人数下线 |
| | | */ |
| | | @ApiModelProperty("党员参与者人数下线") |
| | | private Integer partyMemberMin; |
| | | |
| | | /** |
| | | * 党员参与者人数上限 |
| | | */ |
| | | @ApiModelProperty("党员参与者人数上限") |
| | | private Integer partyMemberMax; |
| | | /** |
| | | * 签退范围,默认0无限制 |
| | | */ |
| | | @ApiModelProperty("签退范围,默认0无限制") |
| | | private Integer signOutRange; |
| | | |
| | | @ApiModelProperty("单次活动时长") |
| | | private Integer activityTime; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zzj |
| | | */ |
| | | @Data |
| | | @ApiModel("") |
| | | public class PartyActivityStatics { |
| | | } |
| | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.social.SocialProjectVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | @ApiOperation(value = "分页查询接口",response =SocialProjectVO.class ) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | if(this.getLoginUserInfo().getStreetId()!=null){ |
| | | commonPage.setStreetId(this.getLoginUserInfo().getStreetId()); |
| | | } |
| | | else { |
| | | commonPage.setCommunityId(this.getCommunityId()); |
| | | } |
| | | return communityService.selectAllComActSocialProject(commonPage); |
| | | } |
| | | |
| | |
| | | else { |
| | | socialProjectVO.setCommunityId(this.getCommunityId()); |
| | | } |
| | | if(StringUtils.isNotEmpty(socialProjectVO.getResponsibility())){ |
| | | socialProjectVO.setStatus(3); |
| | | } |
| | | return communityService.insertComActSocialProject(socialProjectVO); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "修改数据") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody SocialProjectVO socialProjectVO) { |
| | | if(StringUtils.isNotEmpty(socialProjectVO.getResponsibility())){ |
| | | socialProjectVO.setStatus(3); |
| | | } |
| | | return communityService.updateComActSocialProject(socialProjectVO); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "新增社区活动") |
| | | @PostMapping("activity") |
| | | public R addActivity(@RequestBody @Validated(AddGroup.class) ComActActivityVO comActActivityVO) { |
| | | if (comActActivityVO.getHaveIntegralReward().intValue() == 1) { |
| | | if (isNull(comActActivityVO.getRewardWay())) { |
| | | return R.fail("奖励方式不能为空"); |
| | | } |
| | | if (isNull(comActActivityVO.getRewardIntegral())) { |
| | | return R.fail("奖励积分不能为空"); |
| | | } |
| | | if (comActActivityVO.getRewardWay().intValue() == 1 && isNull(comActActivityVO.getLimit())) { |
| | | return R.fail("参与次数上限不能为空"); |
| | | } |
| | | } |
| | | if(nonNull(comActActivityVO.getVolunteerMax()) && comActActivityVO.getVolunteerMax().intValue() == 0) { |
| | | return R.fail("志愿者参与上限不能为0"); |
| | | } |
| | | Long communityId = this.getCommunityId(); |
| | | comActActivityVO.setCommunityId(communityId); |
| | | comActActivityVO.setUserId(this.getLoginUserInfo().getUserId()); |
| | |
| | | + "<if test='comActActivityVO.isApplets != null and comActActivityVO.isApplets ==1'>" |
| | | + "AND a.`status` != 1 AND a.`status` != 6 " + " </if> " + "<if test='comActActivityVO.beginAt != null '>" |
| | | + "AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt} " |
| | | + " </if> " + "<if test='comActActivityVO.type != null and comActActivityVO.type==1 '>" |
| | | + "AND a.volunteer_max!=0 and is_project = 0 " + " </if> " |
| | | + "<if test='comActActivityVO.type != null and comActActivityVO.type==2 '>" + "AND a.volunteer_max=0 and is_project = 0 " |
| | | + " </if> " |
| | | + "<if test='comActActivityVO.type != null and comActActivityVO.type==4 '>" + "AND is_project = 1 " |
| | | + " </if> " |
| | | + "<if test='comActActivityVO.projectId != null'>" + "AND project_id = #{comActActivityVO.projectId} " |
| | | + " </if> " |
| | | + " </if> " + "<if test='comActActivityVO.type != null'>" |
| | | + "AND a.type=#{comActActivityVO.type} " + " </if> " |
| | | + " group by a.id " + " order by a.status asc,a.publish_at desc " + "</script>") |
| | | IPage<ComActActivityVO> pageActivity(Page page, @Param("comActActivityVO") ComActActivityVO comActActivityVO); |
| | | |
| | |
| | | */ |
| | | BigScreenActivityLine selectActivityCountMonth(@Param("date") String date,@Param("year") String year); |
| | | |
| | | /** |
| | | * id查询 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | SocialProjectVO selectByLevel(Long id); |
| | | } |
| | |
| | | * 1志愿者活动 2居民活动 3党员活动 4项目活动 |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 党员参与者人数下线 |
| | | */ |
| | | private Integer partyMemberMin; |
| | | |
| | | /** |
| | | * 党员参与者人数上限 |
| | | */ |
| | | private Integer partyMemberMax; |
| | | /** |
| | | * 签退范围,默认0无限制 |
| | | */ |
| | | private Integer signOutRange; |
| | | /** |
| | | * 单次活动时长 |
| | | */ |
| | | private Integer activityTime; |
| | | |
| | | } |
| | |
| | | ComActActivityCode comActActivityCode = new ComActActivityCode(); |
| | | comActActivityCode.setActivityId(comActActivityDO.getId().longValue()); |
| | | comActActivityCode.setCreateTime(new Date()); |
| | | comActActivityCode.setType(1); |
| | | comActActivityCode.setType(comActActivityVO.getType()); |
| | | comActActivityCode.setStatus(1); |
| | | comActActivityCodeService.save(comActActivityCode); |
| | | return R.ok(activityId); |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateUnit; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import com.panzhihua.service_community.entity.ComActRaffleRecord; |
| | | import com.panzhihua.service_community.service.ComActRaffleService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.amqp.rabbit.core.RabbitTemplate; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | private ComActRafflePrizeDao comActRafflePrizeDao; |
| | | @Resource |
| | | private ComActRaffleRecordDao comActRaffleRecordDao; |
| | | @Resource |
| | | private RabbitTemplate rabbitTemplate; |
| | | @Override |
| | | public R pageList(CommonPage commonPage) { |
| | | return R.ok(this.baseMapper.pageList(new Page(commonPage.getPage(),commonPage.getSize()),commonPage)); |
| | |
| | | comActRaffle.setStatus(0); |
| | | int count= this.baseMapper.insert(comActRaffle); |
| | | if(count>0){ |
| | | rabbitTemplate.convertAndSend("raffle.exchange", "raffle.key", comActRaffleVO, message -> { |
| | | message.getMessageProperties().setHeader("x-delay", dateToSecond(comActRaffle.getStartTime())); |
| | | return message; |
| | | }); |
| | | if(!CollectionUtils.isEmpty(comActRaffleVO.getComActRafflePrizeVOList())){ |
| | | comActRaffleVO.getComActRafflePrizeVOList().forEach(comActRafflePrizeVO -> { |
| | | ComActRafflePrize comActRafflePrize=new ComActRafflePrize(); |
| | |
| | | } |
| | | return R.ok(comActRaffleVO); |
| | | } |
| | | private Long dateToSecond(Date expireTime){ |
| | | return DateUtil.between(new Date(),expireTime, DateUnit.MS); |
| | | } |
| | | } |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 项目人员(ComActSocialProjectMember)表服务实现类 |
| | |
| | | if(comActSocialProjectMemberVO.getType()==1){ |
| | | ComActSocialWorker comActSocialWorker=comActSocialWorkerDao.selectById(comActSocialProjectMemberVO.getParamId()); |
| | | if(comActSocialWorker!=null){ |
| | | List<ComActSocialProjectMember> list= comActSocialProjectMemberDao.selectList(new QueryWrapper<ComActSocialProjectMember>().lambda().eq(ComActSocialProjectMember::getPhone,comActSocialWorker.getTelephone()).eq(ComActSocialProjectMember::getType,comActSocialProjectMemberVO.getType()).eq(ComActSocialProjectMember::getProjectId,comActSocialProjectMemberVO.getProjectId())); |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | ComActSocialProjectMember comActSocialProjectMember=new ComActSocialProjectMember(); |
| | | BeanUtils.copyProperties(comActSocialProjectMemberVO,comActSocialProjectMember); |
| | | comActSocialProjectMember.setAge(getAge(comActSocialWorker.getIdCard())); |
| | |
| | | comActSocialProjectMember.setCreateTime(new Date()); |
| | | comActSocialProjectMemberDao.insert(comActSocialProjectMember); |
| | | return R.ok(); |
| | | } |
| | | } |
| | | } |
| | | else { |
| | |
| | | if(comActSocialProjectMemberVO.getType()==1){ |
| | | ComActSocialWorker comActSocialWorker=comActSocialWorkerDao.selectById(id); |
| | | if(comActSocialWorker!=null){ |
| | | List<ComActSocialProjectMember> list= comActSocialProjectMemberDao.selectList(new QueryWrapper<ComActSocialProjectMember>().lambda().eq(ComActSocialProjectMember::getPhone,comActSocialWorker.getTelephone()).eq(ComActSocialProjectMember::getType,comActSocialProjectMemberVO.getType()).eq(ComActSocialProjectMember::getProjectId,comActSocialProjectMemberVO.getProjectId())); |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | ComActSocialProjectMember comActSocialProjectMember=new ComActSocialProjectMember(); |
| | | BeanUtils.copyProperties(comActSocialProjectMemberVO,comActSocialProjectMember); |
| | | comActSocialProjectMember.setAge(getAge(comActSocialWorker.getIdCard())); |
| | |
| | | comActSocialProjectMemberDao.insert(comActSocialProjectMember); |
| | | } |
| | | } |
| | | } |
| | | else { |
| | | ComMngVolunteerMngDO comMngVolunteerMngDO=comMngVolunteerMngDAO.selectById(id); |
| | | if(comMngVolunteerMngDO!=null){ |
| | | List<ComActSocialProjectMember> list= comActSocialProjectMemberDao.selectList(new QueryWrapper<ComActSocialProjectMember>().lambda().eq(ComActSocialProjectMember::getPhone,comMngVolunteerMngDO.getPhone()).eq(ComActSocialProjectMember::getType,comActSocialProjectMemberVO.getType()).eq(ComActSocialProjectMember::getProjectId,comActSocialProjectMemberVO.getProjectId())); |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | ComActSocialProjectMember comActSocialProjectMember=new ComActSocialProjectMember(); |
| | | BeanUtils.copyProperties(comActSocialProjectMemberVO,comActSocialProjectMember); |
| | | comActSocialProjectMember.setAge(comMngVolunteerMngDO.getAge()); |
| | |
| | | comActSocialProjectMemberDao.insert(comActSocialProjectMember); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | public Integer getAge(String idCard){ |
| | | Integer year=Integer.parseInt(idCard.substring(5,9)); |
| | | Integer year=Integer.parseInt(idCard.substring(6,10)); |
| | | Integer nowYear= DateUtils.getYear(new Date()); |
| | | return nowYear-year; |
| | | } |
| | |
| | | return R.fail("数据异常"); |
| | | } |
| | | ProjectRelationVO projectRelationVO=new ProjectRelationVO(); |
| | | ComActSocialProject comActSocialProject=this.comActSocialProjectDao.selectById(commonPage.getParamId()); |
| | | if(comActSocialProject.getLevel()==1){ |
| | | ComActSocialProject comActSocialProject1=this.comActSocialProjectDao.selectOne(new QueryWrapper<ComActSocialProject>().lambda().eq(ComActSocialProject::getId,comActSocialProject.getParentId())); |
| | | if(comActSocialProject1!=null){ |
| | | SocialProjectVO socialProjectVO=new SocialProjectVO(); |
| | | BeanUtils.copyProperties(comActSocialProject1,socialProjectVO); |
| | | projectRelationVO.setFatherProjectLevelOne(socialProjectVO); |
| | | } |
| | | |
| | | } |
| | | SocialProjectVO comActSocialProject=this.comActSocialProjectDao.selectByLevel(commonPage.getParamId()); |
| | | if(comActSocialProject.getLevel()==2){ |
| | | ComActSocialProject comActSocialProject1=this.comActSocialProjectDao.selectOne(new QueryWrapper<ComActSocialProject>().lambda().eq(ComActSocialProject::getId,comActSocialProject.getParentId())); |
| | | SocialProjectVO comActSocialProject1=this.comActSocialProjectDao.selectByLevel(comActSocialProject.getParentId()); |
| | | if(comActSocialProject1!=null){ |
| | | SocialProjectVO socialProjectVO=new SocialProjectVO(); |
| | | BeanUtils.copyProperties(comActSocialProject1,socialProjectVO); |
| | | projectRelationVO.setFatherProjectLevelTwo(socialProjectVO); |
| | | ComActSocialProject comActSocialProject2=this.comActSocialProjectDao.selectOne(new QueryWrapper<ComActSocialProject>().lambda().eq(ComActSocialProject::getId,comActSocialProject1.getParentId())); |
| | | projectRelationVO.setFatherProjectLevelOne(comActSocialProject1); |
| | | } |
| | | } |
| | | if(comActSocialProject.getLevel()==3){ |
| | | SocialProjectVO comActSocialProject1=this.comActSocialProjectDao.selectByLevel(comActSocialProject.getParentId()); |
| | | if(comActSocialProject1!=null){ |
| | | projectRelationVO.setFatherProjectLevelTwo(comActSocialProject1); |
| | | SocialProjectVO comActSocialProject2=this.comActSocialProjectDao.selectByLevel(comActSocialProject1.getParentId()); |
| | | if(comActSocialProject2!=null){ |
| | | SocialProjectVO socialProjectVO1=new SocialProjectVO(); |
| | | BeanUtils.copyProperties(comActSocialProject2,socialProjectVO1); |
| | | projectRelationVO.setFatherProjectLevelOne(socialProjectVO1); |
| | | projectRelationVO.setFatherProjectLevelOne(comActSocialProject2); |
| | | } |
| | | } |
| | | } |
| | |
| | | </select> |
| | | <select id="pageActivityCommunityBack" |
| | | resultType="com.panzhihua.common.model.vos.community.ComActActivityVO"> |
| | | SELECT t.* FROM ( |
| | | SELECT a.id, a.activity_name, u.`name` sponsorName, a.activity_addr, a.participant_max, a.contact_name, |
| | | COUNT(if(s.is_volunteer=1,NULL,s.id))participant_now, a.volunteer_max, |
| | | COUNT(if(s.is_volunteer=1,s.id,NULL))volunteer_now, a.`status`, a.publish_at, a.is_qr_code, |
| | | a.begin_at, a.end_at, a.sign_up_begin, a.sign_up_end, a.reward_way, a.activity_type, a.have_integral_reward , a.cover <if test='comActActivityVO.type != null and comActActivityVO.type == 4'>,so.socialCount</if> |
| | | FROM com_act_activity a |
| | | LEFT JOIN sys_user u ON a.sponsor_id=u.user_id |
| | | LEFT JOIN (SELECT * FROM com_act_act_sign WHERE `status` = 1) s ON a.id=s.activity_id |
| | | WHERE a.`status` = 1 AND a.community_id = ${comActActivityVO.communityId} |
| | | <if test='comActActivityVO.type != null and comActActivityVO.type == 4'> |
| | | left join (select count(t.id) as socialCount,activity_id from com_act_act_regist t LEFT JOIN sys_user t1 on t.user_id = t1.user_id LEFT JOIN com_act_social_worker t2 on t1.phone = t2.telephone where t2.id is not null GROUP BY t.activity_id) so on a.id = so.activity_id |
| | | </if> |
| | | WHERE a.`status` = 1 AND a.community_id=#{comActActivityVO.communityId} |
| | | <if test='comActActivityVO.type != null and comActActivityVO.type == 1'> |
| | | AND a.volunteer_max != 0 |
| | | </if> |
| | | <if test='comActActivityVO.type != null and comActActivityVO.type == 2'> |
| | | AND a.volunteer_max = 0 |
| | | </if> |
| | | <if test='comActActivityVO.type != null and comActActivityVO.type == 4'> |
| | | AND a.is_project = 1 |
| | | </if> |
| | | <if test='comActActivityVO.rewardWay != null and comActActivityVO.rewardWay != 0'> |
| | | AND a.reward_way = #{comActActivityVO.rewardWay} |
| | | </if> |
| | | <if test='comActActivityVO.activityType != null and comActActivityVO.activityType !=""'> |
| | | AND a.activity_type = #{comActActivityVO.activityType} |
| | | </if> |
| | | <if test='comActActivityVO.activityName != null and comActActivityVO.activityName !=""'> |
| | | AND a.activity_name LIKE concat( #{comActActivityVO.activityName}, '%' ) |
| | | </if> |
| | | <if test='comActActivityVO.status != null and comActActivityVO.status !=0 and comActActivityVO.status !=1'> |
| | | AND a.`status` = 99 |
| | | </if> |
| | | <if test='comActActivityVO.beginAt != null '> |
| | | AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt} |
| | | </if> |
| | | GROUP BY a.id |
| | | UNION ALL SELECT t1.* FROM ( |
| | | SELECT a.id, a.activity_name, u.`name` sponsorName, a.activity_addr, a.participant_max, a.contact_name, |
| | | COUNT(if(s.is_volunteer=1,NULL,s.id))participant_now, a.volunteer_max, |
| | | COUNT(if(s.is_volunteer=1,s.id,NULL))volunteer_now, a.`status`, a.publish_at, |
| | |
| | | <if test='comActActivityVO.type != null and comActActivityVO.type == 4'> |
| | | left join (select count(t.id) as socialCount,activity_id from com_act_act_regist t LEFT JOIN sys_user t1 on t.user_id = t1.user_id LEFT JOIN com_act_social_worker t2 on t1.phone = t2.telephone where t2.id is not null GROUP BY t.activity_id) so on a.id = so.activity_id |
| | | </if> |
| | | WHERE a.`status` != 1 AND a.community_id = ${comActActivityVO.communityId} |
| | | <if test='comActActivityVO.type != null and comActActivityVO.type == 1'> |
| | | AND a.volunteer_max != 0 |
| | | </if> |
| | | <if test='comActActivityVO.type != null and comActActivityVO.type == 2'> |
| | | AND a.volunteer_max = 0 |
| | | </if> |
| | | <if test='comActActivityVO.type != null and comActActivityVO.type == 4'> |
| | | AND a.is_project = 1 |
| | | WHERE a.`status` != 1 AND a.community_id=#{comActActivityVO.communityId} |
| | | <if test='comActActivityVO.type != null'> |
| | | AND a.type = #{comActActivityVO.type} |
| | | </if> |
| | | <if test='comActActivityVO.rewardWay != null and comActActivityVO.rewardWay != 0'> |
| | | AND a.reward_way = #{comActActivityVO.rewardWay} |
| | |
| | | <if test='comActActivityVO.beginAt != null '> |
| | | AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt} |
| | | </if> |
| | | GROUP BY a.id ORDER BY a.publish_at DESC |
| | | )t1 |
| | | )t |
| | | GROUP BY a.id ORDER BY a.status = 99 desc,a.publish_at DESC |
| | | </select> |
| | | <select id="inforActivity" resultType="com.panzhihua.common.model.vos.community.ComActActivityVO"> |
| | | SELECT u.name sponsorName, ca.name communityName, |
| | |
| | | and t.type =#{commonPage.type} |
| | | </if> |
| | | <if test="commonPage.keyword !=null and commonPage.keyword !=''"> |
| | | and (t.name like concat('%',#{commonPage.keyword},'%') or responsibility like concat('%',#{commonPage.keyword},'%') ) |
| | | and (t.name like concat('%',#{commonPage.keyword},'%') or responsibility like |
| | | concat('%',#{commonPage.keyword},'%') ) |
| | | </if> |
| | | <if test="commonPage.beginTime !=null"> |
| | | and t.create_time >= #{commonPage.beginTime} |
| | |
| | | </select> |
| | | |
| | | <select id="getByApplet" resultType="com.panzhihua.common.model.vos.community.social.SocialProjectVO"> |
| | | select t.*,t1.phone as streetPhone,t2.name as columnName,t3.name as secondColumnName from com_act_social_project t |
| | | select t.*, t1.phone as streetPhone, t2.name as columnName, t3.name as secondColumnName |
| | | from com_act_social_project t |
| | | LEFT JOIN com_street t1 on t.street_id = t1.street_id |
| | | LEFT JOIN com_act_column t2 on t.column_id = t2.id |
| | | LEFT JOIN com_act_column t3 on t.second_column_id = t3.id |
| | |
| | | </select> |
| | | |
| | | <select id="selectBaseInfo" resultType="com.panzhihua.common.model.vos.community.bigscreen.BigScreenHmkProjectInfo"> |
| | | select (select count(*) from com_act_social_project where street_id =15 <if test="communityId!=null"> and community_id = #{communityId}</if>) count, |
| | | (select count(*) from com_act_social_project where street_id =15 and status >=2 <if test="communityId!=null"> and community_id = #{communityId}</if>) assigned, |
| | | (select count(*) from com_act_social_project where street_id =15 and 1 >=status <if test="communityId!=null"> and community_id = #{communityId}</if>) assign |
| | | select (select count(*) from com_act_social_project where street_id =15 <if test="communityId!=null">and |
| | | community_id = #{communityId}</if>) count, |
| | | (select count(*) from com_act_social_project where street_id =15 and status >=2 <if test="communityId!=null">and |
| | | community_id = #{communityId}</if>) assigned, |
| | | (select count(*) from com_act_social_project where street_id =15 and 1 >=status <if test="communityId!=null">and |
| | | community_id = #{communityId}</if>) assign |
| | | </select> |
| | | |
| | | <select id="selectType" resultType="com.panzhihua.common.model.vos.community.bigscreen.BigScreenHmkProjectTypeInfo"> |
| | |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectIndexBaseInfo" resultType="com.panzhihua.common.model.vos.community.bigscreen.BigScreenHmkBaseInfo"> |
| | | <select id="selectIndexBaseInfo" |
| | | resultType="com.panzhihua.common.model.vos.community.bigscreen.BigScreenHmkBaseInfo"> |
| | | select (select count(*) from com_act_social_project where street_id = 15) projectCount, |
| | | (select count(*) from com_act_activity where is_project = 1) activityCount, |
| | | (select count(*) from com_act_social_worker where street_id = 15) socialWorkerCount, |
| | |
| | | (select count(*) from com_act_social_worker_service) serviceCount |
| | | </select> |
| | | |
| | | <select id="selectActivityCountMonth" resultType="com.panzhihua.common.model.vos.community.bigscreen.BigScreenActivityLine"> |
| | | select ( select count(id) from com_act_activity where status!=6 and is_project = 1 and publish_at >= DATE_FORMAT( CONCAT(#{year},'-',#{date},'-00'), '%Y-%m-00 00:00:00') and DATE_FORMAT( LAST_DAY(CONCAT(#{year},'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=publish_at) y, |
| | | (select count(id) from com_act_activity where status!=6 and is_project = 1 and DATE_FORMAT( LAST_DAY(CONCAT(#{year},'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=publish_at) countY |
| | | <select id="selectActivityCountMonth" |
| | | resultType="com.panzhihua.common.model.vos.community.bigscreen.BigScreenActivityLine"> |
| | | select (select count(id) from com_act_activity where status!=6 and is_project = 1 and publish_at >= DATE_FORMAT( CONCAT(#{year}, '-', |
| | | #{date}, '-00'), '%Y-%m-00 00:00:00') and DATE_FORMAT( LAST_DAY(CONCAT( |
| | | #{year}, '-', |
| | | #{date}, '-00')), '%Y-%m-%d 23:59:59') >=publish_at) y, |
| | | ( |
| | | select count (id) |
| | | from com_act_activity |
| | | where status!=6 |
| | | and is_project = 1 |
| | | and DATE_FORMAT( LAST_DAY(CONCAT(#{year} |
| | | , '-' |
| | | , #{date} |
| | | , '-00')) |
| | | , '%Y-%m-%d 23:59:59') >=publish_at) countY |
| | | </select> |
| | | |
| | | <select id="selectByLevel" resultType="com.panzhihua.common.model.vos.community.social.SocialProjectVO"> |
| | | select t.*, t1.name as columnName, t2.name as secondColumnName |
| | | from com_act_social_project t |
| | | left join com_act_column t1 on t.column_id = t1.id |
| | | left join com_act_column t2 on t.second_column_id = t2.id |
| | | where t.id = #{id} |
| | | </select> |
| | | </mapper> |
| | |
| | | </resultMap> |
| | | |
| | | <select id="pageList" resultType="com.panzhihua.common.model.vos.community.social.ComActSocialProjectPublicityVO"> |
| | | select t.*,t1.name,t1.responsibility from com_act_social_project_publicity t left join com_act_social_project t1 on t.project_id = t1.id order by is_top desc,create_time desc |
| | | select t.*,t1.name,t1.responsibility from com_act_social_project_publicity t left join com_act_social_project t1 on t.project_id = t1.id |
| | | <where> |
| | | <if test="commonPage.paramId !=null"> |
| | | and t.project_id =#{commonPage.paramId} |
| | | </if> |
| | | </where> |
| | | order by is_top desc,create_time desc |
| | | </select> |
| | | |
| | | <select id="selectOne" resultType="com.panzhihua.common.model.vos.community.social.ComActSocialProjectPublicityVO"> |
| | |
| | | <if test="pageComActSocialWorkerDTO.socialOrgId!=null"> |
| | | AND a.social_org_id = #{pageComActSocialWorkerDTO.socialOrgId} |
| | | </if> |
| | | <if test="pageComActSocialWorkerDTO.name!=null"> |
| | | AND a.name = #{pageComActSocialWorkerDTO.name} |
| | | <if test="pageComActSocialWorkerDTO.name!=null and pageComActSocialWorkerDTO.name!=''"> |
| | | AND a.name like concat('%',#{pageComActSocialWorkerDTO.name},'%') |
| | | </if> |
| | | <if test="pageComActSocialWorkerDTO.keyword!=null and pageComActSocialWorkerDTO.keyword!=''"> |
| | | AND (a.name like concat('%',#{pageComActSocialWorkerDTO.keyword},'%') or a.telephone like concat('%',#{pageComActSocialWorkerDTO.keyword},'%') ) |
| | |
| | | AND a.update_by = #{pageComActSocialWorkerDTO.updateBy} |
| | | </if> |
| | | </where> |
| | | order by create_at desc |
| | | </select> |
| | | |
| | | <select id="queryAll" resultType="com.panzhihua.common.model.dtos.civil.ComActSocialWorkerExcelVO"> |