268 lines
12 KiB
XML
268 lines
12 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.adc.da.slrs.sarLawsItems.dao.SarLawsItemsDao">
|
|
|
|
<!-- Result Map-->
|
|
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarLawsItems.entity.SarLawsItems">
|
|
<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="laws_id" property="lawsId"/>
|
|
<result column="applyArcticShow" property="applyArcticShow"/>
|
|
<result column="energyKindShow" property="energyKindShow"/>
|
|
<result column="responsibleUnitShow" property="responsibleUnitShow"/>
|
|
<result column="MAINPOINTS_IMPEMENTATION" property="mainPointImplementation"/>
|
|
<result column="TERMS_CONDITIONS" property="termsConditions"/>
|
|
<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="dutyEngineerShow" property="dutyEngineerShow" />
|
|
<result column="responsibleUnitShow" property="responsibleUnitShow" />
|
|
<result column="foShow" property="foShow"/>
|
|
</resultMap>
|
|
|
|
<!-- SAR_LAWS_ITEMS table all fields -->
|
|
<sql id="Base_Column_List">
|
|
SAR_LAWS_ITEMS.modify_time, SAR_LAWS_ITEMS.creation_time, SAR_LAWS_ITEMS.creation_user, SAR_LAWS_ITEMS.valid_flag, SAR_LAWS_ITEMS.remarks, responsible_unit, energy_kind, apply_arctic, tack_time, parts, items_name, items_num, SAR_LAWS_ITEMS.laws_id,SAR_LAWS_ITEMS.id,SAR_LAWS_ITEMS.MAINPOINTS_IMPEMENTATION,SAR_LAWS_ITEMS.TERMS_CONDITIONS,
|
|
tsFo.UNAME as foShow,SAR_LAWS_ITEMS.duty_engineer,SAR_LAWS_ITEMS.svpps,SAR_LAWS_ITEMS.fo,
|
|
SAR_LAWS_ITEMS.claim_type,SAR_LAWS_ITEMS.bus_stand_cover,SAR_LAWS_ITEMS.file_type,dicClaimType.DIC_TYPE_NAME as claimTypeShow,tsdutyEngineer.UNAME as dutyEngineerShow
|
|
</sql>
|
|
|
|
<sql id="Base_Query_Column_List">
|
|
SAR_LAWS_ITEMS.modify_time, SAR_LAWS_ITEMS.creation_time, SAR_LAWS_ITEMS.creation_user, SAR_LAWS_ITEMS.valid_flag,
|
|
SAR_LAWS_ITEMS.remarks, responsible_unit, energy_kind, apply_arctic, tack_time, parts, items_name, items_num,
|
|
SAR_LAWS_ITEMS.laws_id,SAR_LAWS_ITEMS.id,SAR_LAWS_ITEMS.MAINPOINTS_IMPEMENTATION,SAR_LAWS_ITEMS.TERMS_CONDITIONS,
|
|
SAR_LAWS_ITEMS.duty_engineer,SAR_LAWS_ITEMS.svpps,SAR_LAWS_ITEMS.claim_type,SAR_LAWS_ITEMS.bus_stand_cover,
|
|
SAR_LAWS_ITEMS.file_type
|
|
</sql>
|
|
|
|
<!-- 查询条件 -->
|
|
<sql id="Base_Where_Clause">
|
|
left join TS_DICTYPE dicClaimType on (dicClaimType.dic_type_code = SAR_LAWS_ITEMS.claim_type and dicClaimType.dic_id is
|
|
not null and dicClaimType.valid_flag = 0)
|
|
left join TS_USER tsdutyEngineer on (tsdutyEngineer.USID = SAR_LAWS_ITEMS.duty_engineer and tsdutyEngineer.valid_flag=0
|
|
and tsdutyEngineer.DISABLE_FLAG=0)
|
|
left join TS_USER tsFo on (tsFo.USID = SAR_LAWS_ITEMS.fo and tsFo.valid_flag=0
|
|
and tsFo.DISABLE_FLAG=0)
|
|
where 1=1
|
|
<trim suffixOverrides=",">
|
|
<if test="fileType != null" >
|
|
and SAR_LAWS_ITEMS.file_type = #{fileType}
|
|
</if>
|
|
<if test="modifyTime != null">
|
|
and modify_time ${modifyTimeOperator} #{modifyTime}
|
|
</if>
|
|
<if test="modifyTime1 != null">
|
|
and modify_time >= #{modifyTime1}
|
|
</if>
|
|
<if test="modifyTime2 != null">
|
|
and modify_time <= #{modifyTime2}
|
|
</if>
|
|
<if test="creationTime != null">
|
|
and creation_time ${creationTimeOperator} #{creationTime}
|
|
</if>
|
|
<if test="creationTime1 != null">
|
|
and creation_time >= #{creationTime1}
|
|
</if>
|
|
<if test="creationTime2 != null">
|
|
and creation_time <= #{creationTime2}
|
|
</if>
|
|
<if test="creationUser != null">
|
|
and creation_user ${creationUserOperator} #{creationUser}
|
|
</if>
|
|
<if test="validFlag != null">
|
|
and SAR_LAWS_ITEMS.valid_flag ${validFlagOperator} #{validFlag}
|
|
</if>
|
|
<if test="remarks != null">
|
|
and SAR_LAWS_ITEMS.remarks ${remarksOperator} #{remarks}
|
|
</if>
|
|
<if test="responsibleUnit != null">
|
|
and SAR_LAWS_ITEMS.responsible_unit = #{responsibleUnit}
|
|
</if>
|
|
<if test="energyKind != null">
|
|
and energy_kind ${energyKindOperator} #{energyKind}
|
|
</if>
|
|
<if test="applyArctic != null">
|
|
and apply_arctic ${applyArcticOperator} #{applyArctic}
|
|
</if>
|
|
<if test="tackTime != null">
|
|
and tack_time ${tackTimeOperator} #{tackTime}
|
|
</if>
|
|
<if test="tackTime1 != null">
|
|
and tack_time >= #{tackTime1}
|
|
</if>
|
|
<if test="tackTime2 != null">
|
|
and tack_time <= #{tackTime2}
|
|
</if>
|
|
<if test="parts != null">
|
|
and SAR_LAWS_ITEMS.parts like concat(concat('%', #{parts}),'%')
|
|
</if>
|
|
<if test="nameOrRequest != null" >
|
|
and (SAR_LAWS_ITEMS.items_name like concat(concat('%', #{nameOrRequest}),'%') or SAR_LAWS_ITEMS.TERMS_CONDITIONS like concat(concat('%', #{nameOrRequest}),'%'))
|
|
</if>
|
|
<if test="itemsName != null">
|
|
and items_name ${itemsNameOperator} #{itemsName}
|
|
</if>
|
|
<if test="itemsNum != null">
|
|
and items_num ${itemsNumOperator} #{itemsNum}
|
|
</if>
|
|
<if test="lawsId != null">
|
|
and laws_id ${lawsIdOperator} #{lawsId}
|
|
</if>
|
|
<if test="id != null">
|
|
and SAR_LAWS_ITEMS.id ${idOperator} #{id}
|
|
</if>
|
|
<if test="idlist != null">
|
|
and SAR_LAWS_ITEMS.id in
|
|
<foreach collection="idlist" index="index" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
</if>
|
|
<if test="lawsId != null">
|
|
and SAR_LAWS_ITEMS.LAWS_ID = #{lawsId}
|
|
</if>
|
|
</trim>
|
|
</sql>
|
|
<sql id="Second_Where_Clause">
|
|
left join TS_DICTYPE dicClaimType on (dicClaimType.dic_type_code = SAR_LAWS_ITEMS.claim_type and dicClaimType.dic_id is
|
|
not null and dicClaimType.valid_flag = 0)
|
|
left join TS_USER tsdutyEngineer on (tsdutyEngineer.USID = SAR_LAWS_ITEMS.duty_engineer and tsdutyEngineer.valid_flag=0
|
|
and tsdutyEngineer.DISABLE_FLAG=0)
|
|
where 1=1
|
|
<trim suffixOverrides=",">
|
|
<if test="fileType != null" >
|
|
and SAR_LAWS_ITEMS.file_type = #{fileType}
|
|
</if>
|
|
<if test="modifyTime != null">
|
|
and modify_time ${modifyTimeOperator} #{modifyTime}
|
|
</if>
|
|
<if test="modifyTime1 != null">
|
|
and modify_time >= #{modifyTime1}
|
|
</if>
|
|
<if test="modifyTime2 != null">
|
|
and modify_time <= #{modifyTime2}
|
|
</if>
|
|
<if test="creationTime != null">
|
|
and creation_time ${creationTimeOperator} #{creationTime}
|
|
</if>
|
|
<if test="creationTime1 != null">
|
|
and creation_time >= #{creationTime1}
|
|
</if>
|
|
<if test="creationTime2 != null">
|
|
and creation_time <= #{creationTime2}
|
|
</if>
|
|
<if test="creationUser != null">
|
|
and creation_user ${creationUserOperator} #{creationUser}
|
|
</if>
|
|
<if test="validFlag != null">
|
|
and SAR_LAWS_ITEMS.valid_flag ${validFlagOperator} #{validFlag}
|
|
</if>
|
|
<if test="remarks != null">
|
|
and remarks ${remarksOperator} #{remarks}
|
|
</if>
|
|
<if test="responsibleUnit != null">
|
|
and responsible_unit = #{responsibleUnit}
|
|
</if>
|
|
<if test="energyKind != null">
|
|
and energy_kind ${energyKindOperator} #{energyKind}
|
|
</if>
|
|
<if test="applyArctic != null">
|
|
and apply_arctic ${applyArcticOperator} #{applyArctic}
|
|
</if>
|
|
<if test="tackTime != null">
|
|
and tack_time ${tackTimeOperator} #{tackTime}
|
|
</if>
|
|
<if test="tackTime1 != null">
|
|
and tack_time >= #{tackTime1}
|
|
</if>
|
|
<if test="tackTime2 != null">
|
|
and tack_time <= #{tackTime2}
|
|
</if>
|
|
<if test="parts != null">
|
|
and parts ${partsOperator} #{parts}
|
|
</if>
|
|
<if test="itemsName != null">
|
|
and items_name ${itemsNameOperator} #{itemsName}
|
|
</if>
|
|
<if test="itemsNum != null">
|
|
and items_num ${itemsNumOperator} #{itemsNum}
|
|
</if>
|
|
<if test="lawsId != null">
|
|
and laws_id ${lawsIdOperator} #{lawsId}
|
|
</if>
|
|
<if test="id != null">
|
|
and id ${idOperator} #{id}
|
|
</if>
|
|
<if test='proType != null and proType == "process"' >
|
|
and (SAR_LAWS_ITEMS.claim_type='L7N7EEDAPR' or SAR_LAWS_ITEMS.claim_type='RENVECPFGT')
|
|
</if>
|
|
</trim>
|
|
</sql>
|
|
|
|
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
|
select SAR_LAWS_ITEMS.*,
|
|
(
|
|
SELECT
|
|
group_concat(TS_DICTYPE.DIC_TYPE_NAME ORDER BY SAR_LAWS_ITEM_VAL.PROPERTY_TYPE separator ',')
|
|
FROM
|
|
SAR_LAWS_ITEM_VAL left join TS_DICTYPE on (TS_DICTYPE.DIC_TYPE_CODE = SAR_LAWS_ITEM_VAL.PROPERTY_VAL and
|
|
TS_DICTYPE.DIC_ID is not null)
|
|
WHERE
|
|
SAR_LAWS_ITEM_VAL.LAWS_ITEM_ID = SAR_LAWS_ITEMS.ID
|
|
AND SAR_LAWS_ITEM_VAL.PROPERTY_TYPE = 'APPLY_ARCTIC'
|
|
AND TS_DICTYPE.VALID_FLAG=0
|
|
) AS applyArcticShow,
|
|
(
|
|
SELECT
|
|
group_concat(TS_DICTYPE.DIC_TYPE_NAME ORDER BY SAR_LAWS_ITEM_VAL.PROPERTY_TYPE separator ',')
|
|
FROM
|
|
SAR_LAWS_ITEM_VAL left join TS_DICTYPE on (TS_DICTYPE.DIC_TYPE_CODE = SAR_LAWS_ITEM_VAL.PROPERTY_VAL and
|
|
TS_DICTYPE.DIC_ID is not null)
|
|
WHERE
|
|
SAR_LAWS_ITEM_VAL.LAWS_ITEM_ID = SAR_LAWS_ITEMS.ID
|
|
AND SAR_LAWS_ITEM_VAL.PROPERTY_TYPE = 'ENERGY_KIND'
|
|
AND TS_DICTYPE.VALID_FLAG=0
|
|
) AS energyKindShow,
|
|
TS_ORG.ORG_NAME as responsibleUnitShow
|
|
from SAR_LAWS_ITEMS left join TS_ORG on SAR_LAWS_ITEMS.RESPONSIBLE_UNIT = TS_ORG.ID
|
|
<include refid="Second_Where_Clause"/>
|
|
<if test="updateFlag != null and updateFlag != ''">
|
|
and SAR_LAWS_ITEMS.id != #{updateFlag}
|
|
</if>
|
|
<if test="pager.orderCondition != null and pager.orderCondition != ''">
|
|
${pager.orderCondition}
|
|
</if>
|
|
</select>
|
|
|
|
<select id="selectSvppsByStandId" parameterType="java.lang.String" resultType="java.lang.String">
|
|
select svpps from SAR_LAWS_ITEMS
|
|
where valid_flag=0 and svpps != ''
|
|
<if test="standId != null">
|
|
and laws_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>
|
|
</mapper>
|