<?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" />
|
<result column="count" property="count" />
|
<result column="hot_num" property="hotNum" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
id, community_id, name, status, create_at, create_by, count, hot_num
|
</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,
|
canct.logo,
|
su.`name` as createBy,
|
canct.sort
|
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.name != null and circleTopicAdminDTO.name != """>
|
and canct.name like concat(#{circleTopicAdminDTO.name},'%')
|
</if>
|
</where>
|
order by canct.sort asc
|
</select>
|
|
<select id="getNeighborTopicByApp" resultType="com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleTopicAppVO">
|
SELECT canct.id, canct.`name`,`logo`, canct.hot_num
|
from com_act_neighbor_circle_topic as canct where canct.`status` = 1
|
<if test="name != null and name != """>
|
and canct.`name` like concat('%',#{name},'%')
|
</if>
|
order by canct.sort asc
|
</select>
|
|
<update id="addHotNum">
|
update com_act_neighbor_circle_topic set hot_num = hot_num + #{hotNum} where id = #{circleTopicId}
|
</update>
|
|
<update id="addCount">
|
update com_act_neighbor_circle_topic set `count` = `count` + 1 where id = #{circleTopicId}
|
</update>
|
</mapper>
|