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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<?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_BusinessRefMapper" >
    <resultMap id="BaseResultMap" type="com.landtool.lanbase.modules.res.entity.Res_BusinessRef" >
        <id column="RESREFID" property="resrefid" jdbcType="DECIMAL" />
        <result column="RESOURCEID" property="resourceid" jdbcType="DECIMAL" />
        <result column="REFRESOURCEID" property="refresourceid" jdbcType="DECIMAL" />
        <result column="INPUTPARAM" property="inputparam" jdbcType="OTHER" />
        <result column="OUTPUTPARAM" property="outputparam" jdbcType="OTHER" />
        <result column="REFTYPE" property="reftype" jdbcType="DECIMAL" />
        <result column="TITLE" property="title" jdbcType="OTHER" />
    </resultMap>
    <sql id="Base_Column_List" >
      RESREFID, RESOURCEID, REFRESOURCEID, INPUTPARAM, OUTPUTPARAM, REFTYPE
  </sql>
 
    <!--查询记录-->
    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
      select
      <include refid="Base_Column_List" />
      from RES_BUSINESSREF
      where RESREFID = #{resrefid}
  </select>
 
    <!--删除记录-->
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
      delete from RES_BUSINESSREF
      where RESREFID = #{resrefid}
  </delete>
 
    <!--新增记录-->
    <insert id="insert" parameterType="com.landtool.lanbase.modules.res.entity.Res_BusinessRef" >
      insert into RES_BUSINESSREF (RESREFID, RESOURCEID, REFRESOURCEID,
      INPUTPARAM, OUTPUTPARAM, REFTYPE
      )
    values (#{resrefid,jdbcType=DECIMAL}, #{resourceid,jdbcType=DECIMAL}, #{refresourceid,jdbcType=DECIMAL},
      #{inputparam,jdbcType=OTHER}, #{outputparam,jdbcType=OTHER}, #{reftype,jdbcType=DECIMAL}
      )
  </insert>
 
    <!--新增记录(选择)-->
    <insert id="insertSelective" parameterType="com.landtool.lanbase.modules.res.entity.Res_BusinessRef" >
      insert into RES_BUSINESSREF
      <trim prefix="(" suffix=")" suffixOverrides="," >
          <if test="resrefid != null" >
            RESREFID,
          </if>
          <if test="resourceid != null" >
            RESOURCEID,
          </if>
          <if test="refresourceid != null" >
            REFRESOURCEID,
          </if>
          <if test="inputparam != null" >
            INPUTPARAM,
          </if>
          <if test="outputparam != null" >
            OUTPUTPARAM,
          </if>
          <if test="reftype != null" >
            REFTYPE,
          </if>
      </trim>
      <trim prefix="values (" suffix=")" suffixOverrides="," >
          <if test="resrefid != null" >
            #{resrefid,jdbcType=DECIMAL},
          </if>
          <if test="resourceid != null" >
            #{resourceid,jdbcType=DECIMAL},
          </if>
          <if test="refresourceid != null" >
            #{refresourceid,jdbcType=DECIMAL},
          </if>
          <if test="inputparam != null" >
            #{inputparam,jdbcType=OTHER},
          </if>
          <if test="outputparam != null" >
            #{outputparam,jdbcType=OTHER},
          </if>
          <if test="reftype != null" >
            #{reftype,jdbcType=DECIMAL},
          </if>
      </trim>
  </insert>
 
    <!--修改记录(选择)-->
    <update id="updateByPrimaryKeySelective" parameterType="com.landtool.lanbase.modules.res.entity.Res_BusinessRef" >
          update RES_BUSINESSREF
          <set >
              <if test="resourceid != null" >
                RESOURCEID = #{resourceid,jdbcType=DECIMAL},
              </if>
              <if test="refresourceid != null" >
                REFRESOURCEID = #{refresourceid,jdbcType=DECIMAL},
              </if>
              <if test="inputparam != null" >
                INPUTPARAM = #{inputparam,jdbcType=OTHER},
              </if>
              <if test="outputparam != null" >
                OUTPUTPARAM = #{outputparam,jdbcType=OTHER},
              </if>
              <if test="reftype != null" >
                REFTYPE = #{reftype,jdbcType=DECIMAL},
              </if>
          </set>
          where RESREFID = #{resrefid,jdbcType=DECIMAL}
      </update>
 
    <!--修改记录-->
    <update id="updateByPrimaryKey" parameterType="com.landtool.lanbase.modules.res.entity.Res_BusinessRef" >
          update RES_BUSINESSREF
          set RESOURCEID = #{resourceid,jdbcType=DECIMAL},
              REFRESOURCEID = #{refresourceid,jdbcType=DECIMAL},
              INPUTPARAM = #{inputparam,jdbcType=OTHER},
              OUTPUTPARAM = #{outputparam,jdbcType=OTHER},
              REFTYPE = #{reftype,jdbcType=DECIMAL}
          where RESREFID = #{resrefid,jdbcType=DECIMAL}
      </update>
 
    <!--资源设置 - 关联图层-->
    <select id="getResourceSetGLTC" parameterType="com.landtool.lanbase.modules.res.entity.Res_BusinessRef" resultType="com.landtool.lanbase.modules.res.entity.Res_BusinessRef">
        select a.*, b.Title, b.ResourceClass, b.DataSources from RES_BUSINESSREF a
        left join RES_MAININFO b on a.RefResourceId = b.ResourceId
        where b.ResourceStatus = 0 and b.AuditStatus = 2
        and a.ResourceId = #{resourceid}
        order by ResRefId desc
      </select>
 
    <!--资源选择 - 关联图层-->
    <select id="getResourceSelectGLTC" resultType="com.landtool.lanbase.modules.res.entity.Res_MainInfo">
          select * from RES_MAININFO a where RESOURCESTATUS = 0
          and not EXISTS (select REFRESOURCEID from RES_BUSINESSREF b where a.RESOURCEID = b.REFRESOURCEID and RESOURCEID = #{resourceid})
          and RESOURCEID != #{resourceid}
          and AuditStatus = 2
          <if test="title!=null and title != '' ">
              and (TITLE like '%'||#{title}||'%' OR replace(KEYWORDS,',','') like '%'||#{title}||'%' OR ABBREVIATION like '%'||#{title}||'%')
          </if>
          <if test="resourceclass !=null and resourceclass != '' ">
              and resourceclass=#{resourceclass,jdbcType=OTHER}
          </if>
          <if test="datasources !=null and datasources != '' ">
              and datasources=#{datasources,jdbcType=OTHER}
          </if>
          order by resourceid;
      </select>
 
    <select id="getResourceGLTCCatalog" 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  not EXISTS (select REFRESOURCEID from RES_BUSINESSREF b where a.RESOURCEID = b.REFRESOURCEID and RESOURCEID = #{resourceid})
        and RESOURCEID != #{resourceid}
        and AuditStatus = 2
        <if test="title!=null and title != '' ">
            and (TITLE like '%'||#{title}||'%' OR replace(KEYWORDS,',','') like '%'||#{title}||'%' OR ABBREVIATION like '%'||#{title}||'%')
        </if>
        <if test="resourceclass !=null and resourceclass != '' ">
            and resourceclass=#{resourceclass,jdbcType=OTHER}
        </if>
        <if test="datasources !=null and datasources != '' ">
            and datasources=#{datasources,jdbcType=OTHER}
        </if>
        )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="getResourceGLTCCatalogList" resultType="com.landtool.lanbase.modules.res.entity.Res_MainInfo">
        select * from RES_MAININFO a where RESOURCESTATUS = 0
        and not EXISTS (select REFRESOURCEID from RES_BUSINESSREF b where a.RESOURCEID = b.REFRESOURCEID and RESOURCEID = #{resourceid})
        and RESOURCEID != #{resourceid}
        and AuditStatus = 2
        <if test="title!=null and title != '' ">
            and (TITLE like '%'||#{title}||'%' OR replace(KEYWORDS,',','') like '%'||#{title}||'%' OR ABBREVIATION like '%'||#{title}||'%')
        </if>
        <if test="resourceclass !=null and resourceclass != '' ">
            and resourceclass=#{resourceclass,jdbcType=OTHER}
        </if>
        <if test="datasources !=null and datasources != '' ">
            and datasources=#{datasources,jdbcType=OTHER}
        </if>
        <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="selectResBusinesssRef" parameterType="com.landtool.lanbase.modules.res.entity.Res_BusinessRef"
              resultType="com.landtool.lanbase.modules.res.entity.Res_BusinessRef">
        select a.*,b.title,b.resourceclass,b.datasources from RES_BUSINESSREF a left join RES_MAININFO b on a.REFRESOURCEID = b.RESOURCEID
        where 1 = 1 and b.RESOURCESTATUS = 0
        AND a.RESOURCEID = #{resourceid,jdbcType=DECIMAL}
        order by RESREFID desc
      </select>
 
    <select id="getResBusinesssRefList" parameterType="com.landtool.lanbase.modules.res.entity.Res_BusinessRef"
            resultType="com.landtool.lanbase.modules.res.entity.Res_BusinessRef">
        select a.* from RES_BUSINESSREF a left join RES_MAININFO b on a.REFRESOURCEID = b.RESOURCEID
        where 1 = 1 and b.RESOURCESTATUS = 0 and b.AuditStatus = 2
        AND a.RESOURCEID = #{resourceid,jdbcType=DECIMAL}
        order by RESREFID desc
    </select>
 
    <select id="selectCountByResourceid"  resultType="java.lang.Integer" parameterType="java.lang.Integer">
        select count(*) from RES_BUSINESSREF
        where resourceid = #{resourceid,jdbcType=DECIMAL}
    </select>
    <delete id="deleteByResourceid" parameterType="java.lang.Integer">
        delete from RES_BUSINESSREF
        where resourceid = #{resourceid,jdbcType=DECIMAL}
    </delete>
</mapper>