<?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>
|