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,233 @@
<?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.sarStandAttrInfo.dao.SarStandAttrInfoDao">
<!-- Result Map-->
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo" >
<id column="id" property="id" />
<result column="stand_id" property="standId" />
<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>
<!-- SAR_STAND_ATTR_INFO table all fields -->
<sql id="Base_Column_List" >
id, stand_id, creation_user, valid_flag, creation_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="standId != null" >
and stand_id ${standIdOperator} #{standId}
</if>
<if test="creationUser != null" >
and creation_user ${creationUserOperator} #{creationUser}
</if>
<if test="validFlag != null" >
and valid_flag ${validFlagOperator} #{validFlag}
</if>
<if test="creationTime != null" >
and creation_time ${creationTimeOperator} #{creationTime}
</if>
<if test="creationTime1 != null" >
and creation_time &gt;= #{creationTime1}
</if>
<if test="creationTime2 != null" >
and creation_time &lt;= #{creationTime2}
</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>
<if test="GZZXX != null" >
and GZZXX ${GZZXXOperator} #{GZZXX}
</if>
</trim>
</sql>
<!-- 插入记录 -->
<insert id="insert" parameterType="com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo" >
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
SELECT SEQ_SAR_STAND_ATTR_INFO.NEXTVAL FROM DUAL
</selectKey> -->
insert into SAR_STAND_ATTR_INFO(<include refid="Base_Column_List" />)
values (#{id, jdbcType=VARCHAR}, #{standId, jdbcType=VARCHAR}, #{creationUser, jdbcType=VARCHAR}, #{validFlag, jdbcType=VARCHAR}, #{creationTime, jdbcType=TIMESTAMP}, #{modifyTime, jdbcType=TIMESTAMP})
</insert>
<!-- 动态插入记录 主键是序列 -->
<insert id="insertSelective" parameterType="com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo" >
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
SELECT SEQ_SAR_STAND_ATTR_INFO.NEXTVAL FROM DUAL
</selectKey> -->
insert into SAR_STAND_ATTR_INFO
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >id,</if>
<if test="standId != null" >stand_id,</if>
<if test="creationUser != null" >creation_user,</if>
<if test="validFlag != null" >valid_flag,</if>
<if test="creationTime != null" >creation_time,</if>
<if test="modifyTime != null" >modify_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
<if test="standId != null" >#{standId, jdbcType=VARCHAR},</if>
<if test="creationUser != null" >#{creationUser, jdbcType=VARCHAR},</if>
<if test="validFlag != null" >#{validFlag, jdbcType=VARCHAR},</if>
<if test="creationTime != null" >#{creationTime, jdbcType=TIMESTAMP},</if>
<if test="modifyTime != null" >#{modifyTime, jdbcType=TIMESTAMP},</if>
</trim>
</insert>
<!-- 根据pk,修改记录-->
<update id="updateByPrimaryKey" parameterType="com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo" >
update SAR_STAND_ATTR_INFO
set stand_id = #{standId},
creation_user = #{creationUser},
valid_flag = #{validFlag},
creation_time = #{creationTime},
modify_time = #{modifyTime}
where id = #{id}
</update>
<!-- 修改记录,只修改只不为空的字段 -->
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo" >
update SAR_STAND_ATTR_INFO
<set >
<if test="standId != null" >
stand_id = #{standId},
</if>
<if test="creationUser != null" >
creation_user = #{creationUser},
</if>
<if test="validFlag != null" >
valid_flag = #{validFlag},
</if>
<if test="creationTime != null" >
creation_time = #{creationTime},
</if>
<if test="modifyTime != null" >
modify_time = #{modifyTime},
</if>
</set>
where id = #{id}
</update>
<!-- 根据id查询 SAR_STAND_ATTR_INFO -->
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select <include refid="Base_Column_List" />
from SAR_STAND_ATTR_INFO
where id = #{value}
</select>
<!-- 删除记录 -->
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from SAR_STAND_ATTR_INFO
where id = #{value}
</delete>
<!-- SAR_STAND_ATTR_INFO 列表总数-->
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
select count(1) from SAR_STAND_ATTR_INFO
<include refid="Base_Where_Clause"/>
</select>
<!-- 查询SAR_STAND_ATTR_INFO列表 -->
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List" /> from
(select tmp_tb.* from
(select <include refid="Base_Column_List" /> from SAR_STAND_ATTR_INFO
<include refid="Base_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
) tmp_tb limit ${pager.startIndex-1},${pageSize}) a
</select>
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List"/> from SAR_STAND_ATTR_INFO
<include refid="Base_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
</select>
<!-- 新增字段-->
<insert id="alterStandAttr" parameterType="java.lang.String" >
alter table SAR_STAND_ATTR_INFO
add ${fieldInfo}
</insert>
<!-- 删除字段-->
<insert id="deleteStandAttr" parameterType="java.lang.String" >
alter table SAR_STAND_ATTR_INFO
drop COLUMN ${fieldInfo}
</insert>
<!-- 查询表中已存在字段-->
<select id="selectStandAttrColumn" resultType="java.lang.Integer" parameterType="java.lang.String">
SELECT COUNT(*)
FROM information_schema.columns
WHERE TABLE_NAME = 'SAR_STAND_ATTR_INFO' AND COLUMN_NAME = #{columnName}
</select>
<!-- 修改字段长度-->
<update id="updateAttrLen" parameterType="java.lang.String" >
ALTER table SAR_STAND_ATTR_INFO
MODIFY ${fieldInfo}
</update>
<!-- 查询字段及对应数据-->
<select id="selectStandFieldAndData" resultType="Map">
SELECT ${fieldInfo}
FROM SAR_STAND_ATTR_INFO
WHERE valid_flag=0 and stand_id = #{standId, jdbcType=VARCHAR}
</select>
<insert id="insertStandAttr" parameterType="java.lang.String" >
insert into SAR_STAND_ATTR_INFO(${fieldInfo})
values (${fieldValue})
</insert>
<update id="deleteStandAttrByStandId" parameterType="java.lang.String" >
delete from SAR_STAND_ATTR_INFO
where stand_id = #{standId}
</update>
<update id="updateStandInfo" parameterType="java.lang.String" >
update SAR_STAND_ATTR_INFO set ${field}=#{value}
where stand_id = #{standId}
</update>
<select id="selectFieldValByStandId" resultType="java.lang.String" parameterType="java.lang.String">
SELECT ${field}
FROM SAR_STAND_ATTR_INFO
WHERE stand_id = #{standId} and valid_flag=0
</select>
<select id="selectFieldValByContainsVal" resultType="com.adc.da.sys.common.SelectionResult" parameterType="java.lang.String">
SELECT stand_id as value,${field} as label
FROM SAR_STAND_ATTR_INFO
WHERE valid_flag=0 and FIND_IN_SET(#{value}, ${field})
<if test="standIds != null">
and stand_id not in
<foreach collection="standIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>
@@ -0,0 +1,642 @@
<?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.sarStandItems.dao.SarStandItemsDao">
<!-- Result Map-->
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarStandItems.entity.SarStandItems" >
<id column="id" property="id" />
<result column="modify_time" property="modifyTime" />
<result column="creation_time" property="creationTime" />
<result column="creation_user" property="creationUser" />
<result column="valid_flag" property="validFlag" />
<result column="remarks" property="remarks" />
<result column="responsible_unit" property="responsibleUnit" />
<result column="energy_kind" property="energyKind" />
<result column="apply_arctic" property="applyArctic" />
<result column="tack_time" property="tackTime" />
<result column="parts" property="parts" />
<result column="items_name" property="itemsName" />
<result column="items_num" property="itemsNum" />
<result column="stand_id" property="standId" />
<result column="MAINPOINTS_IMPEMENTATION" property="mainPointImplementation" />
<result column="TERMS_CONDITIONS" property="termsConditions" jdbcType="CLOB" javaType = "java.lang.String"/>
<result column="fo" property="fo" />
<result column="duty_engineer" property="dutyEngineer" />
<result column="svpps" property="svpps" />
<result column="claim_type" property="claimType" />
<result column="bus_stand_cover" property="busStandCover" />
<result column="file_type" property="fileType" />
<result column="claimTypeShow" property="claimTypeShow" />
<result column="fileTypeShow" property="fileTypeShow" />
<result column="applyArcticShow" property="applyArcticShow" />
<result column="responsibleUnitShow" property="responsibleUnitShow" />
<result column="itemState" property="itemState" />
</resultMap>
<resultMap id="SecondResultMap" type="com.adc.da.slrs.sarStandItems.entity.SarStandItems" >
<id column="id" property="id" />
<result column="modify_time" property="modifyTime" />
<result column="creation_time" property="creationTime" />
<result column="creation_user" property="creationUser" />
<result column="valid_flag" property="validFlag" />
<result column="remarks" property="remarks" />
<result column="responsible_unit" property="responsibleUnit" />
<result column="energy_kind" property="energyKind" />
<result column="apply_arctic" property="applyArctic" />
<result column="tack_time" property="tackTime" />
<result column="parts" property="parts" />
<result column="items_name" property="itemsName" />
<result column="items_num" property="itemsNum" />
<result column="stand_id" property="standId" />
<result column="responsibleUnitShow" property="responsibleUnitShow" />
<result column="foShow" property="foShow"/>
</resultMap>
<!-- SAR_STAND_ITEMS table all fields -->
<sql id="Base_Column_List" >
SAR_STAND_ITEMS.modify_time, SAR_STAND_ITEMS.creation_time, SAR_STAND_ITEMS.creation_user, SAR_STAND_ITEMS.valid_flag, SAR_STAND_ITEMS.remarks, SAR_STAND_ITEMS.responsible_unit, SAR_STAND_ITEMS.energy_kind, SAR_STAND_ITEMS.apply_arctic, tack_time, parts, SAR_STAND_ITEMS.items_name, SAR_STAND_ITEMS.items_num, SAR_STAND_ITEMS.stand_id, SAR_STAND_ITEMS.id
,TS_ORG.org_name as responsibleUnitShow,SAR_STAND_ITEMS.MAINPOINTS_IMPEMENTATION,SAR_STAND_ITEMS.TERMS_CONDITIONS,tsFo.UNAME as foShow,SAR_STAND_ITEMS.duty_engineer,SAR_STAND_ITEMS.svpps,
SAR_STAND_ITEMS.claim_type,SAR_STAND_ITEMS.bus_stand_cover,SAR_STAND_ITEMS.file_type,dicClaimType.DIC_TYPE_NAME as claimTypeShow,tsdutyEngineer.UNAME as dutyEngineerShow,SAR_STAND_ITEMS.fo
</sql>
<sql id="Base_Query_Column_List" >
SAR_STAND_ITEMS.modify_time, SAR_STAND_ITEMS.creation_time, SAR_STAND_ITEMS.creation_user, SAR_STAND_ITEMS.valid_flag, SAR_STAND_ITEMS.remarks, SAR_STAND_ITEMS.responsible_unit,
SAR_STAND_ITEMS.energy_kind, SAR_STAND_ITEMS.apply_arctic, tack_time, parts, SAR_STAND_ITEMS.items_name, SAR_STAND_ITEMS.items_num, SAR_STAND_ITEMS.stand_id, SAR_STAND_ITEMS.id
,SAR_STAND_ITEMS.MAINPOINTS_IMPEMENTATION,SAR_STAND_ITEMS.TERMS_CONDITIONS,SAR_STAND_ITEMS.duty_engineer,SAR_STAND_ITEMS.svpps,
SAR_STAND_ITEMS.claim_type,SAR_STAND_ITEMS.bus_stand_cover,SAR_STAND_ITEMS.file_type,SAR_STAND_ITEMS.fo
</sql>
<!-- 查询条件 -->
<sql id="Base_Where_Clause">
left join SAR_STANDARDS_INFO on (SAR_STANDARDS_INFO.id = SAR_STAND_ITEMS.stand_id and SAR_STANDARDS_INFO.valid_flag=0)
left join TS_DICTYPE dicClaimType on (dicClaimType.dic_type_code = SAR_STAND_ITEMS.claim_type and dicClaimType.dic_id is
not null and dicClaimType.valid_flag = 0)
left join TS_USER tsdutyEngineer on (tsdutyEngineer.USID = SAR_STAND_ITEMS.duty_engineer and tsdutyEngineer.valid_flag=0
and tsdutyEngineer.DISABLE_FLAG=0)
left join TS_USER tsFo on (tsFo.USID = SAR_STAND_ITEMS.fo and tsFo.valid_flag=0
and tsFo.DISABLE_FLAG=0)
where 1=1
<trim suffixOverrides="," >
<if test="fileType != null" >
and SAR_STAND_ITEMS.file_type = #{fileType}
</if>
<if test="modifyTime != null" >
and SAR_STAND_ITEMS.modify_time ${modifyTimeOperator} #{modifyTime}
</if>
<if test="modifyTime1 != null" >
and SAR_STAND_ITEMS.modify_time &gt;= #{modifyTime1}
</if>
<if test="modifyTime2 != null" >
and SAR_STAND_ITEMS.modify_time &lt;= #{modifyTime2}
</if>
<if test="creationTime != null" >
and SAR_STAND_ITEMS.creation_time ${creationTimeOperator} #{creationTime}
</if>
<if test="creationTime1 != null" >
and SAR_STAND_ITEMS.creation_time &gt;= #{creationTime1}
</if>
<if test="creationTime2 != null" >
and SAR_STAND_ITEMS.creation_time &lt;= #{creationTime2}
</if>
<if test="creationUser != null" >
and SAR_STAND_ITEMS.creation_user ${creationUserOperator} #{creationUser}
</if>
<if test="validFlag != null" >
and SAR_STAND_ITEMS.valid_flag ${validFlagOperator} #{validFlag}
</if>
<if test="remarks != null" >
and SAR_STAND_ITEMS.remarks ${remarksOperator} #{remarks}
</if>
<if test="responsibleUnit != null" >
and SAR_STAND_ITEMS.responsible_unit = #{responsibleUnit}
</if>
<if test="energyKind != null" >
and SAR_STAND_ITEMS.energy_kind ${energyKindOperator} #{energyKind}
</if>
<if test="applyArctic != null" >
and SAR_STAND_ITEMS.apply_arctic ${applyArcticOperator} #{applyArctic}
</if>
<if test="tackTime != null" >
and SAR_STAND_ITEMS.tack_time ${tackTimeOperator} #{tackTime}
</if>
<if test="tackTime1 != null" >
and SAR_STAND_ITEMS.tack_time &gt;= #{tackTime1}
</if>
<if test="tackTime2 != null" >
and SAR_STAND_ITEMS.tack_time &lt;= #{tackTime2}
</if>
<if test="parts != null" >
and SAR_STAND_ITEMS.parts like concat(concat('%', #{parts}),'%')
</if>
<if test="nameOrRequest != null" >
and (SAR_STAND_ITEMS.items_name like concat(concat('%', #{nameOrRequest}),'%') or SAR_STAND_ITEMS.TERMS_CONDITIONS like concat(concat('%', #{nameOrRequest}),'%'))
</if>
<if test="itemsName != null" >
and SAR_STAND_ITEMS.items_name ${itemsNameOperator} #{itemsName}
</if>
<if test="itemsNum != null" >
and SAR_STAND_ITEMS.items_num ${itemsNumOperator} #{itemsNum}
</if>
<if test="standId != null" >
and SAR_STAND_ITEMS.stand_id ${standIdOperator} #{standId}
</if>
<if test="standNum != null" >
and ((SAR_STANDARDS_INFO.STAND_SORT || ' ' || SAR_STANDARDS_INFO.STAND_NUMBER || '-' ||
SAR_STANDARDS_INFO.STAND_YEAR like concat(concat('%',#{standNum}),'%') and SAR_STANDARDS_INFO.STAND_YEAR is not null)
or (SAR_STANDARDS_INFO.STAND_SORT || ' ' || SAR_STANDARDS_INFO.STAND_NUMBER like concat(concat('%',#{standNum}),'%')
and SAR_STANDARDS_INFO.STAND_YEAR is null))
</if>
<if test="id != null" >
and SAR_STAND_ITEMS.id ${idOperator} #{id}
</if>
<if test="noId != null" >
and SAR_STAND_ITEMS.id != #{noId}
</if>
<if test="productId != null" >
and SAR_PRODUCT_SAR_STATE.product_id = #{productId}
</if>
<if test="idlist != null">
and SAR_STAND_ITEMS.id in
<foreach collection="idlist" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test='proType != null and proType == "process"' >
and (SAR_STAND_ITEMS.claim_type='L7N7EEDAPR' or SAR_STAND_ITEMS.claim_type='RENVECPFGT')
</if>
</trim>
</sql>
<!-- 插入记录 -->
<insert id="insert" parameterType="com.adc.da.slrs.sarStandItems.entity.SarStandItems" >
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
SELECT SEQ_SAR_STAND_ITEMS.NEXTVAL FROM DUAL
</selectKey> -->
insert into SAR_STAND_ITEMS(<include refid="Base_Column_List" />)
values (#{modifyTime, jdbcType=TIMESTAMP}, #{creationTime, jdbcType=TIMESTAMP}, #{creationUser, jdbcType=VARCHAR}, #{validFlag, jdbcType=INTEGER}, #{remarks, jdbcType=VARCHAR}, #{responsibleUnit, jdbcType=VARCHAR}, #{energyKind, jdbcType=VARCHAR}, #{applyArctic, jdbcType=VARCHAR}, #{tackTime, jdbcType=TIMESTAMP}, #{parts, jdbcType=VARCHAR}, #{itemsName, jdbcType=VARCHAR}, #{itemsNum, jdbcType=VARCHAR}, #{standId, jdbcType=VARCHAR}, #{id, jdbcType=VARCHAR})
</insert>
<!-- 动态插入记录 主键是序列 -->
<insert id="insertSelective" parameterType="com.adc.da.slrs.sarStandItems.entity.SarStandItems" >
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
SELECT SEQ_SAR_STAND_ITEMS.NEXTVAL FROM DUAL
</selectKey> -->
insert into SAR_STAND_ITEMS
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="modifyTime != null" >modify_time,</if>
<if test="creationTime != null" >creation_time,</if>
<if test="creationUser != null" >creation_user,</if>
<if test="validFlag != null" >valid_flag,</if>
<if test="remarks != null" >remarks,</if>
<if test="responsibleUnit != null" >responsible_unit,</if>
<if test="energyKind != null" >energy_kind,</if>
<if test="applyArctic != null" >apply_arctic,</if>
<if test="tackTime != null" >tack_time,</if>
<if test="parts != null" >parts,</if>
<if test="itemsName != null" >items_name,</if>
<if test="itemsNum != null" >items_num,</if>
<if test="standId != null" >stand_id,</if>
<if test="id != null" >id,</if>
<if test="mainPointImplementation != null">MAINPOINTS_IMPEMENTATION,</if>
<if test="termsConditions != null">TERMS_CONDITIONS,</if>
<if test="fo != null" >fo,</if>
<if test="dutyEngineer != null" >duty_engineer,</if>
<if test="svpps != null" >svpps,</if>
<if test="claimType != null" >claim_type,</if>
<if test="busStandCover != null">bus_stand_cover,</if>
<if test="fileType != null">file_type</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="modifyTime != null" >#{modifyTime, jdbcType=TIMESTAMP},</if>
<if test="creationTime != null" >#{creationTime, jdbcType=TIMESTAMP},</if>
<if test="creationUser != null" >#{creationUser, jdbcType=VARCHAR},</if>
<if test="validFlag != null" >#{validFlag, jdbcType=INTEGER},</if>
<if test="remarks != null" >#{remarks, jdbcType=VARCHAR},</if>
<if test="responsibleUnit != null" >#{responsibleUnit, jdbcType=VARCHAR},</if>
<if test="energyKind != null" >#{energyKind, jdbcType=VARCHAR},</if>
<if test="applyArctic != null" >#{applyArctic, jdbcType=VARCHAR},</if>
<if test="tackTime != null" >#{tackTime, jdbcType=TIMESTAMP},</if>
<if test="parts != null" >#{parts, jdbcType=VARCHAR},</if>
<if test="itemsName != null" >#{itemsName, jdbcType=VARCHAR},</if>
<if test="itemsNum != null" >#{itemsNum, jdbcType=VARCHAR},</if>
<if test="standId != null" >#{standId, jdbcType=VARCHAR},</if>
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
<if test="mainPointImplementation != null">#{mainPointImplementation,jdbcType=VARCHAR},</if>
<if test="termsConditions != null">#{termsConditions,jdbcType=CLOB},</if>
<if test="fo != null" >#{fo, jdbcType=VARCHAR},</if>
<if test="dutyEngineer != null" >#{dutyEngineer, jdbcType=VARCHAR},</if>
<if test="svpps != null" >#{svpps, jdbcType=VARCHAR},</if>
<if test="claimType != null" >#{claimType, jdbcType=VARCHAR},</if>
<if test="busStandCover != null" >#{busStandCover, jdbcType=VARCHAR},</if>
<if test="fileType != null" >#{fileType, jdbcType=VARCHAR}</if>
</trim>
</insert>
<!-- 根据pk,修改记录-->
<update id="updateByPrimaryKey" parameterType="com.adc.da.slrs.sarStandItems.entity.SarStandItems" >
update SAR_STAND_ITEMS
set modify_time = #{modifyTime},
creation_time = #{creationTime},
creation_user = #{creationUser},
valid_flag = #{validFlag},
remarks = #{remarks},
responsible_unit = #{responsibleUnit},
energy_kind = #{energyKind},
apply_arctic = #{applyArctic},
tack_time = #{tackTime},
parts = #{parts},
items_name = #{itemsName},
items_num = #{itemsNum},
stand_id = #{standId}
where id = #{id}
</update>
<!-- 修改记录,只修改只不为空的字段 -->
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.slrs.sarStandItems.entity.SarStandItems">
update SAR_STAND_ITEMS
<set >
<if test="modifyTime != null" >
modify_time = #{modifyTime},
</if>
<if test="creationTime != null" >
creation_time = #{creationTime},
</if>
<if test="creationUser != null" >
creation_user = #{creationUser},
</if>
<if test="validFlag != null" >
valid_flag = #{validFlag},
</if>
<if test="remarks != null" >
remarks = #{remarks},
</if>
<if test="responsibleUnit != null" >
responsible_unit = #{responsibleUnit},
</if>
<if test="energyKind != null" >
energy_kind = #{energyKind},
</if>
<if test="applyArctic != null" >
apply_arctic = #{applyArctic},
</if>
<if test="tackTime != null" >
tack_time = #{tackTime},
</if>
<if test="tackTime == null">
tack_time = null,
</if>
<if test="parts != null" >
parts = #{parts},
</if>
<if test="itemsName != null" >
items_name = #{itemsName},
</if>
<if test="itemsNum != null" >
items_num = #{itemsNum},
</if>
<if test="standId != null" >
stand_id = #{standId},
</if>
<if test="mainPointImplementation != null" >
MAINPOINTS_IMPEMENTATION = #{mainPointImplementation},
</if>
<if test="termsConditions != null" >
TERMS_CONDITIONS = #{termsConditions,jdbcType=CLOB},
</if>
<if test="fo != null" >
fo = #{fo},
</if>
<if test="dutyEngineer != null" >
duty_engineer = #{dutyEngineer},
</if>
<if test="svpps != null" >
svpps = #{svpps},
</if>
<if test="claimType != null" >
claim_type = #{claimType},
</if>
<if test="busStandCover != null" >
bus_stand_cover = #{busStandCover},
</if>
</set>
where id = #{id}
</update>
<!-- 根据id查询 SAR_STAND_ITEMS -->
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select <include refid="Base_Query_Column_List" />
from SAR_STAND_ITEMS
where id = #{value}
</select>
<!-- 删除记录 -->
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from SAR_STAND_ITEMS
where id = #{value}
</delete>
<!-- SAR_STAND_ITEMS 列表总数-->
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
select count(1) from SAR_STAND_ITEMS
<include refid="Base_Where_Clause"/>
</select>
<!-- 查询SAR_STAND_ITEMS列表 -->
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List" /> from
(select tmp_tb.* from
(select SAR_STAND_ITEMS.modify_time, SAR_STAND_ITEMS.creation_time, SAR_STAND_ITEMS.creation_user, SAR_STAND_ITEMS.valid_flag, SAR_STAND_ITEMS.remarks, SAR_STAND_ITEMS.responsible_unit, SAR_STAND_ITEMS.energy_kind, SAR_STAND_ITEMS.apply_arctic, tack_time, parts, SAR_STAND_ITEMS.items_name, SAR_STAND_ITEMS.items_num, SAR_STAND_ITEMS.stand_id, SAR_STAND_ITEMS.id
,TS_ORG.org_name as responsibleUnitShow,SAR_STAND_ITEMS.MAINPOINTS_IMPEMENTATION,SAR_STAND_ITEMS.TERMS_CONDITIONS
from SAR_STAND_ITEMS
<include refid="Base_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
) tmp_tb limit ${pager.startIndex-1},${pageSize}) a
</select>
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List"/> from SAR_STAND_ITEMS
<include refid="Base_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
</select>
<select id="queryItemsByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List"/>,
(
SELECT
group_concat(TS_DICTYPE.DIC_TYPE_NAME ORDER BY SAR_STAND_ITEM_VAL.property_type separator ',')
FROM
SAR_STAND_ITEM_VAL left join TS_DICTYPE on (TS_DICTYPE.dic_type_code = SAR_STAND_ITEM_VAL.property_val and TS_DICTYPE.dic_id is not null)
WHERE
SAR_STAND_ITEM_VAL.ITEM_ID = SAR_STAND_ITEMS.id
AND SAR_STAND_ITEM_VAL.property_type = 'APPLY_ARCTIC'
) AS applyArcticShow,
(
SELECT
group_concat(TS_DICTYPE.DIC_TYPE_NAME ORDER BY SAR_STAND_ITEM_VAL.property_type separator ',')
FROM
SAR_STAND_ITEM_VAL left join TS_DICTYPE on (TS_DICTYPE.dic_type_code = SAR_STAND_ITEM_VAL.property_val and TS_DICTYPE.dic_id is not null)
WHERE
SAR_STAND_ITEM_VAL.ITEM_ID = SAR_STAND_ITEMS.id
AND SAR_STAND_ITEM_VAL.property_type = 'ENERGY_KIND'
) AS emergyKindShow
from SAR_STAND_ITEMS left join TS_ORG on (SAR_STAND_ITEMS.responsible_unit =TS_ORG.id)
left join SAR_STANDARDS_INFO on (SAR_STANDARDS_INFO.id = SAR_STAND_ITEMS.stand_id and SAR_STANDARDS_INFO.valid_flag=0)
left join TS_DICTYPE dicClaimType on (dicClaimType.dic_type_code = SAR_STAND_ITEMS.claim_type and dicClaimType.dic_id is
not null and dicClaimType.valid_flag = 0)
left join TS_USER tsdutyEngineer on (tsdutyEngineer.USID = SAR_STAND_ITEMS.duty_engineer and tsdutyEngineer.valid_flag=0
and tsdutyEngineer.DISABLE_FLAG=0)
left join TS_USER tsFo on (tsFo.USID = SAR_STAND_ITEMS.fo and tsFo.valid_flag=0
and tsFo.DISABLE_FLAG=0)
where 1=1
<if test="fileType != null" >
and SAR_STAND_ITEMS.file_type = #{fileType}
</if>
<if test="modifyTime != null" >
and SAR_STAND_ITEMS.modify_time ${modifyTimeOperator} #{modifyTime}
</if>
<if test="modifyTime1 != null" >
and SAR_STAND_ITEMS.modify_time &gt;= #{modifyTime1}
</if>
<if test="modifyTime2 != null" >
and SAR_STAND_ITEMS.modify_time &lt;= #{modifyTime2}
</if>
<if test="creationTime != null" >
and SAR_STAND_ITEMS.creation_time ${creationTimeOperator} #{creationTime}
</if>
<if test="creationTime1 != null" >
and SAR_STAND_ITEMS.creation_time &gt;= #{creationTime1}
</if>
<if test="creationTime2 != null" >
and SAR_STAND_ITEMS.creation_time &lt;= #{creationTime2}
</if>
<if test="creationUser != null" >
and SAR_STAND_ITEMS.creation_user ${creationUserOperator} #{creationUser}
</if>
<if test="validFlag != null" >
and SAR_STAND_ITEMS.valid_flag ${validFlagOperator} #{validFlag}
</if>
<if test="remarks != null" >
and SAR_STAND_ITEMS.remarks ${remarksOperator} #{remarks}
</if>
<if test="responsibleUnit != null" >
and SAR_STAND_ITEMS.responsible_unit = #{responsibleUnit}
</if>
<if test="energyKind != null" >
and SAR_STAND_ITEMS.energy_kind ${energyKindOperator} #{energyKind}
</if>
<if test="applyArctic != null" >
and SAR_STAND_ITEMS.apply_arctic ${applyArcticOperator} #{applyArctic}
</if>
<if test="tackTime != null" >
and SAR_STAND_ITEMS.tack_time ${tackTimeOperator} #{tackTime}
</if>
<if test="tackTime1 != null" >
and SAR_STAND_ITEMS.tack_time &gt;= #{tackTime1}
</if>
<if test="tackTime2 != null" >
and SAR_STAND_ITEMS.tack_time &lt;= #{tackTime2}
</if>
<if test="parts != null" >
and SAR_STAND_ITEMS.parts like concat(concat('%', #{parts}),'%')
</if>
<if test="nameOrRequest != null" >
and (SAR_STAND_ITEMS.items_name like concat(concat('%', #{nameOrRequest}),'%') or SAR_STAND_ITEMS.TERMS_CONDITIONS like concat(concat('%', #{nameOrRequest}),'%'))
</if>
<if test="itemsName != null" >
and SAR_STAND_ITEMS.items_name ${itemsNameOperator} #{itemsName}
</if>
<if test="itemsNum != null" >
and SAR_STAND_ITEMS.items_num ${itemsNumOperator} #{itemsNum}
</if>
<if test="standId != null" >
and SAR_STAND_ITEMS.stand_id ${standIdOperator} #{standId}
</if>
<if test="standNum != null" >
and ((SAR_STANDARDS_INFO.STAND_SORT || ' ' || SAR_STANDARDS_INFO.STAND_NUMBER || '-' ||
SAR_STANDARDS_INFO.STAND_YEAR like concat(concat('%',#{standNum}),'%') and SAR_STANDARDS_INFO.STAND_YEAR is not null)
or (SAR_STANDARDS_INFO.STAND_SORT || ' ' || SAR_STANDARDS_INFO.STAND_NUMBER like concat(concat('%',#{standNum}),'%')
and SAR_STANDARDS_INFO.STAND_YEAR is null))
</if>
<if test="id != null" >
and SAR_STAND_ITEMS.id ${idOperator} #{id}
</if>
<if test="noId != null" >
and SAR_STAND_ITEMS.id != #{noId}
</if>
<if test="idlist != null">
and SAR_STAND_ITEMS.id in
<foreach collection="idlist" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test='proType != null and proType == "process"' >
and (SAR_STAND_ITEMS.claim_type='L7N7EEDAPR' or SAR_STAND_ITEMS.claim_type='RENVECPFGT')
</if>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
</select>
<select id="queryIdsByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select SAR_STAND_ITEMS.id from SAR_STAND_ITEMS
<include refid="Base_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
</select>
<insert id="insertForeach" parameterType="java.util.List">
insert into SAR_STAND_ITEMS(svpps,fo,file_type,modify_time,creation_time,creation_user,valid_flag,apply_arctic,
items_name,items_num,stand_id,id,terms_conditions,responsible_unit,duty_engineer)
values
<foreach collection="list" item="item" index="index" separator=",">
(#{item.svpps, jdbcType=VARCHAR},
#{item.fo, jdbcType=VARCHAR},
#{item.fileType, jdbcType=VARCHAR},
#{item.modifyTime, jdbcType=DATE},
#{item.creationTime, jdbcType=DATE},
#{item.creationUser, jdbcType=VARCHAR},
#{item.validFlag, jdbcType=INTEGER},
#{item.applyArctic, jdbcType=VARCHAR},
#{item.itemsName, jdbcType=VARCHAR},
#{item.itemsNum, jdbcType=VARCHAR},
#{item.standId, jdbcType=VARCHAR},
#{item.id, jdbcType=VARCHAR},
#{item.termsConditions,jdbcType=VARCHAR},
#{item.responsibleUnit,jdbcType=VARCHAR},
#{item.dutyEngineer,jdbcType=VARCHAR}
)
</foreach>
</insert>
<update id="updateForeach" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" separator=";">
update SAR_STAND_ITEMS
<set >
<if test="item.svpps != null" >
svpps = #{item.svpps},
</if>
<if test="item.fo != null" >
fo = #{item.fo},
</if>
<if test="item.fileType != null" >
file_type = #{item.fileType},
</if>
<if test="item.modifyTime != null" >
modify_time = #{item.modifyTime},
</if>
<if test="item.remarks != null" >
remarks = #{item.remarks},
</if>
<if test="item.applyArctic != null" >
apply_arctic = #{item.applyArctic},
</if>
<if test="item.itemsName != null" >
items_name = #{item.itemsName},
</if>
<if test="item.itemsNum != null" >
items_num = #{item.itemsNum},
</if>
<if test="item.standId != null" >
stand_id = #{item.standId},
</if>
<if test="item.termsConditions != null" >
TERMS_CONDITIONS = #{item.termsConditions,jdbcType=CLOB},
</if>
</set>
where id = #{item.id, jdbcType=VARCHAR}
</foreach>
;
</update>
<delete id="deleteByStandIdAndFileType" parameterType="java.lang.String">
delete from SAR_STAND_ITEMS
where stand_id = #{standId}
<if test="fileType != null">
and file_type = #{fileType}
</if>
</delete>
<delete id="deleteByIds" parameterType="java.lang.String">
delete from SAR_STAND_ITEMS
where id in
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<select id="selectClaimTypesByStandId" parameterType="java.lang.String" resultType="java.lang.String">
select claim_type from SAR_STAND_ITEMS
where valid_flag=0 and claim_type != ''
<if test="standId != null">
and stand_id=#{standId}
</if>
<if test="idList != null">
and id in
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="fileType != null">
and file_type = #{fileType}
</if>
</select>
<select id="selectSvppsByStandId" parameterType="java.lang.String" resultType="java.lang.String">
select svpps from SAR_STAND_ITEMS
where valid_flag=0 and svpps != ''
<if test="standId != null">
and stand_id=#{standId}
</if>
<if test="idList != null">
and id in
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="fileType != null">
and file_type = #{fileType}
</if>
</select>
<select id="selectAllItemsClaimType" resultType="com.adc.da.sys.common.SelectionResult" parameterType="com.adc.da.slrs.sarStandItems.entity.SarStandItems">
select stand_id as label,claim_type as value from SAR_STAND_ITEMS
where valid_flag = 0 and claim_type != ''
<if test="standId != null">
and stand_id=#{standId}
</if>
<if test="idList != null">
and stand_id in
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<select id="selectAllItemsSvpps" resultType="com.adc.da.sys.common.SelectionResult" parameterType="com.adc.da.slrs.sarStandItems.entity.SarStandItems">
select stand_id as label,svpps as value from SAR_STAND_ITEMS
where valid_flag = 0 and svpps != ''
<if test="standId != null">
and stand_id=#{standId}
</if>
<if test="idList != null">
and stand_id in
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>
@@ -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>
@@ -0,0 +1,152 @@
<?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.sarGroupMenu.dao.SarGroupMenuDao">
<!-- Result Map-->
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarGroupMenu.entity.SarGroupMenu" >
<id column="id" property="id" />
<result column="pid" property="pid" />
<result column="menu_name" property="menuName" />
<result column="menu_type" property="menuType" />
<result column="menu_level" property="menuLevel" />
<result column="create_time" property="createTime" />
<result column="create_userid" property="createUserid" />
<result column="modify_time" property="modifyTime" />
<result column="modify_userid" property="modifyUserid" />
<result column="vlag_flag" property="vlagFlag" />
<result column="stand_name" property="standName"/>
<result column="stand_no" property="standNo"/>
<result column="detail_id" property="detailId"/>
</resultMap>
<!-- SAR_GROUP_MENU table all fields -->
<sql id="Base_Column_List" >
SAR_GROUP_MENU.id, pid, menu_name, menu_type, menu_level, SAR_GROUP_MENU.create_time, SAR_GROUP_MENU.create_userid, SAR_GROUP_MENU.modify_time, SAR_GROUP_MENU.modify_userid, SAR_GROUP_MENU.vlag_flag, stand_no
</sql>
<!-- 查询条件 -->
<sql id="Base_Where_Clause">
where 1=1
<trim suffixOverrides="," >
<if test="id != null" >
and SAR_GROUP_MENU.id ${idOperator} #{id}
</if>
<if test="pid != null" >
and pid ${pidOperator} #{pid}
</if>
<if test="menuName != null" >
and menu_name ${menuNameOperator} #{menuName}
</if>
<if test="menuType != null" >
and menu_type ${menuTypeOperator} #{menuType}
</if>
<if test="menuLevel != null" >
and menu_level ${menuLevelOperator} #{menuLevel}
</if>
<if test="createTime != null" >
and SAR_GROUP_MENU.create_time ${createTimeOperator} #{createTime}
</if>
<if test="createTime1 != null" >
and SAR_GROUP_MENU.create_time &gt;= #{createTime1}
</if>
<if test="createTime2 != null" >
and SAR_GROUP_MENU.create_time &lt;= #{createTime2}
</if>
<if test="createUserid != null" >
and SAR_GROUP_MENU.create_userid ${createUseridOperator} #{createUserid}
</if>
<if test="modifyTime != null" >
and SAR_GROUP_MENU.modify_time ${modifyTimeOperator} #{modifyTime}
</if>
<if test="modifyTime1 != null" >
and SAR_GROUP_MENU.modify_time &gt;= #{modifyTime1}
</if>
<if test="modifyTime2 != null" >
and SAR_GROUP_MENU.modify_time &lt;= #{modifyTime2}
</if>
<if test="modifyUserid != null" >
and SAR_GROUP_MENU.modify_userid ${modifyUseridOperator} #{modifyUserid}
</if>
<if test="vlagFlag != null" >
and SAR_GROUP_MENU.vlag_flag ${vlagFlagOperator} #{vlagFlag}
</if>
<if test="standNo != null" >
and stand_no ${standNoOperator} #{standNo}
</if>
</trim>
</sql>
<sql id="Base_Where_Clause2">
where 1=1
<trim suffixOverrides="," >
<if test="id != null" >
and id like concat(#{id},'%')
</if>
<if test="pid != null" >
and pid ${pidOperator} #{pid}
</if>
<if test="menuName != null" >
and menu_name ${menuNameOperator} #{menuName}
</if>
<if test="menuType != null" >
and menu_type ${menuTypeOperator} #{menuType}
</if>
<if test="menuLevel != null" >
and menu_level ${menuLevelOperator} #{menuLevel}
</if>
<if test="createTime != null" >
and create_time ${createTimeOperator} #{createTime}
</if>
<if test="createTime1 != null" >
and create_time &gt;= #{createTime1}
</if>
<if test="createTime2 != null" >
and create_time &lt;= #{createTime2}
</if>
<if test="createUserid != null" >
and create_userid ${createUseridOperator} #{createUserid}
</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>
<if test="modifyUserid != null" >
and modify_userid ${modifyUseridOperator} #{modifyUserid}
</if>
<if test="vlagFlag != null" >
and vlag_flag ${vlagFlagOperator} #{vlagFlag}
</if>
<if test="standNo != null" >
and stand_no ${standNoOperator} #{standNo}
</if>
</trim>
</sql>
<select id="getNamesByIds" resultType="java.lang.String" parameterType="java.util.List">
select
group_concat(MENU_NAME ORDER BY MENU_NAME separator ',')
from SAR_GROUP_MENU
where VLAG_FLAG = '0'
and 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 SAR_GROUP_MENU
where VLAG_FLAG = '0'
and MENU_NAME in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>
@@ -0,0 +1,261 @@
<?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.sarMenu.dao.SarMenuDao">
<!-- Result Map-->
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarMenu.entity.SarMenu" >
<id column="id" property="id" />
<result column="parent_id" property="parentId" />
<result column="menu_name" property="menuName" />
<result column="sor_divide" property="sorDivide" />
<result column="modify_time" property="modifyTime" />
<result column="creation_time" property="creationTime" />
<result column="valid_flag" property="validFlag" />
<result column="display_seq" property="displaySeq" />
<result column="parent_ids" property="parentIds" />
<result column="remarks" property="remarks" />
</resultMap>
<!-- SAR_MENU table all fields -->
<sql id="Base_Column_List" >
parent_id, menu_name, sor_divide, id, modify_time, creation_time, valid_flag, display_seq, parent_ids, remarks
</sql>
<!-- 查询条件 -->
<sql id="Base_Where_Clause">
where 1=1
<trim suffixOverrides="," >
<if test="parentId != null" >
and parent_id ${parentIdOperator} #{parentId}
</if>
<if test="menuName != null" >
and menu_name ${menuNameOperator} #{menuName}
</if>
<if test="sorDivide != null" >
and sor_divide ${sorDivideOperator} #{sorDivide}
</if>
<if test="id != null" >
and id ${idOperator} #{id}
</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>
<if test="creationTime != null" >
and creation_time ${creationTimeOperator} #{creationTime}
</if>
<if test="creationTime1 != null" >
and creation_time &gt;= #{creationTime1}
</if>
<if test="creationTime2 != null" >
and creation_time &lt;= #{creationTime2}
</if>
<if test="validFlag != null" >
and valid_flag ${validFlagOperator} #{validFlag}
</if>
<if test="displaySeq != null" >
and display_seq ${displaySeqOperator} #{displaySeq}
</if>
<if test="parentIds != null" >
and parent_ids ${parentIdsOperator} #{parentIds}
</if>
<if test="remarks != null" >
and remarks = #{remarks}
</if>
</trim>
</sql>
<!-- 插入记录 -->
<insert id="insert" parameterType="com.adc.da.slrs.sarMenu.entity.SarMenu" >
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
SELECT SEQ_SAR_MENU.NEXTVAL FROM DUAL
</selectKey> -->
insert into SAR_MENU(<include refid="Base_Column_List" />)
values (#{parentId, jdbcType=VARCHAR}, #{menuName, jdbcType=VARCHAR}, #{sorDivide, jdbcType=VARCHAR}, #{id, jdbcType=VARCHAR}, #{modifyTime, jdbcType=TIMESTAMP}, #{creationTime, jdbcType=TIMESTAMP}, #{validFlag, jdbcType=INTEGER}, #{displaySeq, jdbcType=INTEGER}, #{parentIds, jdbcType=VARCHAR},#{remarks, jdbcType=VARCHAR})
</insert>
<!-- 动态插入记录 主键是序列 -->
<insert id="insertSelective" parameterType="com.adc.da.slrs.sarMenu.entity.SarMenu" >
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
SELECT SEQ_SAR_MENU.NEXTVAL FROM DUAL
</selectKey> -->
insert into SAR_MENU
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="parentId != null" >parent_id,</if>
<if test="menuName != null" >menu_name,</if>
<if test="sorDivide != null" >sor_divide,</if>
<if test="id != null" >id,</if>
<if test="modifyTime != null" >modify_time,</if>
<if test="creationTime != null" >creation_time,</if>
<if test="validFlag != null" >valid_flag,</if>
<if test="displaySeq != null" >display_seq,</if>
<if test="parentIds != null" >parent_ids,</if>
<if test="remarks != null" >remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="parentId != null" >#{parentId, jdbcType=VARCHAR},</if>
<if test="menuName != null" >#{menuName, jdbcType=VARCHAR},</if>
<if test="sorDivide != null" >#{sorDivide, jdbcType=VARCHAR},</if>
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
<if test="modifyTime != null" >#{modifyTime, jdbcType=TIMESTAMP},</if>
<if test="creationTime != null" >#{creationTime, jdbcType=TIMESTAMP},</if>
<if test="validFlag != null" >#{validFlag, jdbcType=INTEGER},</if>
<if test="displaySeq != null" >#{displaySeq, jdbcType=INTEGER},</if>
<if test="parentIds != null" >#{parentIds, jdbcType=VARCHAR},</if>
<if test="remarks != null" >#{remarks, jdbcType=VARCHAR},</if>
</trim>
</insert>
<!-- 根据pk,修改记录-->
<update id="updateByPrimaryKey" parameterType="com.adc.da.slrs.sarMenu.entity.SarMenu" >
update SAR_MENU
set parent_id = #{parentId},
menu_name = #{menuName},
sor_divide = #{sorDivide},
modify_time = #{modifyTime},
creation_time = #{creationTime},
valid_flag = #{validFlag},
display_seq = #{displaySeq},
parent_ids = #{parentIds}
remarks = #{remarks}
where id = #{id}
</update>
<!-- 修改记录,只修改只不为空的字段 -->
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.slrs.sarMenu.entity.SarMenu" >
update SAR_MENU
<set >
<if test="parentId != null" >
parent_id = #{parentId},
</if>
<if test="menuName != null" >
menu_name = #{menuName},
</if>
<if test="sorDivide != null" >
sor_divide = #{sorDivide},
</if>
<if test="modifyTime != null" >
modify_time = #{modifyTime},
</if>
<if test="creationTime != null" >
creation_time = #{creationTime},
</if>
<if test="validFlag != null" >
valid_flag = #{validFlag},
</if>
<if test="displaySeq != null" >
display_seq = #{displaySeq},
</if>
<if test="parentIds != null" >
parent_ids = #{parentIds},
</if>
<if test="remarks != null" >
remarks = #{remarks},
</if>
</set>
where id = #{id}
</update>
<!-- 根据id查询 SAR_MENU -->
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select <include refid="Base_Column_List" />
from SAR_MENU
where id = #{value}
</select>
<!-- 删除记录 -->
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from SAR_MENU
where id = #{value}
</delete>
<!-- SAR_MENU 列表总数-->
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
select count(1) from SAR_MENU
<include refid="Base_Where_Clause"/>
</select>
<!-- 查询SAR_MENU列表 -->
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List" /> from
(select tmp_tb.* from
(select <include refid="Base_Column_List" /> from SAR_MENU
<include refid="Base_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
) tmp_tb limit ${pager.startIndex-1},${pageSize}) a
</select>
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List"/> from SAR_MENU
<include refid="Base_Where_Clause"/> and valid_flag=0
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
</select>
<select id="queryMenuByPid" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.sarMenu.entity.SarMenu">
select SAR_MENU.* from SAR_MENU
where id in
<foreach collection="childMenuIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="queryByPidExcpetSelf" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.sarMenu.entity.SarMenu">
select SAR_MENU.* from SAR_MENU
where valid_flag=0 and id != #{id}
and id in
<foreach collection="childMenuIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<!-- 根据目录类型查询最外一层节点 -->
<select id="queryMenuByDis" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.sarMenu.entity.SarMenu">
select <include refid="Base_Column_List"/> from SAR_MENU
where valid_flag = 0
and (parent_id is null or parent_id='1')
<if test='sorDivide != null and sorDivide != "ALL_STAND"' >
and sor_divide = #{sorDivide}
</if>
<if test='sorDivide != null and sorDivide == "ALL_STAND"' >
and (sor_divide = 'INLAND_STAND' or sor_divide = 'FOREIGN_STAND')
</if>
order by display_seq asc
</select>
<select id="selectMenuByRole" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.sarMenu.entity.SarMenu">
select <include refid="Base_Column_List"/>
from SAR_MENU sm
LEFT JOIN TS_ROLE_SAR_MENU trsm ON sm.ID = trsm.sar_menu_id
where valid_flag = 0
<if test='sorDivide != null and sorDivide != "ALL_STAND"' >
and sor_divide = #{sorDivide}
</if>
<if test='sorDivide != null and sorDivide == "ALL_STAND"' >
and (sor_divide = 'INLAND_STAND' or sor_divide = 'FOREIGN_STAND')
</if>
<if test="roleIds != null" >
and trsm.ROLE_ID in
<foreach collection="roleIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
GROUP BY parent_id, menu_name, sor_divide, id, modify_time, creation_time, valid_flag, display_seq, parent_ids, remarks
order by display_seq asc,creation_time DESC
</select>
<select id="queryParentMenuById" resultType="java.lang.String" parameterType="java.lang.String">
select SAR_MENU.id
from SAR_MENU where valid_flag=0 and parent_id is not null start with id=#{id} connect by prior parent_id=id
</select>
</mapper>
@@ -0,0 +1,142 @@
<?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.sarStandAttrDetails.dao.SarStandAttrDetailsDao">
<!-- Result Map-->
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarStandAttrDetails.entity.SarStandAttrDetails" >
<id column="id" property="id" />
<result column="attr_field" property="attrField" />
<result column="attr_name" property="attrName" />
<result column="attr_type" property="attrType" />
<result column="order_num" property="orderNum" />
<result column="is_edit" property="isEdit" />
<result column="creation_user" property="creationUser" />
<result column="valid_flag" property="validFlag" />
<result column="creation_time" property="creationTime" />
<result column="modify_time" property="modifyTime" />
<result column="attr_len" property="attrLen" />
<result column="is_must" property="isMust" />
<result column="is_show_imp" property="isShowImp" />
<result column="show_region_id" property="showRegionId" />
<result column="sel_val" property="selVal" />
<result column="sar_type" property="sarType" />
<result column="is_search" property="isSearch" />
<result column="is_warn" property="isWarn" />
</resultMap>
<!-- SAR_STAND_ATTR_DETAILS table all fields -->
<sql id="Base_Column_List" >
id, attr_field, attr_name, attr_type, order_num, is_edit, creation_user,
valid_flag, creation_time, modify_time,
attr_len,is_must,is_show_imp,show_region_id,sel_val,sar_type,is_search,is_warn
</sql>
<sql id="Base_Column_List_Show" >
SAR_STAND_ATTR_DETAILS.id, attr_field, attr_name, attr_type, SAR_STAND_ATTR_DETAILS.order_num, is_edit, SAR_STAND_ATTR_DETAILS.creation_user,
SAR_STAND_ATTR_DETAILS.valid_flag, SAR_STAND_ATTR_DETAILS.creation_time, SAR_STAND_ATTR_DETAILS.modify_time,
attr_len,is_must,is_show_imp,show_region_id,sel_val,SAR_STAND_ATTR_DETAILS.sar_type,is_search,is_warn
</sql>
<!-- 查询条件 -->
<sql id="Base_Where_Clause">
where 1=1 and SAR_STAND_ATTR_DETAILS.valid_flag=0
<trim suffixOverrides="," >
<if test="id != null" >
and SAR_STAND_ATTR_DETAILS.id ${idOperator} #{id}
</if>
<if test="attrField != null" >
and attr_field ${attrFieldOperator} #{attrField}
</if>
<if test="attrName != null" >
and attr_name ${attrNameOperator} #{attrName}
</if>
<if test="attrType != null" >
and attr_type ${attrTypeOperator} #{attrType}
</if>
<if test="orderNum != null" >
and SAR_STAND_ATTR_DETAILS.order_num ${orderNumOperator} #{orderNum}
</if>
<if test="isEdit != null" >
and is_edit ${isEditOperator} #{isEdit}
</if>
<if test="creationUser != null" >
and SAR_STAND_ATTR_DETAILS.creation_user ${creationUserOperator} #{creationUser}
</if>
<if test="validFlag != null" >
and SAR_STAND_ATTR_DETAILS.valid_flag ${validFlagOperator} #{validFlag}
</if>
<if test="creationTime != null" >
and SAR_STAND_ATTR_DETAILS.creation_time ${creationTimeOperator} #{creationTime}
</if>
<if test="creationTime1 != null" >
and SAR_STAND_ATTR_DETAILS.creation_time &gt;= #{creationTime1}
</if>
<if test="creationTime2 != null" >
and SAR_STAND_ATTR_DETAILS.creation_time &lt;= #{creationTime2}
</if>
<if test="modifyTime != null" >
and SAR_STAND_ATTR_DETAILS.modify_time ${modifyTimeOperator} #{modifyTime}
</if>
<if test="modifyTime1 != null" >
and SAR_STAND_ATTR_DETAILS.modify_time &gt;= #{modifyTime1}
</if>
<if test="modifyTime2 != null" >
and SAR_STAND_ATTR_DETAILS.modify_time &lt;= #{modifyTime2}
</if>
<if test="attrLen != null" >
and attr_len ${attrLenOperator} #{attrLen}
</if>
<if test="sarType != null" >
and SAR_STAND_ATTR_DETAILS.sar_type like concat(concat('%',#{sarType}),'%')
</if>
<if test="isSearch != null" >
and is_search = #{isSearch}
</if>
<if test="isWarn != null" >
and is_warn = #{isWarn}
</if>
<if test="notId != null" >
and SAR_STAND_ATTR_DETAILS.ID != #{notId}
</if>
<if test="idList != null" >
and SAR_STAND_ATTR_DETAILS.ID in
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</trim>
</sql>
<select id="selectNameByField" resultType="java.lang.String" parameterType="java.lang.String">
SELECT attr_name
from SAR_STAND_ATTR_DETAILS
where attr_field = #{attrField} and valid_flag=0
<if test='sarType != null and sarType == "INLAND_STAND"'>
and (sar_type=#{sarType} or sar_type='STAND')
</if>
<if test='sarType != null and sarType == "FOREIGN_STAND"'>
and (sar_type=#{sarType} or sar_type='STAND')
</if>
<if test='sarType != null and sarType != "FOREIGN_STAND" and sarType != "INLAND_STAND"'>
and sar_type=#{sarType}
</if>
limit 0,1
</select>
<select id="selectFieldByName" resultMap="BaseResultMap" parameterType="java.lang.String">
SELECT <include refid="Base_Column_List" />
from SAR_STAND_ATTR_DETAILS
where attr_name = #{attrName} and valid_flag=0
<if test='sarType != null and sarType == "INLAND_STAND"'>
and (sar_type=#{sarType} or sar_type='STAND')
</if>
<if test='sarType != null and sarType == "FOREIGN_STAND"'>
and (sar_type=#{sarType} or sar_type='STAND')
</if>
<if test='sarType != null and sarType != "FOREIGN_STAND" and sarType != "INLAND_STAND"'>
and sar_type=#{sarType}
</if>
limit 0,1
</select>
</mapper>
@@ -2,4 +2,833 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao">
<!-- Result Map-->
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo" >
<id column="id" property="id" />
<result column="stand_type" property="standType" />
<result column="country" property="country" />
<result column="stand_sort" property="standSort" />
<result column="stand_number" property="standNumber" />
<result column="stand_year" property="standYear" />
<result column="stand_name" property="standName" />
<result column="stand_en_name" property="standEnName" />
<result column="stand_state" property="standState" />
<result column="stand_nature" property="standNature" />
<result column="issue_time" property="issueTime" />
<result column="put_time" property="putTime" />
<result column="synopsis" property="synopsis" />
<result column="replace_stand_num" property="replaceStandNum" />
<result column="replaced_stand_num" property="replacedStandNum" />
<result column="creation_user" property="creationUser" />
<result column="valid_flag" property="validFlag" />
<result column="creation_time" property="creationTime" />
<result column="modify_time" property="modifyTime" />
<result column="newCarPutTime" property="newCarPutTime" />
<result column="is_relate_access" property="isRelateAccess" />
<result column="cite_stand" property="citeStand" />
<result column="cited_stand" property="citedStand" />
<result column="allPutTime" property="allPutTime" />
</resultMap>
<resultMap id="BaseResultMapExcel" type="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo">
<result column="is_relate_access" property="isRelateAccess" />
<result column="synopsis" property="synopsis"/>
<result column="put_time" property="putTime"/>
<result column="issue_time" property="issueTime"/>
<result column="replaced_stand_num" property="replacedStandNum"/>
<result column="replace_stand_num" property="replaceStandNum"/>
<result column="stand_en_name" property="standEnName"/>
<result column="stand_name" property="standName"/>
<result column="stand_year" property="standYear"/>
<result column="stand_number" property="standNumber"/>
<result column="id" property="id"/>
</resultMap>
<!-- SAR_STANDARDS_INFO table all fields -->
<sql id="Base_Column_List" >
SAR_STANDARDS_INFO.id, SAR_STANDARDS_INFO.stand_type, SAR_STANDARDS_INFO.country, SAR_STANDARDS_INFO.stand_sort,
SAR_STANDARDS_INFO.stand_number, SAR_STANDARDS_INFO.stand_year, SAR_STANDARDS_INFO.stand_name, SAR_STANDARDS_INFO.stand_en_name,
SAR_STANDARDS_INFO.stand_state, SAR_STANDARDS_INFO.stand_nature, SAR_STANDARDS_INFO.issue_time, SAR_STANDARDS_INFO.put_time,
SAR_STANDARDS_INFO.synopsis, SAR_STANDARDS_INFO.creation_user, SAR_STANDARDS_INFO.valid_flag,
SAR_STANDARDS_INFO.creation_time, SAR_STANDARDS_INFO.modify_time,SAR_STANDARDS_INFO.is_relate_access,SAR_STANDARDS_INFO.cite_stand,SAR_STANDARDS_INFO.cited_stand
</sql>
<sql id="Base_Column_List_Show" >
SAR_STANDARDS_INFO.id, SAR_STANDARDS_INFO.stand_type, SAR_STANDARDS_INFO.country, SAR_STANDARDS_INFO.stand_sort,
SAR_STANDARDS_INFO.stand_number, SAR_STANDARDS_INFO.stand_year, SAR_STANDARDS_INFO.stand_name, SAR_STANDARDS_INFO.stand_en_name,
SAR_STANDARDS_INFO.stand_state, SAR_STANDARDS_INFO.stand_nature, SAR_STANDARDS_INFO.issue_time, SAR_STANDARDS_INFO.put_time,
concat(SAR_STANDARDS_INFO.synopsis, '') as synopsis, concat(replace_stand_num, '') as replace_stand_num, replaced_stand_num, SAR_STANDARDS_INFO.creation_user, SAR_STANDARDS_INFO.valid_flag,
SAR_STANDARDS_INFO.creation_time, SAR_STANDARDS_INFO.modify_time,dicountry.DIC_TYPE_NAME as countryShow, dicstandSort.DIC_TYPE_NAME as standSortShow,
dicstandState.DIC_TYPE_NAME as standStateShow,dicstandNature.DIC_TYPE_NAME as standNatureShow,is_relate_access,cite_stand,cited_stand
</sql>
<sql id="Group_Column_List_Show">
SAR_STANDARDS_INFO.id, SAR_STANDARDS_INFO.stand_type, SAR_STANDARDS_INFO.country, SAR_STANDARDS_INFO.stand_sort,
SAR_STANDARDS_INFO.stand_number, SAR_STANDARDS_INFO.stand_year, SAR_STANDARDS_INFO.stand_name, SAR_STANDARDS_INFO.stand_en_name,
SAR_STANDARDS_INFO.stand_state, SAR_STANDARDS_INFO.stand_nature, SAR_STANDARDS_INFO.issue_time, SAR_STANDARDS_INFO.put_time,
concat(SAR_STANDARDS_INFO.synopsis, ''), concat(replace_stand_num, ''), replaced_stand_num, SAR_STANDARDS_INFO.creation_user, SAR_STANDARDS_INFO.valid_flag,
SAR_STANDARDS_INFO.creation_time, SAR_STANDARDS_INFO.modify_time,dicountry.DIC_TYPE_NAME, dicstandSort.DIC_TYPE_NAME,
dicstandState.DIC_TYPE_NAME,dicstandNature.DIC_TYPE_NAME,is_relate_access,cite_stand,cited_stand
</sql>
<!-- 查询条件 -->
<sql id="Base_Where_Clause">
where 1=1 and SAR_STANDARDS_INFO.valid_flag=0
<trim suffixOverrides="," >
<if test="id != null" >
and id ${idOperator} #{id}
</if>
<if test="standType != null" >
and stand_type ${standTypeOperator} #{standType}
</if>
<if test="country != null" >
and country ${countryOperator} #{country}
</if>
<if test="standSort != null" >
and stand_sort ${standSortOperator} #{standSort}
</if>
<if test="standNumber != null" >
and stand_number ${standNumberOperator} #{standNumber}
</if>
<if test="standYear != null" >
and stand_year ${standYearOperator} #{standYear}
</if>
<if test="standName != null" >
and stand_name ${standNameOperator} #{standName}
</if>
<if test="standEnName != null" >
and stand_en_name ${standEnNameOperator} #{standEnName}
</if>
<if test="standState != null" >
and stand_state ${standStateOperator} #{standState}
</if>
<if test="standNature != null" >
and stand_nature ${standNatureOperator} #{standNature}
</if>
<if test="issueTime != null" >
and issue_time ${issueTimeOperator} #{issueTime}
</if>
<if test="issueTime1 != null" >
and issue_time &gt;= #{issueTime1}
</if>
<if test="issueTime2 != null" >
and issue_time &lt;= #{issueTime2}
</if>
<if test="putTime != null" >
and put_time ${putTimeOperator} #{putTime}
</if>
<if test="putTime1 != null" >
and put_time &gt;= #{putTime1}
</if>
<if test="putTime2 != null" >
and put_time &lt;= #{putTime2}
</if>
<if test="synopsis != null" >
and synopsis ${synopsisOperator} #{synopsis}
</if>
<if test="replaceStandNum != null" >
and replace_stand_num ${replaceStandNumOperator} #{replaceStandNum}
</if>
<if test="replacedStandNum != null" >
and replaced_stand_num ${replacedStandNumOperator} #{replacedStandNum}
</if>
<if test="creationUser != null" >
and creation_user ${creationUserOperator} #{creationUser}
</if>
<if test="validFlag != null" >
and valid_flag ${validFlagOperator} #{validFlag}
</if>
<if test="creationTime != null" >
and creation_time ${creationTimeOperator} #{creationTime}
</if>
<if test="creationTime1 != null" >
and creation_time &gt;= #{creationTime1}
</if>
<if test="creationTime2 != null" >
and creation_time &lt;= #{creationTime2}
</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>
<if test="isRelateAccess != null" >
and is_relate_access = #{isRelateAccess}
</if>
</trim>
</sql>
<!-- 插入记录 -->
<insert id="insert" parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo" >
insert into SAR_STANDARDS_INFO(<include refid="Base_Column_List" />)
values (#{id, jdbcType=VARCHAR}, #{standType, jdbcType=VARCHAR}, #{country, jdbcType=VARCHAR}, #{standSort, jdbcType=VARCHAR}, #{standNumber, jdbcType=VARCHAR}, #{standYear, jdbcType=VARCHAR}, #{standName, jdbcType=VARCHAR}, #{standEnName, jdbcType=VARCHAR}, #{standState, jdbcType=VARCHAR}, #{standNature, jdbcType=VARCHAR}, #{issueTime, jdbcType=TIMESTAMP}, #{putTime, jdbcType=TIMESTAMP}, #{synopsis, jdbcType=CLOB}, #{replaceStandNum, jdbcType=CLOB}, #{replacedStandNum, jdbcType=VARCHAR}, #{creationUser, jdbcType=VARCHAR}, #{validFlag, jdbcType=VARCHAR}, #{creationTime, jdbcType=TIMESTAMP}, #{modifyTime, jdbcType=TIMESTAMP})
</insert>
<!-- 动态插入记录 主键是序列 -->
<insert id="insertSelective" parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo" >
insert into SAR_STANDARDS_INFO
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >id,</if>
<if test="standType != null" >stand_type,</if>
<if test="country != null" >country,</if>
<if test="standSort != null" >stand_sort,</if>
<if test="standNumber != null" >stand_number,</if>
<if test="standYear != null" >stand_year,</if>
<if test="standName != null" >stand_name,</if>
<if test="standEnName != null" >stand_en_name,</if>
<if test="standState != null" >stand_state,</if>
<if test="standNature != null" >stand_nature,</if>
<if test="issueTime != null" >issue_time,</if>
<if test="putTime != null" >put_time,</if>
<if test="synopsis != null" >synopsis,</if>
<if test="replaceStandNum != null" >replace_stand_num,</if>
<if test="replacedStandNum != null" >replaced_stand_num,</if>
<if test="creationUser != null" >creation_user,</if>
<if test="validFlag != null" >valid_flag,</if>
<if test="creationTime != null" >creation_time,</if>
<if test="modifyTime != null" >modify_time,</if>
<if test="isRelateAccess != null" >is_relate_access,</if>
<if test="citeStand != null" >cite_stand,</if>
<if test="citedStand != null" >cited_stand,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
<if test="standType != null" >#{standType, jdbcType=VARCHAR},</if>
<if test="country != null" >#{country, jdbcType=VARCHAR},</if>
<if test="standSort != null" >#{standSort, jdbcType=VARCHAR},</if>
<if test="standNumber != null" >#{standNumber, jdbcType=VARCHAR},</if>
<if test="standYear != null" >#{standYear, jdbcType=VARCHAR},</if>
<if test="standName != null" >#{standName, jdbcType=VARCHAR},</if>
<if test="standEnName != null" >#{standEnName, jdbcType=VARCHAR},</if>
<if test="standState != null" >#{standState, jdbcType=VARCHAR},</if>
<if test="standNature != null" >#{standNature, jdbcType=VARCHAR},</if>
<if test="issueTime != null" >#{issueTime, jdbcType=VARCHAR},</if>
<if test="putTime != null" >#{putTime, jdbcType=TIMESTAMP},</if>
<if test="synopsis != null" >#{synopsis, jdbcType=CLOB},</if>
<if test="replaceStandNum != null" >#{replaceStandNum, jdbcType=CLOB},</if>
<if test="replacedStandNum != null" >#{replacedStandNum, jdbcType=VARCHAR},</if>
<if test="creationUser != null" >#{creationUser, jdbcType=VARCHAR},</if>
<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="isRelateAccess != null" >#{isRelateAccess, jdbcType=VARCHAR},</if>
<if test="citeStand != null" >#{citeStand, jdbcType=VARCHAR},</if>
<if test="citedStand != null" >#{citedStand, jdbcType=VARCHAR},</if>
</trim>
</insert>
<!-- 根据pk,修改记录-->
<update id="updateByPrimaryKey" parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo" >
update SAR_STANDARDS_INFO
set stand_type = #{standType},
country = #{country},
stand_sort = #{standSort},
stand_number = #{standNumber},
stand_year = #{standYear},
stand_name = #{standName},
stand_en_name = #{standEnName},
stand_state = #{standState},
stand_nature = #{standNature},
issue_time = #{issueTime},
put_time = #{putTime},
synopsis = #{synopsis},
replace_stand_num = #{replaceStandNum},
replaced_stand_num = #{replacedStandNum},
creation_user = #{creationUser},
valid_flag = #{validFlag},
creation_time = #{creationTime},
modify_time = #{modifyTime}
where id = #{id}
</update>
<!-- 修改记录,只修改只不为空的字段 -->
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo" >
update SAR_STANDARDS_INFO
<set >
<if test="standType != null" >
stand_type = #{standType},
</if>
<if test="country != null" >
country = #{country},
</if>
<if test="standSort != null" >
stand_sort = #{standSort},
</if>
<if test="standNumber != null" >
stand_number = #{standNumber},
</if>
<if test="standYear != null" >
stand_year = #{standYear},
</if>
<if test="standName != null" >
stand_name = #{standName},
</if>
<if test="standEnName != null" >
stand_en_name = #{standEnName},
</if>
<if test="standState != null" >
stand_state = #{standState},
</if>
<if test="standNature != null" >
stand_nature = #{standNature},
</if>
<if test="issueTime != null" >
issue_time = #{issueTime},
</if>
<if test="putTime != null" >
put_time = #{putTime},
</if>
<if test="synopsis != null" >
synopsis = #{synopsis},
</if>
<if test="replaceStandNum != null" >
replace_stand_num = #{replaceStandNum},
</if>
<if test="replacedStandNum != null" >
replaced_stand_num = #{replacedStandNum},
</if>
<if test="creationUser != null" >
creation_user = #{creationUser},
</if>
<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="isRelateAccess != null" >
is_relate_access = #{isRelateAccess},
</if>
<if test="citeStand != null" >
cite_stand = #{citeStand},
</if>
<if test="citedStand != null" >
cited_stand = #{citedStand},
</if>
</set>
where id = #{id}
</update>
<!-- 根据id查询 SAR_STANDARDS_INFO -->
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select <include refid="Base_Column_List" />
from SAR_STANDARDS_INFO
where id = #{value}
</select>
<!-- 删除记录 -->
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from SAR_STANDARDS_INFO
where id = #{value}
</delete>
<!-- SAR_STANDARDS_INFO 列表总数-->
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
select count(1) from SAR_STANDARDS_INFO
<include refid="Base_Where_Clause"/>
</select>
<!-- 查询SAR_STANDARDS_INFO列表 -->
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List" /> from
(select tmp_tb.* from
(select <include refid="Base_Column_List" /> from SAR_STANDARDS_INFO
<include refid="Base_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
) tmp_tb limit ${pager.startIndex-1},${pageSize}) a
</select>
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List"/> from SAR_STANDARDS_INFO
<include refid="Base_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
</select>
<sql id="SarStandardsInfo_Where_Clause">
left join TS_DICTYPE dicountry on (dicountry.dic_type_code = SAR_STANDARDS_INFO.country and dicountry.dic_id is
not null and dicountry.valid_flag = 0)
left join TS_DICTYPE dicstandSort on (dicstandSort.dic_type_code = SAR_STANDARDS_INFO.stand_sort and
dicstandSort.dic_id is not null and dicstandSort.valid_flag = 0 and dicstandSort.PARENT_ID is null)
left join TS_DICTYPE dicstandState on (dicstandState.dic_type_code = SAR_STANDARDS_INFO.stand_state and
dicstandState.dic_id is not null and dicstandState.valid_flag = 0 )
left join TS_DICTYPE dicstandNature on (dicstandNature.dic_type_code = SAR_STANDARDS_INFO.stand_nature and
dicstandNature.dic_id is not null and dicstandNature.valid_flag = 0 )
left join SAR_STAND_MENU ON SAR_STANDARDS_INFO.id = SAR_STAND_MENU.stand_id
left join SAR_MENU on SAR_STAND_MENU.menu_id = SAR_MENU.id
left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id and SAR_STAND_ATTR_INFO.valid_flag=0)
left join TS_PERSON_COLLECT on (TS_PERSON_COLLECT.COLLECT_RES_ID = SAR_STANDARDS_INFO.id and TS_PERSON_COLLECT.VALID_FLAG=0)
where 1=1 and SAR_STANDARDS_INFO.valid_flag=0
<trim suffixOverrides=",">
<!-- 标准分类 国内标准,国外标准 必要搜索项 -->
<if test='standType != null and standType != "ALL"'>
and stand_type = #{standType}
</if>
<!-- 基本搜索项 -->
<!-- 国家、地区 -->
<if test="country != null">
and country = #{country}
</if>
<!-- 标准编号 -->
<if test="standNumber != null">
and (
(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
SAR_STANDARDS_INFO.STAND_YEAR) like concat(concat('%',#{standNumber}),'%') and SAR_STANDARDS_INFO.STAND_YEAR != '')
or (concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER) like concat(concat('%',#{standNumber}),'%')
and SAR_STANDARDS_INFO.STAND_YEAR = '')
or (stand_name like concat(concat('%',#{standNumber}),'%'))
)
</if>
<!-- 标准名称 -->
<if test="standName != null">
and stand_name like concat(concat('%',#{standName}),'%')
</if>
<if test="standEnName != null">
and stand_en_name like concat(concat('%',#{standEnName}),'%')
</if>
<!-- 标准状态 -->
<if test="standState != null">
and stand_state = #{standState}
</if>
<!-- 高级检索项 -->
<!-- 标准性质 -->
<if test="standNature != null">
and stand_nature = #{standNature}
</if>
<!-- 代替标准 允许输入的时候输入多个-->
<if test="replaceStandNum != null">
and replace_stand_num like concat(concat('%',#{replaceStandNum}),'%')
</if>
<!-- 被代替标准 -->
<if test="replacedStandNum != null">
and replaced_stand_num like concat(concat('%',#{replacedStandNum}),'%')
</if>
<!-- 目录判断 -->
<if test="menuId != null and menuId !='nomenu' and menuAllChildrenIdList != null">
and SAR_STAND_MENU.MENU_ID in
<foreach collection="menuAllChildrenIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<!-- 游离态标准查询 -->
<!-- <if test="menuId != null and menuId =='nomenu' and standType =='INLAND'">
and SAR_STAND_MENU.MENU_ID = (select SAR_MENU.id from SAR_MENU WHERE parent_id is null and sor_divide
='INLAND_STAND')
&lt;!&ndash;-查询游离态标准,编号和名称是分开的 &ndash;&gt;
<if test="standNumber != null">
and ((concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
SAR_STANDARDS_INFO.STAND_YEAR) like concat(concat('%',#{standNumber}),'%') and SAR_STANDARDS_INFO.STAND_YEAR is not null)
or (concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER) like concat(concat('%',#{standNumber}),'%')
and SAR_STANDARDS_INFO.STAND_YEAR is null))
</if>
</if>
<if test="menuId != null and menuId =='nomenu' and standType =='FOREIGN'">
and SAR_STAND_MENU.MENU_ID = (select SAR_MENU.id from SAR_MENU WHERE parent_id is null and sor_divide
='FOREIGN_STAND')
<if test="standNumber != null">
and ((concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
SAR_STANDARDS_INFO.STAND_YEAR) like concat(concat('%',#{standNumber}),'%') and SAR_STANDARDS_INFO.STAND_YEAR is not null)
or (concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER) like concat(concat('%',#{standNumber}),'%')
and SAR_STANDARDS_INFO.STAND_YEAR is null))
</if>
</if> -->
<!-- 当第一次进入页面未选择记录时-->
<!-- <if test="(menuId == null or menuId =='') and standType =='INLAND'">-->
<!-- and SAR_STAND_MENU.MENU_ID in (-->
<!-- select SAR_MENU.id from SAR_MENU start with id=(select SAR_MENU.id from SAR_MENU WHERE parent_id is null-->
<!-- and sor_divide-->
<!-- ='INLAND_STAND') connect by prior id= parent_id-->
<!-- )-->
<!-- </if>-->
<!-- 新修改需求,根据角色查询有权限的菜单数据-->
<if test="menuRoleList != null">
and SAR_STAND_MENU.MENU_ID in
<foreach collection="menuRoleList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<!-- <if test="(menuId == null or menuId =='') and standType =='FOREIGN'">-->
<!-- and SAR_STAND_MENU.MENU_ID in (-->
<!-- select SAR_MENU.id from SAR_MENU start with id=(select SAR_MENU.id from SAR_MENU WHERE parent_id is null-->
<!-- and sor_divide-->
<!-- ='FOREIGN_STAND') connect by prior id= parent_id-->
<!-- )-->
<!-- </if>-->
<!-- 导出数据过程中,选择的id -->
<if test="idlist != null">
and SAR_STANDARDS_INFO.id in
<foreach collection="idlist" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="standSort != null" >
and SAR_STANDARDS_INFO.stand_sort = #{standSort}
</if>
<!--内容摘要-->
<if test="synopsis != null" >
AND dbms_lob.instr(SYNOPSIS, #{synopsis} ,1,1) > 0
</if>
<if test="collectMenuId != null">
and SAR_STANDARDS_INFO.id in (
select COLLECT_RES_ID from TS_PERSON_COLLECT where TS_PERSON_COLLECT.VALID_FLAG=0
and (collect_type='INLAND_STAND' or collect_type='FOREIGN_STAND')
and TS_PERSON_COLLECT.user_id=#{userId}
)
</if>
<if test='labelMenuId != null and labelMenuId == "gxhbq"'>
and SAR_STAND_ATTR_INFO.GXHBQ is not null
</if>
<if test='labelMenuId != null and labelMenuId != "gxhbq"'>
and SAR_STAND_ATTR_INFO.GXHBQ like concat(concat('%',#{labelMenuId}),'%')
</if>
<if test="applyArctic != null">
and SAR_STAND_ATTR_INFO.SYCLLX = #{applyArctic}
</if>
<if test="isRelateAccess != null" >
and is_relate_access = #{isRelateAccess}
</if>
<if test="advanceSearchStr != null">
and (${advanceSearchStr})
</if>
</trim>
</sql>
<!-- 分页查询-->
<select id="getSarStandardsInfoPage" resultMap="BaseResultMap"
parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage">
select * from
(select tmp_tb.* from
(select
<include refid="Base_Column_List_Show"/>,SAR_STAND_ATTR_INFO.CHJL AS CHJL,
(case WHEN dicstandState.DIC_TYPE_NAME = '草稿' THEN 1
WHEN dicstandState.DIC_TYPE_NAME = '征求意见稿' THEN 2
WHEN dicstandState.DIC_TYPE_NAME = '送审稿' THEN 3
WHEN dicstandState.DIC_TYPE_NAME = '报批稿' THEN 4
WHEN dicstandState.DIC_TYPE_NAME = '发布稿' THEN 5
WHEN dicstandState.DIC_TYPE_NAME = '已实施' THEN 6
WHEN dicstandState.DIC_TYPE_NAME = '计划修订' THEN 7
WHEN dicstandState.DIC_TYPE_NAME = '修订中' THEN 8
WHEN dicstandState.DIC_TYPE_NAME = '已修订' THEN 9
WHEN dicstandState.DIC_TYPE_NAME = '已作废' THEN 10
WHEN dicstandState.DIC_TYPE_NAME IS NULL THEN 11
WHEN dicstandState.DIC_TYPE_NAME ='' THEN 11
END) AS paixu,
(
CASE
WHEN ZCCSSRQ = 'TBD' THEN '6999-01-01'
WHEN ZCCSSRQ = '已发布' THEN '7000-01-01'
WHEN ZCCSSRQ = '已实施' THEN '7999-01-01'
WHEN ZCCSSRQ = 'N/A' THEN '8999-01-01'
WHEN ZCCSSRQ IS NULL THEN '9999-01-01'
WHEN ZCCSSRQ ='' THEN '9999-01-01'
ELSE ZCCSSRQ
END
) AS ZCCSSRQPAIXU,
(
CASE
WHEN XCXSSRQ = 'TBD' THEN '6999-01-01'
WHEN XCXSSRQ = '已发布' THEN '7000-01-01'
WHEN XCXSSRQ = '已实施' THEN '7999-01-01'
WHEN XCXSSRQ = 'N/A' THEN '8999-01-01'
WHEN XCXSSRQ IS NULL THEN '9999-01-01'
WHEN XCXSSRQ ='' THEN '9999-01-01'
ELSE XCXSSRQ
END
) AS XCXSSRQPAIXU,
(
CASE
WHEN SAR_STANDARDS_INFO.issue_time = 'TBD' THEN '6999-01-01'
WHEN SAR_STANDARDS_INFO.issue_time = '已发布' THEN '7000-01-01'
WHEN SAR_STANDARDS_INFO.issue_time = '已实施' THEN '7999-01-01'
WHEN SAR_STANDARDS_INFO.issue_time = 'N/A' THEN '8999-01-01'
WHEN SAR_STANDARDS_INFO.issue_time IS NULL THEN '9999-01-01'
WHEN SAR_STANDARDS_INFO.issue_time ='' THEN '9999-01-01'
ELSE SAR_STANDARDS_INFO.issue_time
END
) AS issueTime
from SAR_STANDARDS_INFO
<include refid="SarStandardsInfo_Where_Clause"/>
GROUP BY <include refid="Group_Column_List_Show"/>,CHJL,SAR_STAND_ATTR_INFO.XCXSSRQ,SAR_STAND_ATTR_INFO.ZCCSSRQ
order by
${orderBy1} ${order1},SAR_STANDARDS_INFO.id
) tmp_tb limit ${pager.startIndex-1},${pageSize}) a
</select>
<!--FIELD(SAR_STANDARDS_INFO.issue_time,'已发布'), FIELD(SAR_STANDARDS_INFO.issue_time,'TBD'), FIELD(SAR_STANDARDS_INFO.issue_time,'N/A') ,-->
<!--if(isnull(SAR_STANDARDS_INFO.issue_time),0,1) desc ,-->
<!-- 分页查询条件查询一共有多少条数据,配合分页 -->
<select id="getSarStandardsInfoCount" resultType="java.lang.Integer"
parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage">
select count(1) from (select count(*) from SAR_STANDARDS_INFO
<include refid="SarStandardsInfo_Where_Clause"/>
GROUP BY SAR_STANDARDS_INFO.id) a
</select>
<select id="selectByPrimaryKeyAndModifyTime" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo">
select
<include refid="Base_Column_List"/>
from SAR_STANDARDS_INFO
where id = #{id} and valid_flag=0
<if test="modifyTime != null">
and (modify_time &gt; #{modifyTime} or modify_time &lt; #{modifyTime}) a
</if>
</select>
<!-- 根据标准号查询-->
<select id="selectStandardsByStandnumber" resultMap="BaseResultMap"
parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo">
select
<include refid="Base_Column_List"/>
from
SAR_STANDARDS_INFO
left join TS_DICTYPE dicstandSort on (dicstandSort.dic_type_code = SAR_STANDARDS_INFO.stand_sort and
dicstandSort.dic_id is not null and dicstandSort.valid_flag = 0 and dicstandSort.PARENT_ID is null)
where SAR_STANDARDS_INFO.valid_flag = 0
<!-- 标准类型 -->
<if test="standType != null">
and stand_type = #{standType}
</if>
<if test="standNumber != null">
and ((concat(dicstandSort.DIC_TYPE_NAME,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
SAR_STANDARDS_INFO.STAND_YEAR) = ( #{standNumber}) and SAR_STANDARDS_INFO.STAND_YEAR != '')
or (concat(dicstandSort.DIC_TYPE_NAME,' ',SAR_STANDARDS_INFO.STAND_NUMBER) = ( #{standNumber})
and SAR_STANDARDS_INFO.STAND_YEAR = '')
)
</if>
<if test="sychronId != null">
and id != #{sychronId}
</if>
</select>
<!-- 查询表中是否存在某字段-->
<select id="selectStandColumn" resultType="java.lang.Integer" parameterType="java.lang.String">
SELECT COUNT(*)
FROM information_schema.columns
WHERE table_name = 'SAR_STANDARDS_INFO' AND column_name = #{columnName}
</select>
<!-- 统计更新过的标准数量-->
<select id="selectCounterStandardsCount" resultType="java.lang.Integer" parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo">
SELECT count(1)
FROM SAR_STANDARDS_INFO
WHERE STAND_TYPE = #{standType} And Valid_flag = 0
<if test="modifyTime != null">
and MODIFY_TIME > #{modifyTime}
</if>
</select>
<update id="updateByStandNum" parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo">
update SAR_STANDARDS_INFO set
stand_state=#{standState} where 1=1 and valid_flag=0
<if test="standSort != null">
and stand_sort = #{standSort}
</if>
<if test="standNumber != null">
and stand_Number = #{standNumber}
</if>
<if test="standYear != null">
and stand_year = #{standYear}
</if>
</update>
<select id="selectStandardsInfoByIdAndRole" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage">
select SAR_STANDARDS_INFO.id
from SAR_STANDARDS_INFO
left join SAR_STAND_MENU on SAR_STANDARDS_INFO.id=SAR_STAND_MENU.stand_id
where SAR_STANDARDS_INFO.valid_flag=0
and SAR_STAND_MENU.valid_flag=0
<if test="id != null">
and SAR_STANDARDS_INFO.id = #{id}
</if>
<if test="menuRoleList != null">
and SAR_STAND_MENU.MENU_ID in
<foreach collection="menuRoleList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<delete id="deleteByPrimaryKeyFlag" parameterType="java.lang.String">
delete from SAR_STANDARDS_INFO
where id = #{id} and valid_flag=1
</delete>
<update id="updateReplacedNumById" parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo">
update SAR_STANDARDS_INFO set REPLACED_STAND_NUM = #{replacedStandNum} where id = #{id}
</update>
<update id="updateCitedStandById" parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo">
update SAR_STANDARDS_INFO set CITED_STAND = #{citedStand} where id = #{id}
</update>
<select id="getSarStandardsExportInfo" resultMap="BaseResultMapExcel"
parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage">
select<include refid="Base_Column_List_Show"/>
from SAR_STANDARDS_INFO
<include refid="SarStandardsInfo_Where_Clause"/>
GROUP BY <include refid="Group_Column_List_Show"/>
order by SAR_STANDARDS_INFO.issue_time is null,SAR_STANDARDS_INFO.issue_time desc,SAR_STANDARDS_INFO.id
</select>
<select id="selectStandardsInfoByKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List_Show"/>
from SAR_STANDARDS_INFO
left join TS_DICTYPE dicountry on (dicountry.dic_type_code = SAR_STANDARDS_INFO.country and dicountry.dic_id is
not null and dicountry.valid_flag = 0)
left join TS_DICTYPE dicstandSort on (dicstandSort.dic_type_code = SAR_STANDARDS_INFO.stand_sort and
dicstandSort.dic_id is not null and dicstandSort.valid_flag = 0 and dicstandSort.PARENT_ID is null)
left join TS_DICTYPE dicstandState on (dicstandState.dic_type_code = SAR_STANDARDS_INFO.stand_state and
dicstandState.dic_id is not null and dicstandState.valid_flag = 0 )
left join TS_DICTYPE dicstandNature on (dicstandNature.dic_type_code = SAR_STANDARDS_INFO.stand_nature and
dicstandNature.dic_id is not null and dicstandNature.valid_flag = 0 )
left join SAR_STAND_MENU ON SAR_STANDARDS_INFO.id = SAR_STAND_MENU.stand_id
left join SAR_MENU on SAR_STAND_MENU.menu_id = SAR_MENU.id
where SAR_STANDARDS_INFO.id = #{id}
GROUP BY <include refid="Group_Column_List_Show"/>
</select>
<select id="selectRecommendStand" resultType="com.adc.da.slrs.sarStandardsInfo.entity.RecommendVO"
parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage">
select tmp_tb.* from
(select
if(
SAR_STANDARDS_INFO.STAND_YEAR='',
CONCAT(SAR_STANDARDS_INFO.stand_sort,' ',SAR_STANDARDS_INFO.stand_number),
CONCAT(SAR_STANDARDS_INFO.stand_sort,' ',SAR_STANDARDS_INFO.stand_number,'-',SAR_STANDARDS_INFO.stand_year)
) as numberShow,
SAR_STANDARDS_INFO.stand_name as nameShow,
SAR_STANDARDS_INFO.id,
concat(SAR_STANDARDS_INFO.stand_type,'_STAND') as typeShow
from SAR_STANDARDS_INFO
where SAR_STANDARDS_INFO.valid_flag = '0'
<if test="id != null">
and id != #{id}
</if>
<!-- 标准种类-->
<if test="standSort != null">
and stand_sort = #{standSort}
</if>
<if test="standNumber != null">
or stand_number like concat(concat('%',#{standNumber}),'%')
</if>
<if test="standName != null">
or stand_name like concat(concat('%',#{standName}),'%')
</if>
order by modify_time desc
) tmp_tb limit 0,5
</select>
<select id="countReplaceMsg" resultType="java.lang.String" parameterType="java.lang.String">
SELECT SAR_STANDARDS_INFO.stand_state
FROM SAR_STANDARDS_INFO
left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id and SAR_STAND_ATTR_INFO.valid_flag=0)
WHERE SAR_STAND_ATTR_INFO.DTBJH like concat(concat('%',#{standNum}),'%') and SAR_STANDARDS_INFO.valid_flag=0
</select>
<select id="selectStandToUpState" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>,
SAR_STAND_ATTR_INFO.XCXSSRQ as allPutTime
from SAR_STANDARDS_INFO
left join TS_DICTYPE dicstandState on (dicstandState.dic_type_code = SAR_STANDARDS_INFO.stand_state and
dicstandState.dic_id is not null and dicstandState.valid_flag = 0 )
left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id and SAR_STAND_ATTR_INFO.valid_flag=0)
where SAR_STANDARDS_INFO.valid_flag=0 and dicstandState.DIC_TYPE_NAME!=#{stateName}
and SAR_STAND_ATTR_INFO.XCXSSRQ != ''
</select>
<select id="selectStandToUpRepState" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>,dicstandState.DIC_TYPE_NAME as standStateShow,SAR_STAND_ATTR_INFO.DTBJH as replace_stand_num
from SAR_STANDARDS_INFO
left join TS_DICTYPE dicstandState on (dicstandState.dic_type_code = SAR_STANDARDS_INFO.stand_state and
dicstandState.dic_id is not null and dicstandState.valid_flag = 0 )
left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id and SAR_STAND_ATTR_INFO.valid_flag=0)
where SAR_STANDARDS_INFO.valid_flag=0 and dicstandState.DIC_TYPE_NAME != ''
and SAR_STAND_ATTR_INFO.DTBJH != ''
</select>
<select id="selectStandToUpRepAndTime" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>,dicstandState.DIC_TYPE_NAME as standStateShow,
SAR_STAND_ATTR_INFO.DTBJH as replace_stand_num,
concat(SAR_STAND_ATTR_INFO.XCXSSRQ,',',SAR_STAND_ATTR_INFO.ZCCSSRQ) as allPutTime
from SAR_STANDARDS_INFO
left join TS_DICTYPE dicstandState on (dicstandState.dic_type_code = SAR_STANDARDS_INFO.stand_state and
dicstandState.dic_id is not null and dicstandState.valid_flag = 0 )
left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id and SAR_STAND_ATTR_INFO.valid_flag=0)
where SAR_STANDARDS_INFO.valid_flag=0
and SAR_STAND_ATTR_INFO.DTBJH != ''
and (SAR_STAND_ATTR_INFO.XCXSSRQ != '' or SAR_STAND_ATTR_INFO.ZCCSSRQ != '')
</select>
<select id="selectIsExit" resultType="java.lang.Integer">
select count(*) from SAR_STANDARDS_INFO where id = #{id} and valid_flag != 0
</select>
<update id="updateStateById" parameterType="java.lang.String">
update SAR_STANDARDS_INFO set stand_state = #{state}
where id in
<foreach item="item" collection="list" open="(" separator="," close=")" index="index">
#{item}
</foreach>
</update>
<select id="selectStandardsInfoByIdAndRoleAll" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage">
select SAR_STANDARDS_INFO.id
from SAR_STANDARDS_INFO
where
SAR_STANDARDS_INFO.valid_flag=1
<if test="id != null">
and SAR_STANDARDS_INFO.id = #{id}
</if>
</select>
<select id="selectStandardsInfoBynumber" resultMap="BaseResultMap"
parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage">
select * from
(select tmp_tb.* from
(select
<include refid="Base_Column_List_Show"/>,SAR_STAND_ATTR_INFO.CHJL AS CHJL
from SAR_STANDARDS_INFO
left join TS_DICTYPE dicountry on (dicountry.dic_type_code = SAR_STANDARDS_INFO.country and dicountry.dic_id is
not null and dicountry.valid_flag = 0)
left join TS_DICTYPE dicstandSort on (dicstandSort.dic_type_code = SAR_STANDARDS_INFO.stand_sort and
dicstandSort.dic_id is not null and dicstandSort.valid_flag = 0 and dicstandSort.PARENT_ID is null)
left join TS_DICTYPE dicstandState on (dicstandState.dic_type_code = SAR_STANDARDS_INFO.stand_state and
dicstandState.dic_id is not null and dicstandState.valid_flag = 0 )
left join TS_DICTYPE dicstandNature on (dicstandNature.dic_type_code = SAR_STANDARDS_INFO.stand_nature and
dicstandNature.dic_id is not null and dicstandNature.valid_flag = 0 )
left join SAR_STAND_MENU ON SAR_STANDARDS_INFO.id = SAR_STAND_MENU.stand_id
left join SAR_MENU on SAR_STAND_MENU.menu_id = SAR_MENU.id
left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id and SAR_STAND_ATTR_INFO.valid_flag=0)
left join TS_PERSON_COLLECT on (TS_PERSON_COLLECT.COLLECT_RES_ID = SAR_STANDARDS_INFO.id and TS_PERSON_COLLECT.VALID_FLAG=0)
where 1=1
<if test="standNumber != null">
and
concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
SAR_STANDARDS_INFO.STAND_YEAR) = #{standNumber}
</if>
<if test="id != null">
and SAR_STANDARDS_INFO.id = #{id}
</if>
GROUP BY <include refid="Group_Column_List_Show"/>,CHJL
order by SAR_STANDARDS_INFO.issue_time is null, SAR_STANDARDS_INFO.issue_time desc,SAR_STANDARDS_INFO.id
) tmp_tb limit ${pager.startIndex-1},${pageSize}) a
</select>
</mapper>