feat: 添加slrs业务子项目 修改问题文件

This commit is contained in:
super_liu
2021-05-31 17:18:43 +08:00
parent dd50eaebf4
commit 230889c3ff
92 changed files with 6765 additions and 31 deletions
@@ -373,4 +373,10 @@
</where>
</update>
<update id="deleteByResId" parameterType="java.lang.String">
update TS_PERSON_COLLECT
set valid_flag=1
where collect_res_id = #{resId}
</update>
</mapper>
@@ -240,4 +240,10 @@
</if>
</where>
</update>
<update id="deleteByResId" parameterType="java.lang.String">
update TS_PERSON_SHARE
set valid_flag=1
where res_id = #{resId}
</update>
</mapper>
@@ -0,0 +1,582 @@
<?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.adc.da.sys.dao.DicTypeEODao">
<!-- Result Map -->
<resultMap id="BaseResultMap" type="com.adc.da.sys.entity.DicTypeEO">
<id column="id" property="id"/>
<result column="dic_type_code" property="dicTypeCode"/>
<result column="dic_type_name" property="dicTypeName"/>
<result column="parent_id" property="parentId"/>
<result column="dic_id" property="dicId"/>
<result column="valid_flag" property="validFlag"/>
<result column="creation_time" property="creationTime"/>
<result column="modify_time" property="modifyTime"/>
<result column="show_index" property="showIndex"/>
<result column="tree_pid" property="treePid" />
<result column="others" property="others" />
<result column="creation_user" property="creationUser" />
<result column="describes" property="describes" />
</resultMap>
<!-- TS_DICTYPE table all fields -->
<sql id="Base_Column_List">
creation_time, modify_time,id,parent_id, dic_type_code, dic_type_name, dic_id,valid_flag,show_index, tree_pid, others, creation_user, describes
</sql>
<!--分页显示A-->
<sql id="Base_Column_ListPageA">
TS_DICTYPE.id,TS_DICTYPE.parent_id, TS_DICTYPE.dic_type_code, TS_DICTYPE.dic_type_name, TS_DICTYPE.dic_id,
TS_DICTYPE.valid_flag,TS_DICTYPE.creation_time,TS_DICTYPE.modify_time,TS_DICTYPE.describes,TS_DICTYPE.show_index,tree_pid
</sql>
<!--分页显示B-->
<sql id="Base_Column_ListPageB">
a.id,a.parent_id, a.dic_type_code, a.dic_type_name, a.dic_id,a.valid_flag,a.creation_time,a.modify_time,a.describes,a.show_index
</sql>
<sql id="Dic_Type_List">
u.*, ur.id as type_id,
ur.dic_type_code as dic_type_code,
ur.dic_type_name as dic_type_name,
ur.dic_id as dic_id,
ur.parent_id as parent_id,
ur.valid_flag as type_valid_flag
</sql>
<!-- 查询条件 -->
<sql id="Base_Where_Clause">
where valid_flag = 0
<trim suffixOverrides=",">
<if test="id != null">
and id ${idOperator} #{id}
</if>
<if test="dicId != null">
and dic_id ${dicIdOperator} #{dicId}
</if>
<if test="dicTypeName != null">
and dic_type_name ${dicTypeNameOperator} concat(concat('%',#{dicTypeName}),'%')
</if>
<if test="dicTypeCode != null">
and dic_type_code ${dicTypeCodeOperator} concat(concat('%',#{dicTypeCode}),'%')
</if>
<if test="validFlag != null">
and valid_flag ${validFlagOperator} #{validFlag}
</if>
<if test="parentId != null">
and parent_id ${parentIdOperator} #{parentId}
</if>
</trim>
</sql>
<sql id="Second_Where_Clause">
where valid_flag = 0
<trim suffixOverrides=",">
<if test="id != null">
and id ${idOperator} #{id}
</if>
<if test="dicId != null">
and dic_id ${dicIdOperator} #{dicId}
</if>
<if test="dicTypeName != null">
and dic_type_name = #{dicTypeName}
</if>
<if test="dicTypeCode != null">
and dic_type_code = #{dicTypeCode}
</if>
<if test="validFlag != null">
and valid_flag ${validFlagOperator} #{validFlag}
</if>
<if test="parentId != null">
and parent_id ${parentIdOperator} #{parentId}
</if>
</trim>
</sql>
<!--liwenxuan:分页判断条件-->
<sql id="Base_Where_ClausePage">
where TS_DICTYPE.valid_flag = 0
<trim suffixOverrides=",">
<if test="dicId != null">
and TS_DICTYPE.dic_id ${dicIdOperator} #{dicId}
</if>
<if test="dicTypeName != null">
and TS_DICTYPE.dic_type_name ${dicTypeNameOperator} concat(concat('%',#{dicTypeName}),'%')
</if>
<if test="dicTypeCode != null">
and TS_DICTYPE.dic_type_code ${dicTypeCodeOperator} concat(concat('%',#{dicTypeCode}),'%')
</if>
<if test="id != null">
and TS_DICTYPE.parent_id = #{id}
</if>
<if test="describes != null">
and TS_DICTYPE.DESCRIBES = #{describes}
</if>
</trim>
</sql>
<!--liwenxuan:国家和地区分页判断条件-->
<sql id="Base_Where_ClausePageNoParentId">
where TS_DICTYPE.valid_flag = 0
<trim suffixOverrides=",">
<if test="id != null">
and TS_DICTYPE.id ${idOperator} #{id}
</if>
<if test="dicId != null">
and TS_DICTYPE.dic_id ${dicIdOperator} #{dicId}
</if>
<if test="dicTypeName != null">
and TS_DICTYPE.dic_type_name ${dicTypeNameOperator} concat(concat('%',#{dicTypeName}),'%')
</if>
<if test="dicTypeCode != null">
and TS_DICTYPE.dic_type_code ${dicTypeCodeOperator} concat(concat('%',#{dicTypeCode}),'%')
</if>
<if test="describes != null">
and TS_DICTYPE.DESCRIBES = #{describes}
</if>
AND TS_DICTYPE.parent_id IS NULL
</trim>
</sql>
<!--对修改做了判断-->
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.sys.entity.DicTypeEO">
update TS_DICTYPE
<set>
<if test="dicTypeCode != null">
dic_type_code = #{dicTypeCode},
</if>
<if test="dicTypeName != null">
dic_type_name = #{dicTypeName},
</if>
<if test="dicId != null">
dic_id = #{dicId},
</if>
<if test="validFlag != null">
valid_flag = #{validFlag},
</if>
<if test="parentId != null">
parent_id = #{parentId},
</if>
<if test="modifyTime != null">
modify_Time = #{modifyTime},
</if>
<if test="describes != null">
DESCRIBES = #{describes},
</if>
<if test="treePid != null" >
tree_pid = #{treePid},
</if>
<if test="others != null" >
others = #{others},
</if>
<if test="creationUser != null" >
creation_user = #{creationUser},
</if>
<if test="showIndex != null">
SHOW_INDEX = #{showIndex}
</if>
</set>
where id = #{id}
</update>
<!--李文轩:删除多条数据-->
<update id="deleteDicTypeByIdInBatch" parameterType="java.util.List">
update TS_DICTYPE
SET valid_flag = 1
where id in
<foreach item="id" collection="list" open="(" separator=","
close=")" index="index">
#{id}
</foreach>
</update>
<select id="getDicTypeEOById" resultMap="BaseResultMap"
parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from TS_DICTYPE
where id = #{id}
</select>
<select id="getDicTypeEOByDicTypeCode" resultMap="BaseResultMap"
parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from TS_DICTYPE
where 1=1
<if test="dicTypeCode !=null">
and dic_type_code = #{dicTypeCode}
</if>
<!--<if test="dicId !=null">
DIC_ID = #{dicId} AND
</if>-->
AND valid_flag = 0
<if test="id !=null">
AND id != #{id}
</if>
<if test="parentId !=null">
AND parent_id = #{parentId}
</if>
</select>
<!--liwenxuan:企业大类:查询选项和数据编码 企业大类和企业细类dicId:WEWXFSYUJBNG\FGFBTYGHGHMB-->
<select id="getDicTypeEOTypeNameAndCode" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from TS_DICTYPE
where DIC_TYPE_NAME = #{dicTypeName} AND valid_flag = 0 AND (DIC_ID = 'WEWXFSYUJBNG' or DIC_ID = 'FGFBTYGHGHMB' )
<if test="parentId !=null">
AND parent_id = #{parentId}
</if>
<if test="id !=null">
AND id != #{id}
</if>
</select>
<!--liwenxuan:复制上面的,用来判断企业大类里面的新增是否相同 dicId:WEWXFSYUJBNG-->
<select id="getDicTypeEOTypeNameAndCode1" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from TS_DICTYPE
where DIC_TYPE_NAME = #{dicTypeName}AND valid_flag = 0 AND (DIC_ID = 'WEWXFSYUJBNG' or DIC_ID = 'FGFBTYGHGHMB' )
AND parent_id is null
<if test="id !=null">
AND id != #{id}
</if>
</select>
<insert id="insertSelective" parameterType="com.adc.da.sys.entity.DicTypeEO">
insert into TS_DICTYPE
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">ID,</if>
<if test="parentId != null">parent_id,</if>
<if test="validFlag != null">valid_flag,</if>
<if test="dicId != null">DIC_ID,</if>
<if test="dicTypeName != null">DIC_TYPE_NAME,</if>
<if test="dicTypeCode != null">DIC_TYPE_CODE,</if>
<if test="creationTime != null">creation_Time,</if>
<if test="modifyTime != null">modify_Time,</if>
<if test="describes != null">DESCRIBES,</if>
<if test="showIndex != null">show_index,</if>
<if test="treePid != null" >tree_pid,</if>
<if test="others != null" >others,</if>
<if test="creationUser != null" >creation_user,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="parentId != null">#{parentId},</if>
<if test="validFlag != null">#{validFlag},</if>
<if test="dicId != null">#{dicId},</if>
<if test="dicTypeName != null">#{dicTypeName},</if>
<if test="dicTypeCode != null">#{dicTypeCode},</if>
<if test="creationTime != null">#{creationTime},</if>
<if test="modifyTime != null">#{modifyTime},</if>
<if test="describes != null">#{describes},</if>
<if test="showIndex != null">#{showIndex},</if>
<if test="treePid != null" >#{treePid, jdbcType=VARCHAR},</if>
<if test="others != null" >#{others, jdbcType=VARCHAR},</if>
<if test="creationUser != null" >#{creationUser, jdbcType=VARCHAR},</if>
</trim>
</insert>
<!-- liwenxuan:国家地区TS_DICTYPE 列表总数 -->
<select id="queryByCountCounter" resultType="java.lang.Integer"
parameterType="com.adc.da.base.page.BasePage">
select count(distinct u0.id) from TS_DICTYPE u0
<include refid="Base_Where_Clause"/>
and u0.valid_flag != 1
and u0.parent_id IS NULL
</select>
<!-- 查询TS_DICTYPE列表 -->
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select
<include refid="Base_Column_ListPageB"/>
from
(select tmp_tb.* , rownum rn from
(select
<include refid="Base_Column_ListPageA"/>
from TS_DICTYPE
LEFT JOIN TS_DICTIONARY td ON td.id = TS_DICTYPE.dic_id
<include refid="Base_Where_ClausePage"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''">
${pager.orderCondition}
</if>
) tmp_tb where rownum &lt;= ${pager.endIndex}) a
where rn &gt;= ${pager.startIndex}
ORDER BY a.show_index
</select>
<!-- TS_DICTYPE 列表总数 -->
<select id="queryByCount" resultType="java.lang.Integer"
parameterType="com.adc.da.base.page.BasePage">
select count(distinct TS_DICTYPE.id) from TS_DICTYPE
LEFT JOIN TS_DICTIONARY td ON td.id = TS_DICTYPE.dic_id
<include refid="Base_Where_ClausePage"/>
</select>
<!-- liwenxuan:国家和地区查询TS_DICTYPE列表 -->
<select id="queryByPageNoParentId" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select
<include refid="Base_Column_ListPageB"/>
from
(select tmp_tb.* , rownum rn from
(select
<include refid="Base_Column_ListPageA"/>
from TS_DICTYPE
LEFT JOIN TS_DICTIONARY td ON td.id = TS_DICTYPE.dic_id
<include refid="Base_Where_ClausePageNoParentId"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''">
${pager.orderCondition}
</if>
) tmp_tb where rownum &lt;= ${pager.endIndex}) a
where rn &gt;= ${pager.startIndex}
</select>
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select
<include refid="Base_Column_List"/>
from TS_DICTYPE
<include refid="Second_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''">
${pager.orderCondition}
</if>
</select>
<select id="getTypeIdByDicIdAndTypeName" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from TS_DICTYPE
where
<if test="typeName !=null">
DIC_TYPE_NAME = #{typeName} AND
</if>
<if test="dicId !=null">
DIC_ID = #{dicId} AND
</if>
valid_flag = 0
<if test="id!=null and id != ''">
AND id != #{id}
</if>
<if test="parentId !=null and parentId != ''">
AND parent_id = #{parentId}
</if>
<if test="parentId == null">
AND parent_id is null
</if>
</select>
<insert id="batchInsertTypeEo">
INSERT INTO TS_DICTYPE ("ID","parent_id","valid_flag", "DIC_ID", "DIC_TYPE_NAME")
VALUES
<foreach collection="ModelType" item="eo" separator=",">
(#{eo.id},#{eo.parentId},#{eo.validFlag},#{eo.dicId},#{eo.dicTypeName})
</foreach>
</insert>
<update id="deleteDicTypeByDicId" parameterType="java.lang.String">
update TS_DICTYPE
set valid_flag = 1
where ID = #{id}
</update>
<!--李文轩:这是删除一条数据和上面的写重复了-->
<!--<update id="deleteFlagTo1" parameterType="java.lang.String">
update TS_DICTYPE
set valid_flag = 1
where id = #{id}
</update>-->
<!--create by yangxuenan-->
<select id="getDicTypeByDicCode" parameterType="java.lang.String" resultMap="BaseResultMap">
select
dt.id,dt.parent_id,dt.dic_type_code,dt.dic_type_name,dt.dic_id
from TS_DICTIONARY dn LEFT JOIN TS_DICTYPE dt ON dn.ID = dt.DIC_ID
where dictionary_code = #{dictionaryCode} AND dn.VALID_FLAG = 0 AND dt.VALID_FLAG = 0
AND dt.parent_id is NULL
order by show_index asc
</select>
<select id="getFineDicTypeByDicCode" parameterType="java.lang.String" resultMap="BaseResultMap">
select
dt.id,dt.parent_id,dt.dic_type_code,dt.dic_type_name,dt.dic_id
from TS_DICTIONARY dn LEFT JOIN TS_DICTYPE dt ON dn.ID = dt.DIC_ID
where dictionary_code = #{dictionaryCode} AND dn.VALID_FLAG = 0 AND dt.VALID_FLAG = 0
order by show_index asc
</select>
<select id="getDicTypeByParentCode" parameterType="java.lang.String" resultMap="BaseResultMap">
select * from TS_DICTYPE
where PARENT_ID = (select id from TS_DICTYPE
where DIC_TYPE_CODE=#{value}
and VALID_FLAG=0)
and VALID_FLAG=0
order by show_index asc
</select>
<select id="getDicTypeByDicTypeName" parameterType="com.adc.da.sys.entity.DicTypeEO" resultMap="BaseResultMap">
select TS_DICTYPE.*
from TS_DICTYPE
left join TS_DICTIONARY on TS_DICTYPE.DIC_ID = TS_DICTIONARY.ID
where TS_DICTYPE.VALID_FLAG = 0
<if test="dicTypeName !=null">
and TS_DICTYPE.DIC_TYPE_NAME=#{dicTypeName}
</if>
and TS_DICTIONARY.DICTIONARY_CODE=#{dicTypeCode}
<if test="businessParentId !=null">
and TS_DICTYPE.PARENT_ID=#{businessParentId,jdbcType=VARCHAR}
</if>
</select>
<!--标准法规属性管理中删除之前查看其它地方是否引用-->
<select id="getDicTypeByDicTypeCode" parameterType="java.lang.String" resultType="java.lang.Integer">
select count(*) from SAR_STANDARDS_INFO
WHERE
(SAR_STANDARDS_INFO.COUNTRY = #{dicTypeCode} or
SAR_STANDARDS_INFO.STAND_SORT = #{dicTypeCode} or
SAR_STANDARDS_INFO.STAND_STATE = #{dicTypeCode} or
SAR_STANDARDS_INFO.STAND_NATURE = #{dicTypeCode})
AND SAR_STANDARDS_INFO.VALID_FLAG=0
union
select count(*) from SAR_STAND_VAL
where SAR_STAND_VAL.PROPERTY_VAL = #{dicTypeCode}
AND SAR_STAND_VAL.VALID_FLAG =0
union
select count(*) from SAR_STAND_ITEM_VAL
where SAR_STAND_ITEM_VAL.PROPERTY_VAL = #{dicTypeCode}
AND SAR_STAND_ITEM_VAL.VALID_FLAG =0
union
select count(*) from SAR_LAWS_INFO
where (SAR_LAWS_INFO.COUNTRY = #{dicTypeCode} or
SAR_LAWS_INFO.LAWS_PROPERTY = #{dicTypeCode} or
SAR_LAWS_INFO.LAWS_STATE = #{dicTypeCode})
AND SAR_LAWS_INFO.VALID_FLAG =0
union
select count(*) from SAR_LAWS_VAL
where SAR_LAWS_VAL.PROPERTY_VAL = #{dicTypeCode}
AND SAR_LAWS_VAL.VALID_FLAG =0
union
select count(*) from SAR_LAWS_ITEM_VAL
where SAR_LAWS_ITEM_VAL.PROPERTY_VAL = #{dicTypeCode}
AND SAR_LAWS_ITEM_VAL.VALID_FLAG =0
union
select count(*) from SAR_BUSSIONESS_STAND
where (SAR_BUSSIONESS_STAND.STAND_GENERA = #{dicTypeCode} or
SAR_BUSSIONESS_STAND.STAND_SUBCLASS = #{dicTypeCode} or
SAR_BUSSIONESS_STAND.STAND_STATUS = #{dicTypeCode} or
SAR_BUSSIONESS_STAND.STAND_SORT = #{dicTypeCode})
and SAR_BUSSIONESS_STAND.VALID_FLAG =0
union
select count(*) from SAR_BUSS_STAND_VAL
where SAR_BUSS_STAND_VAL.PROPERTY_VALUE = #{dicTypeCode}
and SAR_BUSS_STAND_VAL.VALID_FLAG =0
union
select count(*) from SAR_BUSS_STAND_ITEM_VAL
where SAR_BUSS_STAND_ITEM_VAL.PROPERTY_VALUE = #{dicTypeCode}
and SAR_BUSS_STAND_ITEM_VAL.VALID_FLAG =0
union
select count(*) from SAR_BUS_SAR_COMPILE
where (SAR_BUS_SAR_COMPILE.BUS_STAND_CLASSIFY = #{dicTypeCode} or
SAR_BUS_SAR_COMPILE.BUS_STAND_SUBCLASS = #{dicTypeCode})
and SAR_BUS_SAR_COMPILE.VALID_FLAG =0
union
select count(*) from SAR_SAR_ACCESS
where SAR_SAR_ACCESS.COUNTRY = #{dicTypeCode}
and SAR_SAR_ACCESS.VALID_FLAG =0
union
select count(*) from SAR_TEST_ITEM_VAL
where SAR_TEST_ITEM_VAL.PROPERTY_VALUE = #{dicTypeCode}
and SAR_TEST_ITEM_VAL.VALID_FLAG =0
union
select count(*) from SAR_PRODUCT_VAL
where SAR_PRODUCT_VAL.PROPERTY_VALUE = #{dicTypeCode}
and SAR_PRODUCT_VAL.VALID_FLAG =0
</select>
<select id="getDicEOByDicTypeCode" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from TS_DICTYPE
where 1=1
<if test="_parameter !=null">
and DIC_TYPE_CODE=#{_parameter,jdbcType=VARCHAR}
</if>
AND valid_flag = 0
</select>
<select id="getDicEOByDicTypeCodeParent" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from TS_DICTYPE
where 1=1
<if test="_parameter !=null">
and DIC_TYPE_CODE=#{_parameter,jdbcType=VARCHAR}
</if>
and parent_id is null
AND valid_flag = 0
</select>
<delete id="deleteByDicIdAndDicTypeCode" parameterType="com.adc.da.sys.entity.DicTypeEO">
delete from TS_DICTYPE
where PARENT_ID is not null and DIC_TYPE_CODE = #{dicTypeCode}
</delete>
<update id="updateByDicTypeCode" parameterType="com.adc.da.sys.entity.DicTypeEO">
update TS_DICTYPE
<set>
<if test="dicTypeName != null">
dic_type_name = #{dicTypeName},
</if>
<if test="validFlag != null">
valid_flag = #{validFlag},
</if>
</set>
where DIC_TYPE_CODE = #{dicTypeCode} and parent_id is not null
</update>
<select id="judgeHaveUse" parameterType="java.lang.String" resultType="java.lang.Integer">
select count(*) from SAR_STANDARDS_INFO
WHERE
SAR_STANDARDS_INFO.valid_flag=0 and
SAR_STANDARDS_INFO.COUNTRY = #{countryCode} and
SAR_STANDARDS_INFO.STAND_SORT = #{sortCode}
</select>
<update id="deleteDicTypeByCodeAndParentid" parameterType="java.util.List">
update TS_DICTYPE
set valid_flag = 1
where DIC_TYPE_CODE in
<foreach item="code" collection="list" open="(" separator=","
close=")" index="index">
#{code}
</foreach>
and PARENT_ID IS not null
</update>
<update id="deleteByDictionaryId" parameterType="java.lang.String">
delete from TS_DICTYPE
where dic_id = #{dicId}
</update>
<select id="getDicTypeByDicId" parameterType="java.lang.String" resultType="com.adc.da.sys.common.SelectionResult">
select
dic_type_code as value,dic_type_name as label
from TS_DICTYPE
where dic_id = #{dicId} AND VALID_FLAG = 0
AND parent_id is NULL
order by show_index asc
</select>
<select id="getDicNamesByCodes" parameterType="java.util.List" resultType="java.lang.String">
SELECT
listagg ( TS_DICTYPE.DIC_TYPE_NAME, ',' ) within GROUP ( ORDER BY TS_DICTYPE.SHOW_INDEX )
FROM
TS_DICTYPE
WHERE
TS_DICTYPE.VALID_FLAG=0 and PARENT_ID is null and DIC_TYPE_CODE in
<foreach collection="codeList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>
@@ -0,0 +1,305 @@
<?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.adc.da.sys.dao.DicEODao">
<!-- Result Map -->
<resultMap id="BaseResultMap" type="com.adc.da.sys.entity.DictionaryEO">
<id column="id" property="id" />
<result column="dictionary_code" property="dictionaryCode" />
<result column="dictionary_name" property="dictionaryName" />
<result column="order_num" property="orderNum" />
<result column="enable" property="enable" />
<result column="diction_type" property="dictionType" />
<result column="is_relate" property="isRelate" />
<result column="relate_dic_id" property="relateDicId" />
<result column="creation_user" property="creationUser" />
<result column="valid_flag" property="validFlag" />
<result column="creation_time" property="creationTime" />
<result column="modify_time" property="modifyTime" />
</resultMap>
<!-- TS_DICTIONARY table all fields -->
<sql id="Base_Column_List">
modify_time, creation_time, valid_flag, dictionary_name, dictionary_code, id, order_num, enable, diction_type,
is_relate,relate_dic_id,creation_user
</sql>
<resultMap id="DicTypeMap" extends="BaseResultMap" type="com.adc.da.sys.entity.DictionaryEO">
<collection property="dicTypeEOList" ofType="com.adc.da.sys.entity.DicTypeEO">
<id column="type_id" property="id" />
<result column="dic_type_code" property="dicTypeCode" />
<result column="dic_type_name" property="dicTypeName" />
<result column="dic_id" property="dicId" />
<result column="parent_id" property="parentId" />
<result column="type_valid_flag" property="validFlag" />
</collection>
</resultMap>
<!--gaoyan -->
<resultMap id="ListMap" type="com.adc.da.sys.entity.DictionaryEO">
<id column="id" property="id" />
<result column="dictionary_code" property="dictionaryCode" />
<result column="dictionary_name" property="dictionaryName" />
<result column="valid_flag" property="validFlag" />
<result column="creation_time" property="creationTime" />
<result column="modify_time" property="modifyTime" />
</resultMap>
<sql id="Dic_Type_List">
u.*, ur.id as type_id,
ur.dic_type_code as dic_type_code,
ur.dic_type_name as dic_type_name,
ur.dic_id as dic_id,
ur.parent_id as parent_id,
ur.valid_flag as type_valid_flag
</sql>
<!-- 查询条件 -->
<sql id="Base_Where_Clause">
where 1=1 and u0.valid_flag='0'
<trim suffixOverrides=",">
<if test="id != null and id != ''">
and u0.id ${idOperator} #{id}
</if>
<if test="dictionaryCode != null and dictionaryCode != ''">
and u0.dictionary_code ${dictionaryCodeOperator} '%${dictionaryCode}%'
</if>
<if test="dictionaryName != null and dictionaryName != ''">
and u0.dictionary_name ${dictionaryNameOperator} '%${dictionaryName}%'
</if>
<if test="validFlag != null" >
and u0.valid_flag ${validFlagOperator} #{validFlag}
</if>
<if test="modifyTime != null" >
and u0.modify_time ${modifyTimeOperator} #{modifyTime}
</if>
<if test="modifyTime1 != null" >
and u0.modify_time &gt;= #{modifyTime1}
</if>
<if test="modifyTime2 != null" >
and u0.modify_time &lt;= #{modifyTime2}
</if>
<if test="creationTime != null" >
and u0.creation_time ${creationTimeOperator} #{creationTime}
</if>
<if test="creationTime1 != null" >
and u0.creation_time &gt;= #{creationTime1}
</if>
<if test="creationTime2 != null" >
and u0.creation_time &lt;= #{creationTime2}
</if>
</trim>
</sql>
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.sys.entity.DictionaryEO" >
update TS_DICTIONARY
<set >
<if test="validFlag != null" >
valid_flag = #{validFlag},
</if>
<if test="creationTime != null" >
creation_time = #{creationTime},
</if>
<if test="modifyTime != null" >
modify_time = #{modifyTime},
</if>
<if test="dictionaryCode != null" >
dictionary_code = #{dictionaryCode},
</if>
<if test="dictionaryName != null" >
dictionary_name = #{dictionaryName},
</if>
<if test="orderNum != null" >
order_num = #{orderNum},
</if>
<if test="enable != null" >
enable = #{enable},
</if>
<if test="dictionType != null" >
diction_type = #{dictionType},
</if>
<if test="isRelate != null" >
is_relate = #{isRelate},
</if>
<if test="relateDicId != null" >
relate_dic_id = #{relateDicId},
</if>
<if test="creationUser != null" >
creation_user = #{creationUser},
</if>
</set>
where id = #{id}
</update>
<select id="getDictionaryEOById" resultMap="BaseResultMap"
parameterType="java.lang.String">
select
<include refid="Base_Column_List" />
from TS_DICTIONARY
where id = #{id}
</select>
<select id="getDictionaryEOByDicCode" resultMap="BaseResultMap"
parameterType="java.lang.String">
select
<include refid="Base_Column_List" />
from TS_DICTIONARY
where dictionary_code = #{dictionaryCode} AND valid_flag = 0
</select>
<!--杜云宝: 根据字典代码查询其详情(俩表)-->
<select id="getDicEOAndTypeEoByDicCode" resultMap="DicTypeMap"
parameterType="java.lang.String">
select
<include refid="Dic_Type_List" />
from TS_DICTIONARY u LEFT JOIN TS_DICTYPE ur ON u.ID = ur.DIC_ID
where dictionary_code = #{dictionaryCode} AND u.valid_flag = 0 AND ur.valid_flag = 0
</select>
<select id="getDictionaryEOByDicName" resultMap="BaseResultMap"
parameterType="java.lang.String">
select
<include refid="Base_Column_List" />
from TS_DICTIONARY
where dictionary_name = #{dictionaryName}
</select>
<insert id="insertSelective" parameterType="com.adc.da.sys.entity.DictionaryEO" >
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
SELECT SEQ_TS_DICTIONARY.NEXTVAL FROM DUAL
</selectKey> -->
insert into TS_DICTIONARY
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="validFlag != null" >valid_flag,</if>
<if test="creationTime != null" >creation_time,</if>
<if test="modifyTime != null" >modify_time,</if>
<if test="id != null" >id,</if>
<if test="dictionaryCode != null" >dictionary_code,</if>
<if test="dictionaryName != null" >dictionary_name,</if>
<if test="orderNum != null" >order_num,</if>
<if test="enable != null" >enable,</if>
<if test="dictionType != null" >diction_type,</if>
<if test="isRelate != null" >is_relate,</if>
<if test="relateDicId != null" >relate_dic_id,</if>
<if test="creationUser != null" >creation_user,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="validFlag != null" >#{validFlag, jdbcType=VARCHAR},</if>
<if test="creationTime != null" >#{creationTime, jdbcType=TIMESTAMP},</if>
<if test="modifyTime != null" >#{modifyTime, jdbcType=TIMESTAMP},</if>
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
<if test="dictionaryCode != null" >#{dictionaryCode, jdbcType=VARCHAR},</if>
<if test="dictionaryName != null" >#{dictionaryName, jdbcType=VARCHAR},</if>
<if test="orderNum != null" >#{orderNum, jdbcType=INTEGER},</if>
<if test="enable != null" >#{enable, jdbcType=VARCHAR},</if>
<if test="dictionType != null" >#{dictionType, jdbcType=VARCHAR},</if>
<if test="isRelate != null" >#{isRelate, jdbcType=VARCHAR},</if>
<if test="relateDicId != null" >#{relateDicId, jdbcType=VARCHAR},</if>
<if test="creationUser != null" >#{creationUser, jdbcType=VARCHAR},</if>
</trim>
</insert>
<!-- 删除记录 -->
<update id="deleteDic" parameterType="java.lang.String">
update TS_DICTIONARY
set valid_flag = 1
where id = #{id}
</update>
<!-- TS_DICTIONARY 列表总数 -->
<select id="queryByCount" resultType="java.lang.Integer"
parameterType="com.adc.da.base.page.BasePage">
select count(distinct u0.id) from TS_DICTIONARY u0
left join TS_DICTYPE ur0 on u0.id = ur0.dic_id
<include refid="Base_Where_Clause" />
and u0.valid_flag != 1
</select>
<select id="queryByPage" resultMap="DicTypeMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Dic_Type_List" /> from
(select tmp_tb.* , rownum rn from
(select distinct u0.* from TS_DICTIONARY u0
left join TS_DICTYPE ur0 on u0.id = ur0.dic_id
<include refid="Base_Where_Clause"/>
and u0.valid_flag != 1
order by order_num,u0.id
) tmp_tb where rownum &lt;= ${pager.endIndex}) u
left join TS_DICTYPE ur on u.id = ur.dic_id
where rn &gt;= ${pager.startIndex}
</select>
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List"/> from TS_USER
<include refid="Base_Where_Clause"/>
order by order_num,id
</select>
<select id="getDictionaryEO" parameterType="java.lang.String" resultMap="ListMap">
select
*
from TS_DICTIONARY dn
where dn.VALID_FLAG = 0
</select>
<select id="countByCodeOrName" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
select count(1) from TS_DICTIONARY
where valid_flag='0'
<if test="dictionaryCode != null" >
and dictionary_code = #{dictionaryCode}
</if>
<if test="dictionaryName != null" >
and dictionary_name = #{dictionaryName}
</if>
<if test="notId != null" >
and id != #{notId}
</if>
</select>
<!-- TS_DICTIONARY 列表总数-->
<select id="queryAllDicByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
select count(1) from TS_DICTIONARY u0
<include refid="Base_Where_Clause"/>
</select>
<!-- 查询TS_DICTIONARY列表 -->
<select id="queryAllDicByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List" /> from
(select tmp_tb.* , rownum rn from
(select <include refid="Base_Column_List" /> from TS_DICTIONARY u0
<include refid="Base_Where_Clause"/>
order by order_num,u0.id
) tmp_tb where rownum &lt;= ${pager.endIndex})
where rn &gt;= ${pager.startIndex}
</select>
<select id="getDictionarySelList" parameterType="java.lang.String" resultType="com.adc.da.sys.common.SelectionResult">
select ID as value,DICTIONARY_NAME as label
from TS_DICTIONARY
where VALID_FLAG = '0'
<if test="id != null" >
and id != #{id}
</if>
order by order_num,id
</select>
<select id="getDictionaryCodeSelList" parameterType="java.lang.String" resultType="com.adc.da.sys.common.SelectionResult">
select dictionary_code as value,DICTIONARY_NAME as label
from TS_DICTIONARY
where VALID_FLAG = '0'
<if test="id != null" >
and id != #{id}
</if>
order by order_num,id
</select>
<select id="queryUseByCount" resultType="java.lang.Integer"
parameterType="java.lang.String">
select count(*) from SAR_STAND_ATTR_DETAILS
left join TS_DICTIONARY on TS_DICTIONARY.dictionary_code=SAR_STAND_ATTR_DETAILS.sel_val
where SAR_STAND_ATTR_DETAILS.valid_flag =0 and TS_DICTIONARY.id=#{id}
</select>
</mapper>