<?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>
|