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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<?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.Res_QueryAroundMapper" >
  <resultMap id="BaseResultMap" type="com.landtool.lanbase.modules.res.entity.Res_QueryAround" >
    <id column="QUERYID" property="queryid" jdbcType="DECIMAL" />
    <result column="RESOURCEID" property="resourceid" jdbcType="DECIMAL" />
    <result column="AROUNDRESID" property="aroundresid" jdbcType="DECIMAL" />
    <result column="ADDUSERID" property="adduserid" jdbcType="DECIMAL" />
  </resultMap>
  <sql id="Base_Column_List" >
    QUERYID, RESOURCEID, AROUNDRESID, ADDUSERID
  </sql>
 
  <!--查询记录-->
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select
    <include refid="Base_Column_List" />
    from RES_QUERYAROUND
    where QUERYID = #{queryid,jdbcType=DECIMAL}
  </select>
 
  <!--新增记录-->
  <insert id="insert" parameterType="com.landtool.lanbase.modules.res.entity.Res_QueryAround" >
    insert into RES_QUERYAROUND (RESOURCEID, AROUNDRESID, ADDUSERID)
    values (#{resourceid}, #{aroundresid}, #{adduserid})
  </insert>
 
  <!--新增记录(选择)-->
  <insert id="insertSelective" parameterType="com.landtool.lanbase.modules.res.entity.Res_QueryAround" >
    insert into RES_QUERYAROUND
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="queryid != null" >
        QUERYID,
      </if>
      <if test="resourceid != null" >
        RESOURCEID,
      </if>
      <if test="aroundresid != null" >
        AROUNDRESID,
      </if>
      <if test="adduserid != null" >
        ADDUSERID,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="queryid != null" >
        #{queryid,jdbcType=DECIMAL},
      </if>
      <if test="resourceid != null" >
        #{resourceid,jdbcType=DECIMAL},
      </if>
      <if test="aroundresid != null" >
        #{aroundresid,jdbcType=DECIMAL},
      </if>
      <if test="adduserid != null" >
        #{adduserid,jdbcType=DECIMAL},
      </if>
    </trim>
  </insert>
 
  <!--删除记录-->
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from RES_QUERYAROUND
    where QUERYID = #{queryid,jdbcType=DECIMAL}
  </delete>
 
  <!--修改记录(选择)-->
  <update id="updateByPrimaryKeySelective" parameterType="com.landtool.lanbase.modules.res.entity.Res_QueryAround" >
    update RES_QUERYAROUND
    <set >
      <if test="resourceid != null" >
        RESOURCEID = #{resourceid,jdbcType=DECIMAL},
      </if>
      <if test="aroundresid != null" >
        AROUNDRESID = #{aroundresid,jdbcType=DECIMAL},
      </if>
      <if test="adduserid != null" >
        ADDUSERID = #{adduserid,jdbcType=DECIMAL},
      </if>
    </set>
    where QUERYID = #{queryid,jdbcType=DECIMAL}
  </update>
 
  <!--修改记录-->
  <update id="updateByPrimaryKey" parameterType="com.landtool.lanbase.modules.res.entity.Res_QueryAround" >
    update RES_QUERYAROUND
    set RESOURCEID = #{resourceid,jdbcType=DECIMAL},
      AROUNDRESID = #{aroundresid,jdbcType=DECIMAL},
      ADDUSERID = #{adduserid,jdbcType=DECIMAL}
    where QUERYID = #{queryid,jdbcType=DECIMAL}
  </update>
 
  <!--获取(周边查询)资源设置列表-->
  <select id="getResourceSetZBCX" resultType="com.landtool.lanbase.modules.res.entity.Res_QueryAround" parameterType="java.lang.Integer" >
    select a.*, b.Title, b.ResourceClass, b.DataSources from RES_QUERYAROUND a
    left join RES_MAININFO b on a.AroundResId = b.ResourceId
    where b.ResourceStatus = 0 and b.AuditStatus = 2
    and a.ResourceId = #{resourceid,jdbcType=DECIMAL}
    order by QueryId desc
  </select>
 
  <!--获取(周边查询)资源选择列表-->
  <select id="getResourceSelectZBCX" parameterType="com.landtool.lanbase.modules.res.entity.Res_MainInfo" resultType="com.landtool.lanbase.modules.res.entity.Res_MainInfo">
    select * from RES_MAININFO a
    <where>
      ResourceStatus = 0 and AuditStatus = 2 and ResourceClass = 'KJ_YWTC'
      <if test="title != null and title != '' ">
        and (Title like '%'||#{title}||'%' OR replace(KEYWORDS,',','') like '%'||#{title}||'%' OR ABBREVIATION like '%'||#{title}||'%')
      </if>
      <if test="datasources != null and datasources != '' ">
        and (DATASOURCES like #{datasources} || '%' )
      </if>
      and not EXISTS(select AROUNDRESID from RES_QUERYAROUND b where a.ResourceId = b.AROUNDRESID and ResourceId = #{resourceid})
      and ResourceId != #{resourceid}
    </where>
    order by ResourceId
  </select>
 
  <select id="getResourceZBCXCatalog" 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 * from RES_MAININFO a
    where
      ResourceStatus = 0 and AuditStatus = 2 and ResourceClass = 'KJ_YWTC'
      <if test="title != null and title != '' ">
        and (Title like '%'||#{title}||'%' OR replace(KEYWORDS,',','') like '%'||#{title}||'%' OR ABBREVIATION like '%'||#{title}||'%')
      </if>
      <if test="datasources != null and datasources != '' ">
        and (DATASOURCES like #{datasources} || '%' )
      </if>
      and not EXISTS(select AROUNDRESID from RES_QUERYAROUND b where a.ResourceId = b.AROUNDRESID and ResourceId = #{resourceid})
      and ResourceId != #{resourceid}
    )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="getResourceZBCXCatalogList" resultType="com.landtool.lanbase.modules.res.entity.Res_MainInfo">
    select * from RES_MAININFO a
    where
    ResourceStatus = 0 and AuditStatus = 2 and ResourceClass = 'KJ_YWTC'
    <if test="title != null and title != '' ">
      and (Title like '%'||#{title}||'%' OR replace(KEYWORDS,',','') like '%'||#{title}||'%' OR ABBREVIATION like '%'||#{title}||'%')
    </if>
    <if test="datasources != null and datasources != '' ">
      and (DATASOURCES like #{datasources} || '%' )
    </if>
    and not EXISTS(select AROUNDRESID from RES_QUERYAROUND b where a.ResourceId = b.AROUNDRESID and ResourceId = #{resourceid})
    and ResourceId != #{resourceid}
    <if test="parentid != null and parentid != '' ">
    and CATLOGID = #{parentid,jdbcType=DECIMAL}
    </if>
    <if test="keyWord != null and keyWord != ''">
      and (PINGYINFIIRST like '%'||#{keyWord}||'%' or TITLE like '%'||#{keyWord}||'%')
    </if>
    order by ORDERID
  </select>
 
  <select id="getZhouBianList" parameterType="java.lang.Integer"
          resultType="com.landtool.lanbase.modules.res.entity.Res_QueryAround">
    select a.*,b.title,b.resourceclass,b.datasources from RES_QUERYAROUND a left join RES_MAININFO b on a.AROUNDRESID = b.RESOURCEID
    where b.RESOURCESTATUS = 0
    AND a.RESOURCEID = #{resourceid}
    order by QUERYID desc
  </select>
 
  <select id="getZhouBianChaXunList" parameterType="com.landtool.lanbase.modules.res.entity.Res_QueryAround" resultType="com.landtool.lanbase.modules.res.entity.Res_QueryAround">
    select a.* from RES_QUERYAROUND a left join RES_MAININFO b on a.AROUNDRESID = b.RESOURCEID
    where b.RESOURCESTATUS = 0 AND b.AuditStatus = 2
    AND a.RESOURCEID = #{resourceid} AND a.ADDUSERID = #{adduserid}
    order by QUERYID desc
  </select>
 
  <select id="selectCountByResourceid"  resultType="java.lang.Integer" parameterType="java.lang.Integer">
    select count(*) from RES_QUERYAROUND
    where resourceid = #{resourceid,jdbcType=DECIMAL}
  </select>
  <delete id="deleteByResourceid" parameterType="java.lang.Integer">
    delete from RES_QUERYAROUND
    where resourceid = #{resourceid,jdbcType=DECIMAL}
  </delete>
 
</mapper>