mitao
2025-02-21 31573d6180d15ef65ed0df9c2732495f40b12663
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.panzhihua.service_community.dao.ComActAnnouncementDao">
 
    <resultMap type="com.panzhihua.service_community.entity.ComActAnnouncement" id="ComActAnnouncementBaseResultMap">
        <result property="id" column="id"/>
        <result property="content" column="content"/>
        <result property="createTime" column="create_time"/>
        <result property="userId" column="user_id"/>
        <result property="columnId" column="column_id"/>
        <result property="communityId" column="community_id"/>
    </resultMap>
 
    <select id="pageList" resultType="com.panzhihua.common.model.vos.community.ComActAnnouncementVO">
        select t.*,t1.name as username,t2.name as columnName from com_act_announcement t left join sys_user t1 on t.user_id = t1.user_id left join com_act_column t2 on t.column_id = t2.id
        <where>
            1=1
            <if test="commonPage.communityId!=null">
                and t.community_id = ${commonPage.communityId}
            </if>
            <if test="commonPage.paramId!=null">
                and t.column_id =#{commonPage.paramId}
            </if>
            <if test="commonPage.keyword!=null and commonPage.keyword !=''">
                and t.content like concat('%',#{commonPage.keyword},'%')
            </if>
            <if test="commonPage.propertyId!=null and commonPage.propertyId !=''">
                and t.property_id=#{commonPage.propertyId}
            </if>
        </where>
        order by t.create_time desc
    </select>
 
</mapper>