| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.panzhihua.common.model.vos.community.StatisticsCommVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | |
| | | // + "COUNT( DISTINCT c.id ) commentNum, " + "u.name userName, " + "u.nick_name userNickName, " + "d.create_at " |
| | | // + "FROM " + "com_act_discuss d " + "JOIN sys_user u ON d.user_id = u.user_id " |
| | | // + "LEFT JOIN com_act_discuss_comment c ON d.id = c.discuss_id " |
| | | // + " where d.community_id=#{pageComActDiscussDTO.communityId}" |
| | | // + " where d.community_id = ${pageComActDiscussDTO.communityId}" |
| | | // + "<if test='pageComActDiscussDTO.subject != null and pageComActDiscussDTO.subject.trim() != ""'>" |
| | | // + " and d.`discuss_subject` LIKE concat( #{pageComActDiscussDTO.subject}, '%' ) " + " </if> " |
| | | // + "<if test='pageComActDiscussDTO.begin != null '>" + "AND d.create_at BETWEEN #{pageComActDiscussDTO.begin} " |
| | |
| | | // + "LEFT JOIN com_act_discuss_user du ON d.id = du.discuss_id " |
| | | // + "<if test='pageComActDiscussDTO.loginUserId != null '>" |
| | | // + "LEFT JOIN com_act_discuss_option_user ou on do.id=ou.discuss_option_id and ou.user_id=#{pageComActDiscussDTO.loginUserId} " |
| | | // + " </if> " + " where d.community_id=#{pageComActDiscussDTO.communityId}" + " and d.is_del = 2" |
| | | // + " </if> " + " where d.community_id = ${pageComActDiscussDTO.communityId}" + " and d.is_del = 2" |
| | | // + "<if test='pageComActDiscussDTO.type != null '>" |
| | | // + " and d.`type` = #{pageComActDiscussDTO.type} " + " </if> " |
| | | // + "<if test='pageComActDiscussDTO.subject != null and pageComActDiscussDTO.subject.trim() != ""'>" |
| | |
| | | IPage<ComActDiscussCommentVO> pageDiscussCommentApplets(Page page, |
| | | @Param("pageComActDiscussCommentDTO") PageComActDiscussCommentDTO pageComActDiscussCommentDTO); |
| | | |
| | | @Select("select name,address from com_act where community_id=#{communityId}") |
| | | @Select("select name,address from com_act where community_id = ${communityId}") |
| | | ComActVO selectCommunity(Long communityId); |
| | | |
| | | @Select("SELECT " + "if(du.id is not null,1,0)haveSign, " + "if(ou.id is not null,1,0)haveVote " + "FROM " |
| | |
| | | |
| | | Map<String, Long> countByCommunityId(@Param("communityId") Long communityId, @Param("date") String date); |
| | | |
| | | @Select(" SELECT id,discuss_subject AS content,IF(type = 1,'图文','投票') AS typeName FROM com_act_discuss WHERE community_id = #{communityId} ORDER BY create_at DESC LIMIT #{pageSize}") |
| | | @Select(" SELECT id,discuss_subject AS content,IF(type = 1,'图文','投票') AS typeName FROM com_act_discuss WHERE community_id = ${communityId} ORDER BY create_at DESC LIMIT #{pageSize}") |
| | | List<CarouselInfoVO> screenDiscuss(@Param("communityId") Long communityId, @Param("pageSize") Integer pageSize); |
| | | |
| | | @Select("<script> " + "SELECT " + " cad.id, " + " su.nick_name AS userName, " + " su.image_url, " |
| | | + " cad.create_at, " + " cad.type, " + " cad.discuss_subject, " + " cad.photo_pah " + "FROM " |
| | | + " com_act_discuss AS cad " + " LEFT JOIN sys_user AS su ON su.user_id = cad.user_id " + " <where> " |
| | | + "<if test='discussListDTO.communityId != null '>" + " and cad.community_id = #{discussListDTO.communityId} " |
| | | + "<if test='discussListDTO.communityId != null '>" + " and cad.community_id = ${discussListDTO.communityId} " |
| | | + " </if> " + "<if test='discussListDTO.startTime!=null and discussListDTO.startTime != ""'>" |
| | | + " AND DATE_FORMAT(cad.create_at,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{discussListDTO.startTime} " |
| | | + " </if> " + "<if test='discussListDTO.endTime!=null and discussListDTO.endTime != ""'>" |
| | |
| | | * @return |
| | | */ |
| | | int batchUpdateViewNum(@Param("needDealMap") HashMap<Long, Integer> needDealMap); |
| | | |
| | | /** |
| | | * 居民自治-议事投票类型占比统计 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | List<StatisticsCommVO> selectTypePercent(@Param("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 获取一起议标题 |
| | | * @param type |
| | | * @param communityId |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | List<String> getTitles(@Param("type") int type, @Param("communityId") Long communityId, @Param("pageSize") Integer pageSize); |
| | | } |