462 lines
20 KiB
XML
462 lines
20 KiB
XML
<?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.nis.web.dao.basics.DomainCommGroupDao">
|
|
<resultMap id="domainCommGroupCfgMap" type="com.nis.domain.basics.DomainCommCfg">
|
|
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
|
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
|
<result column="cfg_keywords" property="cfgKeywords" jdbcType="VARCHAR" />
|
|
<result column="action" property="action" jdbcType="INTEGER" />
|
|
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
|
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
|
|
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
|
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
|
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
|
|
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
|
|
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
|
|
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
|
|
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
|
|
<result column="request_id" property="requestId" jdbcType="INTEGER" />
|
|
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
|
|
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
|
|
<result column="classify" property="classify" jdbcType="VARCHAR" />
|
|
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
|
|
<result column="lable" property="lable" jdbcType="VARCHAR" />
|
|
<result column="expr_type" property="exprType" jdbcType="INTEGER" />
|
|
<result column="match_method" property="matchMethod" jdbcType="INTEGER" />
|
|
<result column="is_hexbin" property="isHexbin" jdbcType="INTEGER" />
|
|
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
|
|
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
|
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
|
|
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
|
<result column="ratelimit" property="ratelimit" jdbcType="VARCHAR" />
|
|
<result column="region_id" property="regionId" jdbcType="INTEGER" />
|
|
<result column="group_id" property="groupId" jdbcType="INTEGER" />
|
|
<result column="user_region1" property="userRegion1" jdbcType="VARCHAR" />
|
|
<result column="user_region2" property="userRegion2" jdbcType="VARCHAR" />
|
|
<result column="user_region3" property="userRegion3" jdbcType="VARCHAR" />
|
|
<result column="user_region4" property="userRegion4" jdbcType="VARCHAR" />
|
|
<result column="user_region5" property="userRegion5" jdbcType="VARCHAR" />
|
|
|
|
<result column="group_name" property="groupName" jdbcType="VARCHAR" />
|
|
</resultMap>
|
|
|
|
<sql id="columns">
|
|
r.cfg_id,r.cfg_desc,r.cfg_keywords,r.action,r.is_valid,r.is_audit,r.creator_id,
|
|
r.create_time,r.editor_id,r.edit_time,r.auditor_id,r.audit_time,r.service_id,
|
|
r.request_id,r.compile_id,r.is_area_effective,r.classify,r.attribute,r.lable,
|
|
r.expr_type,r.match_method,r.is_hexbin,r.area_effective_ids,r.function_id,
|
|
r.cfg_region_code,r.cfg_type,r.ratelimit, r.region_id, r.group_id,r.user_region1,r.user_region2,
|
|
r.user_region3,r.user_region4,r.user_region5
|
|
</sql>
|
|
|
|
<select id="findAllPageList" parameterType="com.nis.domain.basics.DomainCommCfg" resultMap="domainCommGroupCfgMap">
|
|
SELECT
|
|
<include refid="columns"></include>
|
|
<trim prefix="," prefixOverrides=",">
|
|
,s.name AS creator_name,e.name AS editor_name,u.name AS auditor_name,c.group_name
|
|
</trim>
|
|
FROM
|
|
domain_comm_cfg r
|
|
LEFT JOIN sys_user s ON r.creator_id = s.id
|
|
LEFT JOIN sys_user e ON r.editor_id = e.id
|
|
LEFT JOIN sys_user u ON r.auditor_id = u.id
|
|
LEFT JOIN policy_group_info c ON c.service_group_id=r.user_region3
|
|
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
|
<if test="page !=null and page.where != null and page.where != ''">
|
|
AND ${page.where}
|
|
</if>
|
|
<if test="cfgId != null">
|
|
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
|
</if>
|
|
<if test="cfgDesc != null and cfgDesc != ''">
|
|
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="cfgKeywords != null and cfgKeywords != ''">
|
|
AND r.cfg_keywords like concat(concat('%',#{cfgKeywords,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="cfgRegionCode != null">
|
|
AND r.CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="cfgType != null and cfgType != ''">
|
|
AND r.CFG_TYPE like concat(concat('%',#{cfgType,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="action != null">
|
|
AND r.ACTION=#{action,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="isValid != null">
|
|
AND r.IS_VALID=#{isValid,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="isValid == null">
|
|
AND r.IS_VALID != -1
|
|
</if>
|
|
<if test="isAudit != null">
|
|
AND r.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="creatorName != null and creatorName !=''">
|
|
AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="createTime != null and createTime !=''">
|
|
AND r.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
|
|
</if>
|
|
<if test="editorName != null and editorName !=''">
|
|
AND EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="editTime != null and editTime !='' ">
|
|
AND r.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
|
|
</if>
|
|
<if test="auditorName != null and auditorName !=''">
|
|
AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="auditTime != null and auditTime !=''">
|
|
AND r.AUDIT_TIME=#{auditTime,jdbcType=TIMESTAMP}
|
|
</if>
|
|
<if test="serviceId != null">
|
|
AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="requestId != null">
|
|
AND r.REQUEST_ID=#{requestId,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="isAreaEffective != null">
|
|
AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="classify != null and classify !=''">
|
|
AND r.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="attribute != null and attribute !=''">
|
|
AND r.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="lable != null and lable !=''">
|
|
AND r.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="areaEffectiveIds != null and areaEffectiveIds !=''">
|
|
AND r.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="functionId != null">
|
|
AND r.FUNCTION_ID=#{functionId,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="groupId != null">
|
|
AND r.group_id = #{groupId,jdbcType=INTEGER}
|
|
</if>
|
|
<!-- 数据范围过滤 -->
|
|
${sqlMap.dsf}
|
|
</trim>
|
|
<choose>
|
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
ORDER BY ${page.orderBy}
|
|
</when>
|
|
<otherwise>
|
|
ORDER BY r.is_audit,r.create_time desc
|
|
</otherwise>
|
|
</choose>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="findByPage" resultMap="domainCommGroupCfgMap">
|
|
SELECT
|
|
<include refid="columns"></include>
|
|
<trim prefix="," prefixOverrides=",">
|
|
,s.name AS creator_name,e.name AS editor_name,u.name AS auditor_name
|
|
</trim>
|
|
FROM
|
|
domain_comm_cfg r
|
|
LEFT JOIN sys_user s ON r.creator_id = s.id
|
|
LEFT JOIN sys_user e ON r.editor_id = e.id
|
|
LEFT JOIN sys_user u ON r.auditor_id = u.id
|
|
where r.CFG_ID in (${ids})
|
|
</select>
|
|
|
|
<select id="findInfoByCfgId" resultMap="domainCommGroupCfgMap">
|
|
SELECT
|
|
<include refid="columns"></include>
|
|
FROM
|
|
domain_comm_cfg r
|
|
where r.CFG_ID =#{cfgId}
|
|
|
|
</select>
|
|
|
|
<!-- 修改时检索 -->
|
|
<select id="get" resultMap="domainCommGroupCfgMap">
|
|
SELECT
|
|
<include refid="columns"></include>
|
|
FROM
|
|
domain_comm_cfg r
|
|
WHERE
|
|
r.cfg_id = #{ids} AND r.is_valid != -1
|
|
</select>
|
|
|
|
<select id="getCfgInfoByGroupIds" resultType="java.lang.Integer">
|
|
SELECT
|
|
COUNT(1)
|
|
FROM
|
|
domain_comm_cfg r
|
|
WHERE
|
|
r.group_id IN(${ids}) AND r.is_valid != -1
|
|
</select>
|
|
|
|
<insert id="insertCommGroupCfg" parameterType="com.nis.domain.basics.DomainCommCfg">
|
|
insert into domain_comm_cfg (
|
|
CFG_DESC,
|
|
cfg_keywords,
|
|
action,
|
|
is_valid,
|
|
is_audit,
|
|
creator_id,
|
|
create_time,
|
|
editor_id,
|
|
edit_time,
|
|
auditor_id,
|
|
audit_time,
|
|
service_id,
|
|
request_id,
|
|
compile_id,
|
|
IS_AREA_EFFECTIVE,
|
|
CLASSIFY,
|
|
ATTRIBUTE,
|
|
LABLE,
|
|
expr_type,
|
|
match_method,
|
|
is_hexbin,
|
|
area_effective_ids,
|
|
function_id,
|
|
cfg_region_code,
|
|
cfg_type,
|
|
ratelimit,
|
|
region_id,
|
|
group_id,
|
|
user_region1,
|
|
user_region2,
|
|
user_region3,
|
|
user_region4,
|
|
user_region5
|
|
)values (
|
|
#{cfgDesc,jdbcType=VARCHAR},
|
|
#{cfgKeywords,jdbcType=VARCHAR},
|
|
#{action,jdbcType=INTEGER},
|
|
#{isValid,jdbcType=INTEGER},
|
|
#{isAudit,jdbcType=INTEGER},
|
|
#{creatorId,jdbcType=INTEGER},
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
#{editorId,jdbcType=INTEGER},
|
|
#{editTime,jdbcType=TIMESTAMP},
|
|
#{auditorId,jdbcType=INTEGER},
|
|
#{auditTime,jdbcType=TIMESTAMP},
|
|
#{serviceId,jdbcType=INTEGER},
|
|
#{requestId,jdbcType=INTEGER},
|
|
#{compileId,jdbcType=INTEGER},
|
|
#{isAreaEffective,jdbcType=INTEGER},
|
|
#{classify,jdbcType=VARCHAR},
|
|
#{attribute,jdbcType=VARCHAR},
|
|
#{lable,jdbcType=VARCHAR},
|
|
#{exprType,jdbcType=INTEGER},
|
|
#{matchMethod,jdbcType=INTEGER},
|
|
#{isHexbin,jdbcType=INTEGER},
|
|
#{areaEffectiveIds,jdbcType=VARCHAR},
|
|
#{functionId,jdbcType=INTEGER},
|
|
#{cfgRegionCode,jdbcType=INTEGER},
|
|
#{cfgType,jdbcType=VARCHAR},
|
|
#{ratelimit,jdbcType=VARCHAR},
|
|
#{regionId,jdbcType=INTEGER},
|
|
#{groupId,jdbcType=INTEGER},
|
|
#{userRegion1,jdbcType=VARCHAR},
|
|
#{userRegion2,jdbcType=VARCHAR},
|
|
#{userRegion3,jdbcType=VARCHAR},
|
|
#{userRegion4,jdbcType=VARCHAR},
|
|
#{userRegion5,jdbcType=VARCHAR}
|
|
)
|
|
</insert>
|
|
|
|
<update id="update" parameterType="com.nis.domain.basics.DomainCommCfg" >
|
|
update domain_comm_cfg
|
|
<set >
|
|
<trim suffixOverrides=",">
|
|
<if test="cfgDesc != null and cfgDesc != ''" >
|
|
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="cfgKeywords != null and cfgKeywords != ''" >
|
|
cfg_keywords = #{cfgKeywords,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="action != null" >
|
|
action = #{action,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="isValid != null" >
|
|
is_valid = #{isValid,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="isAudit != null" >
|
|
is_audit = #{isAudit,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="editorId != null" >
|
|
editor_id = #{editorId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="editTime != null and editTime != ''" >
|
|
edit_time = #{editTime,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="auditorId != null" >
|
|
AUDITOR_ID = #{auditorId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="auditTime != null and auditTime != ''" >
|
|
AUDIT_TIME = #{auditTime,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="serviceId != null" >
|
|
service_id = #{serviceId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="requestId != null" >
|
|
request_id = #{requestId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="compileId != null and compileId != ''" >
|
|
compile_id = #{compileId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="isAreaEffective != null" >
|
|
is_area_effective = #{isAreaEffective,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="classify != null and classify != ''" >
|
|
classify = #{classify,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="attribute != null and attribute != ''" >
|
|
attribute = #{attribute,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="lable != null and lable != ''" >
|
|
lable = #{lable,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="exprType != null" >
|
|
expr_type = #{exprType,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="matchMethod != null" >
|
|
match_method = #{matchMethod,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="isHexbin != null" >
|
|
is_hexbin = #{isHexbin,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="areaEffectiveIds != null" >
|
|
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="functionId != null" >
|
|
function_id = #{functionId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="cfgType != null and cfgType != ''" >
|
|
cfg_type = #{cfgType,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="cfgRegionCode != null " >
|
|
cfg_region_code = #{cfgRegionCode,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="ratelimit != null and ratelimit != ''" >
|
|
ratelimit = #{ratelimit,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="groupId != null">
|
|
group_id = #{groupId,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="userRegion2 != null and userRegion2 != ''" >
|
|
user_region2 = #{userRegion2,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="userRegion3 != null and userRegion3 != ''" >
|
|
user_region3 = #{userRegion3,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="userRegion4 != null and userRegion4 != ''" >
|
|
user_region4 = #{userRegion4,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="userRegion5 != null and userRegion5 != ''" >
|
|
user_region5 = #{userRegion5,jdbcType=VARCHAR},
|
|
</if>
|
|
</trim>
|
|
</set>
|
|
<where>
|
|
and cfg_id = #{cfgId,jdbcType=INTEGER}
|
|
</where>
|
|
</update>
|
|
|
|
<delete id="delete" parameterType="java.lang.String" >
|
|
delete from domain_comm_cfg where cfg_id in (${ids})
|
|
</delete>
|
|
|
|
<select id="getByIds" resultMap="domainCommGroupCfgMap">
|
|
select
|
|
<include refid="columns"></include>
|
|
from domain_comm_cfg r
|
|
where r.cfg_id in (${ids}) and is_valid !=-1
|
|
</select>
|
|
|
|
<select id="getGroupIdCount" parameterType="java.lang.String" resultType="java.lang.Integer">
|
|
SELECT COUNT(cfg_id) groupCount from domain_comm_cfg
|
|
WHERE user_region3= #{groupId}
|
|
and is_valid=1
|
|
</select>
|
|
<select id="findAllList" parameterType="com.nis.domain.basics.DomainCommCfg" resultMap="domainCommGroupCfgMap">
|
|
SELECT
|
|
<include refid="columns"></include>
|
|
FROM
|
|
domain_comm_cfg r
|
|
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
|
<if test="cfgId != null">
|
|
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
|
</if>
|
|
<if test="cfgDesc != null and cfgDesc != ''">
|
|
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="cfgKeywords != null and cfgKeywords != ''">
|
|
AND r.cfg_keywords like concat(concat('%',#{cfgKeywords,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="cfgRegionCode != null">
|
|
AND r.CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="cfgType != null and cfgType != ''">
|
|
AND r.CFG_TYPE like concat(concat('%',#{cfgType,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="action != null">
|
|
AND r.ACTION=#{action,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="isValid != null">
|
|
AND r.IS_VALID=#{isValid,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="isValid == null">
|
|
AND r.IS_VALID != -1
|
|
</if>
|
|
<if test="isAudit != null">
|
|
AND r.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="createTime != null and createTime !=''">
|
|
AND r.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
|
|
</if>
|
|
<if test="editTime != null and editTime !='' ">
|
|
AND r.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
|
|
</if>
|
|
<if test="auditTime != null and auditTime !=''">
|
|
AND r.AUDIT_TIME=#{auditTime,jdbcType=TIMESTAMP}
|
|
</if>
|
|
<if test="serviceId != null">
|
|
AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="requestId != null">
|
|
AND r.REQUEST_ID=#{requestId,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="isAreaEffective != null">
|
|
AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="classify != null and classify !=''">
|
|
AND r.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="attribute != null and attribute !=''">
|
|
AND r.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="lable != null and lable !=''">
|
|
AND r.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="areaEffectiveIds != null and areaEffectiveIds !=''">
|
|
AND r.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="functionId != null">
|
|
AND r.FUNCTION_ID=#{functionId,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="groupId != null">
|
|
AND r.group_id = #{groupId,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="commonGroupIds != null">
|
|
AND r.group_id in(${commonGroupIds})
|
|
</if>
|
|
<!-- 数据范围过滤 -->
|
|
${sqlMap.dsf}
|
|
</trim>
|
|
|
|
</select>
|
|
</mapper>
|