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
35
<?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.ComActSocialProjectPublicityDao">
 
    <resultMap type="com.panzhihua.service_community.entity.ComActSocialProjectPublicity"
               id="ComActSocialProjectPublicityBaseResultMap">
        <result property="id" column="id"/>
        <result property="title" column="title"/>
        <result property="image" column="image"/>
        <result property="content" column="content"/>
        <result property="projectId" column="project_id"/>
        <result property="createTime" column="create_time"/>
        <result property="views" column="views"/>
    </resultMap>
 
    <select id="pageList" resultType="com.panzhihua.common.model.vos.community.social.ComActSocialProjectPublicityVO">
        select t.*,t1.name,t1.responsibility
        from com_act_social_project_publicity t
        left join com_act_social_project t1 on t.project_id = t1.id
        <if test="commonPage.streetId != null">
            JOIN (SELECT * FROM com_act_social_project WHERE (street_id = #{commonPage.streetId} OR community_id = #{commonPage.communityId}) AND `status` =3) t2 ON t.project_id = t2.id
        </if>
        <where>
            <if test="commonPage.paramId !=null">
                and t.project_id =#{commonPage.paramId}
            </if>
        </where>
        order by is_top desc,create_time desc
    </select>
 
    <select id="selectOne" resultType="com.panzhihua.common.model.vos.community.social.ComActSocialProjectPublicityVO">
        select t.*,t1.name,t1.responsibility,t2.name as streetName from com_act_social_project_publicity t left join com_act_social_project t1 on t.project_id = t1.id left join com_street t2 on t1.street_id = t2.street_id where t.id = #{id}
    </select>
 
</mapper>