package com.panzhihua.service_community.dao; import java.util.List; import java.util.Map; import com.panzhihua.common.model.dtos.PageBaseDTO; import com.panzhihua.common.model.vos.community.ComActDiscussVO; import com.panzhihua.common.model.vos.community.ComSwPatrolRecordVO; import com.panzhihua.common.model.vos.community.StatisticsCommVO; import com.panzhihua.common.model.vos.community.bigscreen.BigScreenPartyBuildIngStatisticsInfo; import com.panzhihua.common.model.vos.partybuilding.PartyBuildingActivityVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.panzhihua.common.model.vos.community.ComActDynVO; import com.panzhihua.common.model.vos.screen.DateScreenVO; import com.panzhihua.common.model.vos.screen.DynamicWorkVO; import com.panzhihua.service_community.model.dos.ComActDynDO; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 社区动态 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:06 **/ @Mapper public interface ComActDynDAO extends BaseMapper { // @Select("") IPage pageDynamic(Page page, @Param("comActDynVO") ComActDynVO comActDynVO); @Update("update com_act_dyn set `status`=1 WHERE `status`=0 and TIMESTAMPDIFF(MINUTE, SYSDATE(), publish_at)<=0 ") int timedTaskDynStatus(); // @Select("") IPage pageDynamicByAdmin(Page page, @Param("comActDynVO") ComActDynVO comActDynVO); String getContent(@Param("id") String id); int getReadNum(@Param("dynId") String dynId); @Select("SELECT " + " count( cad.id ) AS dynTotal, " + " (select count(id) from com_act_dyn where community_id = ${communityId} and create_at LIKE CONCAT(#{nowDate},'%')) as currentNum " + "FROM " + " com_act_dyn AS cad " + "WHERE " + " community_id = ${communityId}") Map countByCommunityId(@Param("communityId") Long communityId, @Param("nowDate") String nowDate); @Select("select create_at as startTime,(select create_at from com_act_dyn where community_id = ${communityId} order by create_at desc LIMIT 1 ) as endTime from com_act_dyn where community_id = ${communityId} order by create_at asc LIMIT 1") DateScreenVO countByAvgCommunityId(@Param("communityId") Long communityId); @Select("SELECT " + "(SELECT COUNT(id) FROM com_act_dyn WHERE community_id = ${communityId} AND create_at < #{end}) AS dynTotal, " + "(SELECT COUNT(id) FROM com_act_dyn WHERE community_id = ${communityId} AND #{start} < create_at AND create_at < #{end}) AS dynAdd " + " FROM DUAL") DynamicWorkVO countByTime(@Param("start") String start, @Param("end") String end, @Param("communityId") Long communityId); List getIndexDynBaseData(@Param("communityId") Long communityId); List getDynAddPolylineData(@Param("communityId") Long communityId); StatisticsCommVO getDynTotalPolylineDate(@Param("communityId") Long communityId, @Param("date") String date); IPage indexDynList(@Param("page") Page page, @Param("pageBaseDTO") PageBaseDTO pageBaseDTO); /** * 获取党建引领基础数据 * @param communityId * @return */ BigScreenPartyBuildIngStatisticsInfo getPartyBuildIngBaseData(@Param("communityId") Long communityId); /** * 分页获取党员活动 * @param pageBaseDTO * @return */ IPage pagePartyBuildIngAct(@Param("page") Page page, @Param("pageBaseDTO") PageBaseDTO pageBaseDTO); /** * 分页获取议事投票数据 * @param page * @param pageBaseDTO * @return */ IPage pagePartyBuildIngDiscuss(@Param("page") Page page, @Param("pageBaseDTO") PageBaseDTO pageBaseDTO); /** * 获取居民宣传记录 * @param communityId * @param pageSize * @return */ List getPartyBuildIngDynRecord(@Param("communityId") Long communityId, @Param("pageSize") Integer pageSize); /** * 获取巡查记录 * @param communityId * @param pageSize * @return */ List getPartyBuildIngPatrolRecord(@Param("communityId") Long communityId, @Param("pageSize") Integer pageSize); String getTypeId(@Param("communityId") String communityId, @Param("name") String name); }