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