feat: 迁移国内标准法规部分1

This commit is contained in:
super_liu
2021-06-02 21:39:20 +08:00
parent ac33a531ec
commit 4cc558befc
140 changed files with 12514 additions and 58 deletions
@@ -0,0 +1,155 @@
<?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.slrs.otSvpps.dao.OtSvppsDao">
<!-- Result Map-->
<resultMap id="BaseResultMap" type="com.adc.da.slrs.otSvpps.entity.OtSvpps" >
<id column="id" property="id" />
<result column="p_id" property="pId" />
<result column="f_num" property="fNum" />
<result column="s_num" property="sNum" />
<result column="t_num" property="tNum" />
<result column="svpps_code" property="svppsCode" />
<result column="svpps_en_name" property="svppsEnName" />
<result column="svpps_cn_name" property="svppsCnName" />
<result column="sync_id" property="syncId" />
<result column="valid_flag" property="validFlag" />
<result column="created_time" property="createdTime" />
<result column="modify_time" property="modifyTime" />
</resultMap>
<!-- OT_SVPPS table all fields -->
<sql id="Base_Column_List" >
id, p_id, f_num, s_num, t_num, svpps_code, svpps_en_name, svpps_cn_name, sync_id, valid_flag, created_time, modify_time
</sql>
<!-- 查询条件 -->
<sql id="Base_Where_Clause">
where 1=1
<trim suffixOverrides="," >
<if test="id != null" >
and id ${idOperator} #{id}
</if>
<if test="pId != null" >
and p_id ${pIdOperator} #{pId}
</if>
<if test="fNum != null" >
and f_num ${fNumOperator} #{fNum}
</if>
<if test="sNum != null" >
and s_num ${sNumOperator} #{sNum}
</if>
<if test="tNum != null" >
and t_num ${tNumOperator} #{tNum}
</if>
<if test="svppsCode != null" >
and svpps_code ${svppsCodeOperator} #{svppsCode}
</if>
<if test="svppsEnName != null" >
and svpps_en_name ${svppsEnNameOperator} #{svppsEnName}
</if>
<if test="svppsCnName != null" >
and svpps_cn_name ${svppsCnNameOperator} #{svppsCnName}
</if>
<if test="syncId != null" >
and sync_id ${syncIdOperator} #{syncId}
</if>
<if test="validFlag != null" >
and valid_flag ${validFlagOperator} #{validFlag}
</if>
<if test="createdTime != null" >
and created_time ${createdTimeOperator} #{createdTime}
</if>
<if test="createdTime1 != null" >
and created_time &gt;= #{createdTime1}
</if>
<if test="createdTime2 != null" >
and created_time &lt;= #{createdTime2}
</if>
<if test="modifyTime != null" >
and modify_time ${modifyTimeOperator} #{modifyTime}
</if>
<if test="modifyTime1 != null" >
and modify_time &gt;= #{modifyTime1}
</if>
<if test="modifyTime2 != null" >
and modify_time &lt;= #{modifyTime2}
</if>
</trim>
</sql>
<select id="getNamesByIds" resultType="java.lang.String" parameterType="java.util.List">
select * from (
select
group_concat(svpps_code ORDER BY svpps_code separator ',')
from OT_SVPPS
where VALID_FLAG = '0'
and id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
) aa
union
SELECT
group_concat( self_code ORDER BY self_code SEPARATOR ',' )
FROM
OT_SVPPS_SELFDATA
where
id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="getNamesTipByIds" resultType="java.lang.String" parameterType="java.util.List">
select
group_concat(
if(
svpps_cn_name is null,
svpps_en_name,
CONCAT(svpps_cn_name,' ',svpps_en_name)
) ORDER BY svpps_code SEPARATOR ',' ) as name
from OT_SVPPS
where VALID_FLAG = '0'
and id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
union
SELECT
group_concat(
if(
self_name is null,
self_ename,
CONCAT(self_name,' ',self_ename)
) ORDER BY self_code SEPARATOR ',' ) as name
FROM
OT_SVPPS_SELFDATA
where
id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="getIdsByNames" resultType="java.lang.String" parameterType="java.util.List">
select
group_concat(id ORDER BY id separator ',')
from OT_SVPPS
where VALID_FLAG = '0'
and svpps_code in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
union
SELECT
group_concat(id ORDER BY id separator ',')
FROM
OT_SVPPS_SELFDATA
where
self_code in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>