From 70d2a5d0f9c6951b2d4cac954041ed73582ff7eb Mon Sep 17 00:00:00 2001 From: liujie <1793218484@qq.com> Date: 星期一, 09 六月 2025 11:54:00 +0800 Subject: [PATCH] 6.9新增登录失败冻结逻辑 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActQuestnaireDAO.java | 183 +++++++++++++++++++++++++++++++++------------ 1 files changed, 132 insertions(+), 51 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActQuestnaireDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActQuestnaireDAO.java index 124386d..626165c 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActQuestnaireDAO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActQuestnaireDAO.java @@ -1,14 +1,23 @@ package com.panzhihua.service_community.dao; +import java.util.List; + +import com.panzhihua.common.model.dtos.PageBaseDTO; +import com.panzhihua.common.model.vos.community.ComActQuestnaireVO; +import com.panzhihua.common.model.vos.community.StatisticsCommVO; +import com.panzhihua.common.model.vos.community.bigscreen.BigScreenQuestionnaireStatisticsInfo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + 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.dtos.community.PageQuestnaireDTO; -import com.panzhihua.common.model.vos.community.questnaire.QuestnaireListVo; +import com.panzhihua.common.model.dtos.community.questnaire.StatisticsSummaryDTO; +import com.panzhihua.common.model.vos.community.ComActQuestnaireAppVO; +import com.panzhihua.common.model.vos.community.questnaire.*; import com.panzhihua.service_community.model.dos.ComActQuestnaireDO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; /** * @Author: llming @@ -16,57 +25,129 @@ */ @Mapper public interface ComActQuestnaireDAO extends BaseMapper<ComActQuestnaireDO> { - @Select("<script> " + - "SELECT DISTINCT aq.id, aq.title, aq.state, u.name as create_user, aq.join_count, aq.create_at , aq.create_by \n" + - "FROM \n" + - " com_act_questnaire aq \n" + - " LEFT JOIN sys_user u on aq.create_by = u.user_id \n" + - "<if test='pageQuestnaireDTO.userId != null '>\n" + //筛选用户已回答的问卷 - " LEFT JOIN com_act_questnaire_sub qs ON aq.id = qs.que_Id\n" + - " LEFT JOIN com_act_questnaire_answer_content ac ON qs.id = ac.sub_id AND ac.user_id=#{pageQuestnaireDTO.userId} " + - " </if> \n" + - " where aq.is_hide=0 " + + @Select("<script> " + "SELECT " + " caq.id, " + " caq.project_key, " + " caq.title, " + " caq.state, " + + " caq.for_masses, " + " caq.for_party, " + " caq.for_volunteer, " + " caq.join_count, " + " caq.remark, " + + " caq.is_cover, " + " caq.is_force, " + " caq.create_at, " + " caq.count, " + + " if(caqua.id is not null,1,2) isAnswer, " + " caq.view_num " + "FROM " + " com_act_questnaire as caq " + + " left join com_act_questnaire_user_answer as caqua on caqua.questnaire_id = caq.id and caqua.user_id = #{pageQuestnaireDTO.userId} " + + "WHERE " + " caq.state IN ( 2, 3 ) " + + " AND caq.community_id = ${pageQuestnaireDTO.communityId} and caq.is_hide = 0 " + "ORDER BY " + + " caq.state ASC, " + " isAnswer ASC, " + " caq.create_at DESC" + "</script>") + IPage<QuestnaireListVo> selectPageList(Page page, @Param("pageQuestnaireDTO") PageQuestnaireDTO pageQuestnaireDTO); - "<if test='pageQuestnaireDTO.userId != null '>\n" + //筛选用户已回答的问卷 - " AND case when ac.id IS NULL then aq.state=0 ELSE TRUE end " + - " </if> \n" + - "<if test='communityId != null and communityId!=0l '>\n" + - " and aq.community_id = #{communityId}\n" + - " </if> " + - "<if test='pageQuestnaireDTO.state != null '>\n" + - " and aq.state = #{pageQuestnaireDTO.state} \n" + - " </if> " + - "<if test='pageQuestnaireDTO.forMasses != null '>\n" + - " and aq.for_masses = #{pageQuestnaireDTO.forMasses} \n" + - " </if> \n" + - "<if test='pageQuestnaireDTO.title != null '>\n" + - " and aq.title like concat('%', #{pageQuestnaireDTO.title},'%') \n" + - " </if> \n" + + @Select("<script>" + + "select id,title,view_num,join_count,for_masses,for_party,for_volunteer,adver_position_top,adver_position_popup" + + ",adver_position_application,create_at,start_time,end_time,publish_time,state,is_cover,project_key,count" + + " from com_act_questnaire as caq where community_id = ${pageQuestnaireDTO.communityId} and is_hide = 0 " + + "<if test='pageQuestnaireDTO.identity != null and pageQuestnaireDTO.identity == 1'>" + + " and caq.for_masses = 1 " + " </if> " + + "<if test='pageQuestnaireDTO.identity != null and pageQuestnaireDTO.identity == 2'>" + + " and caq.for_party = 1 " + " </if> " + + "<if test='pageQuestnaireDTO.identity != null and pageQuestnaireDTO.identity == 3'>" + + " and caq.for_volunteer = 1 " + " </if> " + + "<if test='pageQuestnaireDTO.advertPosition != null and pageQuestnaireDTO.advertPosition == 1'>" + + " and caq.adver_position_popup = 1 " + " </if> " + + "<if test='pageQuestnaireDTO.advertPosition != null and pageQuestnaireDTO.advertPosition == 2'>" + + " and caq.adver_position_top = 1 " + " </if> " + + "<if test='pageQuestnaireDTO.advertPosition != null and pageQuestnaireDTO.advertPosition == 3'>" + + " and caq.adver_position_application = 1 " + " </if> " + + "<if test='pageQuestnaireDTO.states != null and pageQuestnaireDTO.states.size > 0 '>" + " and caq.state in " + + "<foreach item=\"item\" collection=\"pageQuestnaireDTO.states\" separator=\",\" open=\"(\" close=\")\" index=\"\"> \n" + + "#{item}\n" + "</foreach>\n" + " </if> " + + "<if test='pageQuestnaireDTO.startTime != null and pageQuestnaireDTO.startTime != ""'>" + + " and caq.publish_time <![CDATA[ >= ]]> #{pageQuestnaireDTO.startTime}" + " </if> " + + "<if test='pageQuestnaireDTO.endTime != null and pageQuestnaireDTO.endTime != ""'>" + + " and caq.publish_time <![CDATA[ <= ]]> #{pageQuestnaireDTO.endTime}" + " </if> " + + "<if test='pageQuestnaireDTO.title != null and pageQuestnaireDTO.title != ""'>" + + " and caq.title like concat (#{pageQuestnaireDTO.title},'%')" + " </if> " + " order by caq.create_at DESC " + + "</script>") + IPage<QuestnaireListAdminVO> selectPageListAdmin(Page page, + @Param("pageQuestnaireDTO") PageQuestnaireDTO pageQuestnaireDTO); - "<if test='pageQuestnaireDTO.forParty==true and pageQuestnaireDTO.forVolunteer==true '>\n" + //既是党员又是志愿者 - " and ( aq.for_party = 1 OR aq.for_volunteer=1 OR (aq.for_party!=1 AND aq.for_volunteer!=1) ) \n" + - " </if> \n" + + @Select("select count(id) from com_act_questnaire_user where user_id = #{userId} and questnaire_id = #{questnaireId}") + Integer getNoRemindCount(@Param("userId") Long userId, @Param("questnaireId") Long questnaireId); - "<if test='pageQuestnaireDTO.forParty==true and pageQuestnaireDTO.forVolunteer==false '>\n" + //党员 不是志愿者 - " and ( aq.for_party = 1 OR (aq.for_party!=1 AND aq.for_volunteer!=1) ) \n" + - " </if> \n" + + @Select("SELECT " + " id, " + " title, " + " remark, " + " is_cover, " + " for_masses, " + " for_party, " + + " for_volunteer, " + " is_force, " + " adver_position_popup, " + " adver_position_top, " + + " adver_position_application, " + " project_key " + "FROM " + " com_act_questnaire " + "WHERE " + + " end_time >= now() " + " AND now() >= start_time " + " and community_id = ${communityId} " + + " and adver_position_top = 1 " + " and state = 2") + List<ComActQuestnaireAppVO> getIndexTopQuestnaireList(@Param("communityId") Long communityId); - "<if test='pageQuestnaireDTO.forParty==false and pageQuestnaireDTO.forVolunteer==true '>\n" + //非党员的志愿者 - " and ( aq.for_volunteer = 1 OR (aq.for_party!=1 AND aq.for_volunteer!=1) ) \n" + - " </if> \n" + + @Select("SELECT " + " id, " + " title, " + " remark, " + " for_masses, " + " for_party, " + " for_volunteer, " + + " is_cover, " + " is_force, " + " adver_position_popup, " + " adver_position_top, " + + " adver_position_application, " + " project_key " + "FROM " + " com_act_questnaire " + "WHERE " + + " end_time >= now() " + " AND now() >= start_time " + " and community_id = ${communityId} " + + " and adver_position_application = 1 " + " and state = 2") + List<ComActQuestnaireAppVO> getIndexApplicationQuestnaireList(@Param("communityId") Long communityId); - "<if test='pageQuestnaireDTO.forParty==false and pageQuestnaireDTO.forVolunteer==false '>\n" + //非党员非志愿者 - " and (aq.for_party!=1 AND aq.for_volunteer!=1) \n" + - " </if> \n" + + Integer getAdvPopupCount(@Param("communityId") Long communityId, @Param("startTime") String startTime, + @Param("endTime") String endTime, @Param("id") Long id); - "<if test='pageQuestnaireDTO.startTime != null '>\n" + - " AND aq.create_at <![CDATA[>=]]> #{pageQuestnaireDTO.startTime} \n" + - "</if>" + - "<if test='pageQuestnaireDTO.endTime != null '>\n" + - " AND aq.create_at <![CDATA[<=]]> #{pageQuestnaireDTO.endTime} \n" + - " </if> \n" + - " ORDER BY \n" + - " aq.create_at DESC" + - "</script>") - IPage<QuestnaireListVo> selectPageList(Page page, @Param("pageQuestnaireDTO") PageQuestnaireDTO pageQuestnaireDTO, @Param("communityId") Long communityId); + void deleteQuesSubAll(@Param("queId") Long queId); + + void deleteQuesSubAll2(@Param("queId") Long queId); + + QuestnaireDetailAdminVO getQuesDetailAdmin(@Param("queId") Long queId); + + /** + * 小程序-问卷调查详情 + * + * @param userId + * 用户id + * @param questId + * 问卷id + * @return 问卷调查详情 + */ + QuestnaireDetailAdminVO getQuesDetail(@Param("questId") Long questId, @Param("userId") Long userId); + + /** + * 问卷调查统计汇总 + * + * @param summaryDTO + * 请求参数 + * @return 统计汇总 + */ + IPage<QuestnaireStatisticsSummaryAdminVO> getStatisticsSummaryAdmin(Page page, + @Param("summaryDTO") StatisticsSummaryDTO summaryDTO); + + /** + * 问卷调查统计汇总导出数据查询 + * + * @param questId + * 调查问卷id + * @return 调查统计汇总导出数据 + */ + List<QuestnaireStatisticsSummaryExcelAdminVO> getStatisticsSummaryExcelAdmin(@Param("questId") Long questId); + + /** + * 问卷调查统计汇总表头统计 + * + * @param questId + * 调查问卷id + * @return 问卷调查统计汇总表头统计数据 + */ + QuestnaireStatisticsSummaryHeaderAdminVO statisticsSummaryHeader(@Param("questId") Long questId, + @Param("communityId") Long communityId); + + void addNoNotice(@Param("questId") Long questId, @Param("userId") Long userId); + + /** + * 首页大屏二级页面-社区问卷基础数据 + * @param communityId + * @return + */ + BigScreenQuestionnaireStatisticsInfo getIndexQuestionnaireBaseData(@Param("communityId") Long communityId); + + List<StatisticsCommVO> getQuestionnaireAddPolylineData(@Param("communityId") Long communityId); + + StatisticsCommVO getQuestionnaireTotalPolylineDate(@Param("communityId") Long communityId, @Param("date") String date); + + /** + * 大屏问卷展示列表 + * @param page + * @param pageBaseDTO + * @return + */ + IPage<ComActQuestnaireVO> selectQuestionnaireDisplayList(@Param("page") Page page, @Param("pageBaseDTO") PageBaseDTO pageBaseDTO); } -- Gitblit v1.7.1