智慧保安后台管理-外网
Administrator
2022-06-16 8b375fe00a241b3a769b82fe3dac8d1c9dce8a02
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
<?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="org.springblade.modules.talk.mapper.TalkMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="talkResultMap" type="org.springblade.modules.talk.entity.Talk">
        <id column="id" property="id"/>
        <result column="title" property="title"/>
        <result column="real_name" property="realName"/>
        <result column="talkcontent" property="talkcontent"/>
        <result column="talktime" property="talktime"/>
        <result column="conclusion" property="conclusion"/>
        <result column="evaluate" property="evaluate"/>
        <result column="deptid" property="deptid"/>
        <result column="imgurl" property="imgurl"/>
    </resultMap>
 
    <!--自定义心理咨询分页查询-->
    <select id="selectTalkPage" resultMap="talkResultMap">
        select st.* from sys_talk st
        left join sys_information si on si.departmentid = st.deptid
        left join sys_jurisdiction sj on si.jurisdiction = sj.id
        where 1=1
        <if test="talk.deptid!=null and talk.deptid!='' and talk.deptid!='1123598813738675201'">
            and st.deptid=#{talk.deptid}
        </if>
        <if test="talk.jurisdiction!=null and talk.jurisdiction!='' and talk.jurisdiction!='1372091709474910209'">
            and (sj.id=#{talk.jurisdiction} or sj.parent_id = #{talk.jurisdiction})
        </if>
    </select>
 
</mapper>