huanghongfa
2021-08-21 2e64c232ab6b51b2cecf1ee96e1e9b709234f326
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
36
37
38
39
40
41
42
43
44
45
46
47
48
<?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.ComActNeighborCircleTopicMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActNeighborCircleTopicDO">
        <id column="id" property="id" />
        <result column="community_id" property="communityId" />
        <result column="name" property="name" />
        <result column="status" property="status" />
        <result column="create_at" property="createAt" />
        <result column="create_by" property="createBy" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, community_id, name, status, create_at, create_by
    </sql>
 
    <select id="pageNeighborTopicByAdmin" parameterType="com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleTopicAdminDTO"
            resultType="com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleTopicAdminVO">
        SELECT
            canct.id,
            canct.`name`,
            canct.`status`,
            canct.create_at,
            su.`name` as createBy
        FROM
            com_act_neighbor_circle_topic AS canct
            LEFT JOIN sys_user AS su ON su.user_id = canct.create_by
        <where>
            <if test="circleTopicAdminDTO.communityId != null">
                and canct.community_id = #{circleTopicAdminDTO.communityId}
            </if>
            <if test="circleTopicAdminDTO.status != null">
                and canct.status = #{circleTopicAdminDTO.status}
            </if>
            <if test="circleTopicAdminDTO.name != null and circleTopicAdminDTO.name != &quot;&quot;">
                and canct.name like concat(#{circleTopicAdminDTO.name},'%')
            </if>
        </where>
        order by canct.create_at desc
    </select>
 
    <select id="getNeighborTopicByApp" resultType="com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleTopicAppVO">
        select id,`name` from com_act_neighbor_circle_topic where `status` = 1 and community_id = #{communityId}
    </select>
</mapper>