2
13693261870
2022-09-16 653761a31dfeb50dd3d007e892d69c90bf0cdafc
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<?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.landtool.lanbase.modules.res.dao.KeShiHuaFuWuMapper" >
    <sql id="Base_Column_List" >
        CATLOGID, CATLOGCODE, PARENTID, TITLE, PINGYINFIIRST, DESCRIPTION, IMGURL, ORDERID,
        CREATEUSER, CREATEDATE, REMARK
    </sql>
    <select id="getYWTCAndZTDTCataLogList" resultType="com.landtool.lanbase.modules.res.entity.Res_Catalog">
        select distinct b.CATLOGID,b.CATLOGCODE,b.PARENTID,b.TITLE,b.PINGYINFIIRST,b.IMGURL,b.ORDERID,b.CREATEUSER,b.CREATEDATE,b.ICON
        from RES_CATALOG b
        left join (
        SELECT CATLOGCODE
        FROM RES_MAININFO a
        <if test="iscollect != null and iscollect == 1">
            left join RES_ACTIONRECORD b
            on a.RESOURCEID = b.RESOURCEID where b.ACTIONTYPE = '收藏' and b.userid = #{userid}
        </if>
        <if test="iscollect == null">
            where 1 = 1
        </if>
        and a.AUDITSTATUS = 2
        and a.RESOURCESTATUS = 0
        <if test="type != null and type == 0">
            and (a.resourceclass = 'KJ_ZTDT' or (a.resourceclass = 'YWJC'
            and exists(select * from RES_EXTINTEGRATE t where INTEGRATETYPE = '数据集成' and t.resourceid=a.resourceid)))
        </if>
        <if test="type != null and type == 1">
            and a.resourceclass = 'KJ_YWTC'
        </if>
        <if test="type != null and type == 2">
            and a.resourceclass = 'KJ_JCDT'
        </if>
        <if test="title!=null and title != '' ">
            and (a.TITLE like '%' || #{title} || '%' OR replace(a.KEYWORDS,',','') like '%' || #{title} || '%')
        </if>
        <if test="pubdateBegin!=null and pubdateBegin != '' ">
            and a.PUBDATE >= to_timestamp(#{pubdateBegin} || ' 00:00:00','yyyy-mm-dd hh24:mi:ss')
        </if>
        <if test="pubdatefinish!=null and pubdatefinish != '' ">
            <![CDATA[ and a.PUBDATE <= to_timestamp(#{pubdatefinish} || ' 23:59:59','yyyy-mm-dd hh24:mi:ss') ]]>
        </if>
        <if test="createuserid!=null and createuserid != '' ">
            and a.createuserid = #{createuserid,jdbcType=OTHER}
        </if>
        <if test="createuserid ==null and faburen!=null and faburen != '' ">
            and createuserid in( ${faburen} )
        </if>
 
        and (
        a.SHARPROTOCOL = '完全公开'
        or (a.SHARPROTOCOL = '依申请公开' and CREATEUSERID = #{userid})
        <if test="unitid != null and (unitid == 0 ? '0': unitid)">
            or (a.SHARPROTOCOL = '单位内公开' and PUBUNITID = #{unitid})
        </if>
        or exists(
        select * from RES_APPLYRECOMMEND b
        where (
        (b.APPTYPE = 0 and APPUSERID = #{userid})
        <if test="unitid != null and (unitid == 0 ? '0': unitid)">
            or (b.APPTYPE = 1 and APPUNITID = #{unitid})
        </if>
        and (b.EFFENDTIME is null or b.EFFENDTIME >= now())
        and a.RESOURCEID = b.RESOURCEID
        )
        )
        )
        group by CATLOGCODE
        ) c on b.CATLOGCODE = substr(c.CATLOGCODE, 1, LENGTH(b.CATLOGCODE))
        where parentid = #{parentid} and c.CATLOGCODE is not null
        order by ORDERID
    </select>
 
    <select id="getCatalogZiYuanList" resultType="com.landtool.lanbase.modules.res.entity.Res_MainInfo">
        select distinct a.RESOURCEID,a.CATLOGID, a.TITLE,
        a.ABBREVIATION, a.PINGYINFIIRST, a.CATLOGCODE,
        a.KEYWORDS, a.DESURL,
        a.IMGURL,  a.RESOURCECLASS,
        a.DATASOURCES, a.PRODUCTIONTIME,
        a.UPDATETIMES, a.PUBDATE, a.PUBUNITID,
        a.CREATEUSERID, a.ADMINISTRATIVEID, a.SECURITYLEV,
        a.SHARPROTOCOL, a.ESPPROXY, a.USERNAME,
        a.PASSWORD, a.RESOURCESTATUS,
        a.AUDITSTATUS, a.DISPLAYBY2D, a.DISPLAYBY3D,
        a.ORDERID from RES_MAININFO a
        <if test="iscollect != null and iscollect == 1">
            left join RES_ACTIONRECORD b
            on a.RESOURCEID = b.RESOURCEID where b.ACTIONTYPE = '收藏' and b.userid = #{userid}
        </if>
        <if test="iscollect == null">
            where 1 = 1
        </if>
        <if test="title!=null and title != '' ">
            and (a.TITLE like '%' || #{title} || '%' OR replace(a.KEYWORDS,',','') like '%' || #{title} || '%')
        </if>
        <if test="createuserid!=null and createuserid != '' ">
            and a.createuserid = #{createuserid,jdbcType=OTHER}
        </if>
        <if test="createuserid ==null and faburen!=null and faburen != '' ">
            and createuserid in( ${faburen} )
        </if>
 
        <if test="pubdateBegin!=null and pubdateBegin != '' ">
            and a.PUBDATE >=  to_timestamp(#{pubdateBegin} || ' 00:00:00','yyyy-mm-dd hh24:mi:ss')
        </if>
        <if test="pubdatefinish!=null and pubdatefinish != '' ">
            <![CDATA[ and a.PUBDATE <=  to_timestamp(#{pubdatefinish} || ' 23:59:59','yyyy-mm-dd hh24:mi:ss') ]]>
        </if>
        and a.AUDITSTATUS = 2
        and a.RESOURCESTATUS = 0
        <if test="type != null and type == 0">
            and (a.resourceclass = 'KJ_ZTDT' or (a.resourceclass = 'YWJC'
            and exists(select * from RES_EXTINTEGRATE t where INTEGRATETYPE = '数据集成' and t.resourceid=a.resourceid)))
        </if>
        <if test="type != null and type == 1">
            and a.resourceclass = 'KJ_YWTC'
        </if>
        <if test="type != null and type == 2">
            and a.resourceclass = 'KJ_JCDT'
        </if>
        and (
        a.SHARPROTOCOL = '完全公开'
        or (a.SHARPROTOCOL = '依申请公开' and CREATEUSERID = #{userid})
        <if test="unitid != null and (unitid == 0 ? '0': unitid)">
            or (a.SHARPROTOCOL = '单位内公开' and PUBUNITID = #{unitid})
        </if>
        or exists(
        select * from RES_APPLYRECOMMEND b
        where (
        (b.APPTYPE = 0 and APPUSERID = #{userid})
        <if test="unitid != null and (unitid == 0 ? '0': unitid)">
            or (b.APPTYPE = 1 and APPUNITID = #{unitid})
        </if>
        and (b.EFFENDTIME is null or b.EFFENDTIME >= now())
        and a.RESOURCEID = b.RESOURCEID
        )
        )
        )
        and a.CATLOGID = #{parentid,jdbcType=DECIMAL}
        order by a.ORDERID
    </select>
    <select id="getJSONYWJCList" resultType="com.landtool.lanbase.modules.res.entity.Res_MainInfo">
        select a.* from RES_MAININFO a
        left join RES_EXTINTEGRATE b on a.RESOURCEID=b.RESOURCEID
        where a.RESOURCECLASS='YWJC' and a.RESOURCESTATUS=0 and a.AUDITSTATUS =2
        and b.INTEGRATETYPE='数据集成'
    </select>
</mapper>