| | |
| | | <mapper namespace="org.springblade.modules.discuss.mapper.PublicDiscussMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="publicDiscussResultMap" type="org.springblade.modules.discuss.entity.PublicDiscussEntity"> |
| | | <resultMap id="publicDiscussResultMap" type="org.springblade.modules.discuss.vo.PublicDiscussVO"> |
| | | <result property="id" column="id" /> |
| | | <result property="title" column="title" /> |
| | | <result property="openFlag" column="open_flag" /> |
| | |
| | | <result property="voteRestrictions" column="vote_restrictions" /> |
| | | <result property="userRestrictions" column="user_restrictions" /> |
| | | <result property="endTime" column="end_time" /> |
| | | <result property="startTime" column="start_time" /> |
| | | <result property="articleId" column="article_id" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="deleteFlag" column="delete_flag" /> |
| | | <result property="deletedFlag" column="deleted_flag" /> |
| | | <result property="repeatVote" column="repeat_vote" /> |
| | | <result property="voteNumberPublic" column="vote_number_public" /> |
| | | <result property="appointUser" column="appoint_user" /> |
| | |
| | | vote_restrictions, |
| | | user_restrictions, |
| | | end_time, |
| | | start_time, |
| | | article_id, |
| | | create_time, |
| | | update_time, |
| | | delete_flag, |
| | | deleted_flag, |
| | | repeat_vote, |
| | | vote_number_public, |
| | | appoint_user, |
| | |
| | | |
| | | |
| | | <select id="selectPublicDiscussPage" resultMap="publicDiscussResultMap"> |
| | | select * from jczz_public_discuss where deleted_flag = 0 |
| | | select jpd.id, |
| | | jpd.title, |
| | | jpd.open_flag, |
| | | jpd.number_restrictions, |
| | | jpd.vote_restrictions, |
| | | jpd.user_restrictions, |
| | | jpd.end_time, |
| | | jpd.start_time, |
| | | jpd.article_id, |
| | | jpd.create_time, |
| | | jpd.update_time, |
| | | jpd.deleted_flag, |
| | | jpd.repeat_vote, |
| | | jpd.vote_number_public, |
| | | jpd.appoint_user, |
| | | jpd.user_ids, |
| | | jpd.event_type, |
| | | jpd.signature_flag, |
| | | GROUP_CONCAT(jh.name) userName |
| | | from jczz_public_discuss jpd |
| | | LEFT JOIN jczz_household jh ON FIND_IN_SET ( jh.id, jpd.user_ids ) |
| | | <where> |
| | | <if test="publicDiscuss.id != null "> and id = #{publicDiscuss.id}</if> |
| | | <if test="publicDiscuss.title != null and publicDiscuss.title != ''"> and title = #{publicDiscuss.title}</if> |
| | | <if test="publicDiscuss.openFlag != null "> and open_flag = #{publicDiscuss.openFlag}</if> |
| | | <if test="publicDiscuss.numberRestrictions != null "> and number_restrictions = #{publicDiscuss.numberRestrictions}</if> |
| | | <if test="publicDiscuss.voteRestrictions != null "> and vote_restrictions = #{publicDiscuss.voteRestrictions}</if> |
| | | <if test="publicDiscuss.userRestrictions != null "> and user_restrictions = #{publicDiscuss.userRestrictions}</if> |
| | | <if test="publicDiscuss.endTime != null "> and end_time = #{publicDiscuss.endTime}</if> |
| | | <if test="publicDiscuss.articleId != null "> and article_id = #{publicDiscuss.articleId}</if> |
| | | <if test="publicDiscuss.createTime != null "> and create_time = #{publicDiscuss.createTime}</if> |
| | | <if test="publicDiscuss.updateTime != null "> and update_time = #{publicDiscuss.updateTime}</if> |
| | | <if test="publicDiscuss.deletedFlag != null "> and deleted_flag = #{publicDiscuss.deletedFlag}</if> |
| | | <if test="publicDiscuss.repeatVote != null "> and repeat_vote = #{publicDiscuss.repeatVote}</if> |
| | | <if test="publicDiscuss.voteNumberPublic != null "> and vote_number_public = #{publicDiscuss.voteNumberPublic}</if> |
| | | <if test="publicDiscuss.appointUser != null "> and appoint_user = #{publicDiscuss.appointUser}</if> |
| | | <if test="publicDiscuss.userIds != null and publicDiscuss.userIds != ''"> and user_ids = #{publicDiscuss.userIds}</if> |
| | | <if test="publicDiscuss.eventType != null "> and event_type = #{publicDiscuss.eventType}</if> |
| | | </where> |
| | | GROUP BY jpd.id |
| | | </select> |
| | | |
| | | <select id="selectPublicDiscussList" parameterType="org.springblade.modules.discuss.dto.PublicDiscussDTO" resultMap="publicDiscussResultMap"> |
| | |
| | | <if test="articleId != null "> and article_id = #{articleId}</if> |
| | | <if test="createTime != null "> and create_time = #{createTime}</if> |
| | | <if test="updateTime != null "> and update_time = #{updateTime}</if> |
| | | <if test="deleteFlag != null "> and delete_flag = #{deleteFlag}</if> |
| | | <if test="deletedFlag != null "> and deleted_flag = #{deletedFlag}</if> |
| | | <if test="repeatVote != null "> and repeat_vote = #{repeatVote}</if> |
| | | <if test="voteNumberPublic != null "> and vote_number_public = #{voteNumberPublic}</if> |
| | | <if test="appointUser != null "> and appoint_user = #{appointUser}</if> |
| | |
| | | </select> |
| | | |
| | | |
| | | <select id="selectPublicDiscuss" parameterType="org.springblade.modules.discuss.vo.PublicDiscussVO" resultMap="publicDiscussResultMap"> |
| | | select |
| | | jpd.id, |
| | | jpd.title, |
| | | jpd.open_flag, |
| | | jpd.number_restrictions, |
| | | jpd.vote_restrictions, |
| | | jpd.user_restrictions, |
| | | jpd.end_time, |
| | | jpd.start_time, |
| | | jpd.article_id, |
| | | jpd.create_time, |
| | | jpd.update_time, |
| | | jpd.deleted_flag, |
| | | jpd.repeat_vote, |
| | | jpd.vote_number_public, |
| | | jpd.appoint_user, |
| | | jpd.user_ids, |
| | | jpd.event_type, |
| | | jpd.signature_flag, |
| | | (SELECT household_id from jczz_user_public_enroll where household_id = #{householdId} and article_id = jpd.article_id)householdId |
| | | from |
| | | jczz_public_discuss jpd |
| | | <where> |
| | | <if test="articleId != null ">and jpd.article_id = #{articleId}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | </mapper> |