259 lines
7.3 KiB
XML
259 lines
7.3 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.zcloud.mapper.dsno2.hiddenDangerCheckStandardLibrary.CommonItemMapper">
|
||
|
|
||
|
<!--表名 -->
|
||
|
<sql id="tableName">
|
||
|
BUS_HIDDENDANGERCHECKSTANDARD_COMMON_ITEM
|
||
|
</sql>
|
||
|
|
||
|
<!--数据字典表名 -->
|
||
|
<sql id="dicTableName">
|
||
|
SYS_DICTIONARIES
|
||
|
</sql>
|
||
|
|
||
|
<!-- 字段 -->
|
||
|
<sql id="Field">
|
||
|
f.COMMON_ID,
|
||
|
f.CHECK_CATEGORY,
|
||
|
f.CHECK_ITEM,
|
||
|
f.CHECK_CONTENT,
|
||
|
f.CHECK_STANDARD,
|
||
|
f.REFERENCE_BASIS,
|
||
|
f.CHECK_QUALIFIED,
|
||
|
f.CHECK_UNQUALIFIED,
|
||
|
f.OPERATION_TYPE,
|
||
|
f.COMMON_ITEM_SORT,
|
||
|
f.ISDELETE,
|
||
|
f.CREATOR_ID,
|
||
|
f.CREATOR_NAME,
|
||
|
f.CREATED_TIME,
|
||
|
f.OPERATOR_ID,
|
||
|
f.OPERATOR_NAME,
|
||
|
f.OPERATE_TIME,
|
||
|
f.DELETEOR_ID,
|
||
|
f.DELETEOR_NAME,
|
||
|
f.DELETE_TIME,
|
||
|
f.COMMON_ITEM_ID
|
||
|
</sql>
|
||
|
|
||
|
<!-- 字段用于新增 -->
|
||
|
<sql id="Field2">
|
||
|
COMMON_ID,
|
||
|
CHECK_CATEGORY,
|
||
|
CHECK_ITEM,
|
||
|
CHECK_CONTENT,
|
||
|
CHECK_STANDARD,
|
||
|
REFERENCE_BASIS,
|
||
|
CHECK_QUALIFIED,
|
||
|
CHECK_UNQUALIFIED,
|
||
|
OPERATION_TYPE,
|
||
|
COMMON_ITEM_SORT,
|
||
|
ISDELETE,
|
||
|
CREATOR_ID,
|
||
|
CREATOR_NAME,
|
||
|
CREATED_TIME,
|
||
|
OPERATOR_ID,
|
||
|
OPERATOR_NAME,
|
||
|
OPERATE_TIME,
|
||
|
DELETEOR_ID,
|
||
|
DELETEOR_NAME,
|
||
|
DELETE_TIME,
|
||
|
COMMON_ITEM_ID
|
||
|
</sql>
|
||
|
|
||
|
<!-- 字段值 -->
|
||
|
<sql id="FieldValue">
|
||
|
#{COMMON_ID},
|
||
|
#{CHECK_CATEGORY},
|
||
|
#{CHECK_ITEM},
|
||
|
#{CHECK_CONTENT},
|
||
|
#{CHECK_STANDARD},
|
||
|
#{REFERENCE_BASIS},
|
||
|
#{CHECK_QUALIFIED},
|
||
|
#{CHECK_UNQUALIFIED},
|
||
|
#{OPERATION_TYPE},
|
||
|
#{COMMON_ITEM_SORT},
|
||
|
#{ISDELETE},
|
||
|
#{CREATOR_ID},
|
||
|
#{CREATOR_NAME},
|
||
|
#{CREATED_TIME},
|
||
|
#{OPERATOR_ID},
|
||
|
#{OPERATOR_NAME},
|
||
|
#{OPERATE_TIME},
|
||
|
#{DELETEOR_ID},
|
||
|
#{DELETEOR_NAME},
|
||
|
#{DELETE_TIME},
|
||
|
#{COMMON_ITEM_ID}
|
||
|
</sql>
|
||
|
|
||
|
<!-- 新增-->
|
||
|
<insert id="save" parameterType="pd">
|
||
|
insert into
|
||
|
<include refid="tableName"></include>
|
||
|
(
|
||
|
<include refid="Field2"></include>
|
||
|
) values (
|
||
|
<include refid="FieldValue"></include>
|
||
|
)
|
||
|
</insert>
|
||
|
|
||
|
<!-- 删除-->
|
||
|
<delete id="delete" parameterType="pd">
|
||
|
update
|
||
|
<include refid="tableName"></include>
|
||
|
set
|
||
|
ISDELETE = '1',
|
||
|
DELETEOR_ID = #{DELETEOR_ID},
|
||
|
DELETEOR_NAME = #{DELETEOR_NAME},
|
||
|
DELETE_TIME = #{DELETE_TIME}
|
||
|
where
|
||
|
COMMON_ITEM_ID = #{COMMON_ITEM_ID}
|
||
|
</delete>
|
||
|
|
||
|
<!-- 修改 -->
|
||
|
<update id="edit" parameterType="pd">
|
||
|
update
|
||
|
<include refid="tableName"></include>
|
||
|
set
|
||
|
<if test="COMMON_ID != null and COMMON_ID != ''">
|
||
|
COMMON_ID = #{COMMON_ID},
|
||
|
</if>
|
||
|
<if test="CHECK_CATEGORY != null and CHECK_CATEGORY != ''">
|
||
|
CHECK_CATEGORY = #{CHECK_CATEGORY},
|
||
|
</if>
|
||
|
<if test="CHECK_ITEM != null and CHECK_ITEM != ''">
|
||
|
CHECK_ITEM = #{CHECK_ITEM},
|
||
|
</if>
|
||
|
<if test="CHECK_CONTENT != null and CHECK_CONTENT != ''">
|
||
|
CHECK_CONTENT = #{CHECK_CONTENT},
|
||
|
</if>
|
||
|
<if test="CHECK_STANDARD != null and CHECK_STANDARD != ''">
|
||
|
CHECK_STANDARD = #{CHECK_STANDARD},
|
||
|
</if>
|
||
|
<if test="REFERENCE_BASIS != null and REFERENCE_BASIS != ''">
|
||
|
REFERENCE_BASIS = #{REFERENCE_BASIS},
|
||
|
</if>
|
||
|
<if test="CHECK_QUALIFIED != null and CHECK_QUALIFIED != ''">
|
||
|
CHECK_QUALIFIED = #{CHECK_QUALIFIED},
|
||
|
</if>
|
||
|
<if test="CHECK_UNQUALIFIED != null and CHECK_UNQUALIFIED != ''">
|
||
|
CHECK_UNQUALIFIED = #{CHECK_UNQUALIFIED},
|
||
|
</if>
|
||
|
<if test="OPERATION_TYPE != null and OPERATION_TYPE != ''">
|
||
|
OPERATION_TYPE = #{OPERATION_TYPE},
|
||
|
</if>
|
||
|
<if test="COMMON_ITEM_SORT != null">
|
||
|
COMMON_ITEM_SORT = #{COMMON_ITEM_SORT},
|
||
|
</if>
|
||
|
<if test="ISDELETE != null and ISDELETE != ''">
|
||
|
ISDELETE = #{ISDELETE},
|
||
|
</if>
|
||
|
<if test="CREATOR_ID != null and CREATOR_ID != ''">
|
||
|
CREATOR_ID = #{CREATOR_ID},
|
||
|
</if>
|
||
|
<if test="CREATOR_NAME != null and CREATOR_NAME != ''">
|
||
|
CREATOR_NAME = #{CREATOR_NAME},
|
||
|
</if>
|
||
|
<if test="CREATED_TIME != null and CREATED_TIME != ''">
|
||
|
CREATED_TIME = #{CREATED_TIME},
|
||
|
</if>
|
||
|
<if test="OPERATOR_ID != null and OPERATOR_ID != ''">
|
||
|
OPERATOR_ID = #{OPERATOR_ID},
|
||
|
</if>
|
||
|
<if test="OPERATOR_NAME != null and OPERATOR_NAME != ''">
|
||
|
OPERATOR_NAME = #{OPERATOR_NAME},
|
||
|
</if>
|
||
|
<if test="OPERATE_TIME != null and OPERATE_TIME != ''">
|
||
|
OPERATE_TIME = #{OPERATE_TIME},
|
||
|
</if>
|
||
|
<if test="DELETEOR_ID != null and DELETEOR_ID != ''">
|
||
|
DELETEOR_ID = #{DELETEOR_ID},
|
||
|
</if>
|
||
|
<if test="DELETEOR_NAME != null and DELETEOR_NAME != ''">
|
||
|
DELETEOR_NAME = #{DELETEOR_NAME},
|
||
|
</if>
|
||
|
<if test="DELETE_TIME != null and DELETE_TIME != ''">
|
||
|
DELETE_TIME = #{DELETE_TIME},
|
||
|
</if>
|
||
|
COMMON_ITEM_ID = COMMON_ITEM_ID
|
||
|
where
|
||
|
COMMON_ITEM_ID = #{COMMON_ITEM_ID}
|
||
|
</update>
|
||
|
|
||
|
|
||
|
<!-- 通过ID获取数据 -->
|
||
|
<select id="findById" parameterType="pd" resultType="pd">
|
||
|
select
|
||
|
<include refid="Field"></include>
|
||
|
from
|
||
|
<include refid="tableName"></include> f
|
||
|
where
|
||
|
f.COMMON_ITEM_ID = #{COMMON_ITEM_ID}
|
||
|
</select>
|
||
|
|
||
|
<!-- 列表 -->
|
||
|
<select id="datalistPage" parameterType="page" resultType="pd">
|
||
|
select
|
||
|
dca.DICTIONARY_NAME CHECK_CATEGORY_NAME,
|
||
|
di.DICTIONARY_NAME CHECK_ITEM_NAME,
|
||
|
dco.DICTIONARY_NAME CHECK_CONTENT_NAME,
|
||
|
<include refid="Field"></include>
|
||
|
from
|
||
|
<include refid="tableName"></include> f
|
||
|
LEFT JOIN BUS_HIDDENDANGERCHECKSTANDARD_DICTIONARY dca on dca.DICTIONARY_ID = f.CHECK_CATEGORY and dca.DICTIONARY_LEVEL = 1
|
||
|
LEFT JOIN BUS_HIDDENDANGERCHECKSTANDARD_DICTIONARY di on di.DICTIONARY_ID = f.CHECK_ITEM and di.DICTIONARY_LEVEL = 2
|
||
|
LEFT JOIN BUS_HIDDENDANGERCHECKSTANDARD_DICTIONARY dco on dco.DICTIONARY_ID = f.CHECK_CONTENT and dco.DICTIONARY_LEVEL = 3
|
||
|
where f.ISDELETE = '0'
|
||
|
<if test="pd.COMMON_ID != null and pd.COMMON_ID != ''">
|
||
|
and f.COMMON_ID = #{pd.COMMON_ID}
|
||
|
</if>
|
||
|
<if test="pd.CHECK_CATEGORY != null and pd.CHECK_CATEGORY != ''">
|
||
|
and f.CHECK_CATEGORY = #{pd.CHECK_CATEGORY}
|
||
|
</if>
|
||
|
<if test="pd.CHECK_CATEGORY != null and pd.CHECK_CATEGORY != ''">
|
||
|
and f.HIDDEN_DESCR like CONCAT(CONCAT('%', #{pd.HIDDEN_DESCR}),'%')
|
||
|
</if>
|
||
|
<if test="pd.HIDDEN_DESCR != null and pd.HIDDEN_DESCR != ''">
|
||
|
and f.HIDDEN_DESCR like CONCAT(CONCAT('%', #{pd.HIDDEN_DESCR}),'%')
|
||
|
</if>
|
||
|
order by dca.DICTIONARY_SORT asc, di.DICTIONARY_SORT asc, dco.DICTIONARY_SORT asc, f.ITEM_SORT asc
|
||
|
</select>
|
||
|
|
||
|
<!-- 列表(全部) -->
|
||
|
<select id="listAll" parameterType="pd" resultType="pd">
|
||
|
select
|
||
|
dca.DICTIONARY_NAME CHECK_CATEGORY_NAME,
|
||
|
di.DICTIONARY_NAME CHECK_ITEM_NAME,
|
||
|
dco.DICTIONARY_NAME CHECK_CONTENT_NAME,
|
||
|
<include refid="Field"></include>
|
||
|
from
|
||
|
<include refid="tableName"></include> f
|
||
|
LEFT JOIN BUS_HIDDENDANGERCHECKSTANDARD_DICTIONARY dca on dca.DICTIONARY_ID = f.CHECK_CATEGORY and dca.DICTIONARY_LEVEL = 1
|
||
|
LEFT JOIN BUS_HIDDENDANGERCHECKSTANDARD_DICTIONARY di on di.DICTIONARY_ID = f.CHECK_ITEM and di.DICTIONARY_LEVEL = 2
|
||
|
LEFT JOIN BUS_HIDDENDANGERCHECKSTANDARD_DICTIONARY dco on dco.DICTIONARY_ID = f.CHECK_CONTENT and dco.DICTIONARY_LEVEL = 3
|
||
|
where f.ISDELETE = '0'
|
||
|
<if test="pd.COMMON_ID != null and pd.COMMON_ID != ''">
|
||
|
and f.COMMON_ID = #{pd.COMMON_ID}
|
||
|
</if>
|
||
|
order by dca.DICTIONARY_SORT asc, di.DICTIONARY_SORT asc, dco.DICTIONARY_SORT asc, f.ITEM_SORT asc
|
||
|
</select>
|
||
|
|
||
|
<!-- 批量删除 -->
|
||
|
<delete id="deleteAll" parameterType="pd">
|
||
|
update
|
||
|
<include refid="tableName"></include>
|
||
|
set
|
||
|
ISDELETE = '1',
|
||
|
DELETEOR_ID = #{DELETEOR_ID},
|
||
|
DELETEOR_NAME = #{DELETEOR_NAME},
|
||
|
DELETE_TIME = #{DELETE_TIME}
|
||
|
where
|
||
|
COMMON_ITEM_ID in
|
||
|
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
|
||
|
#{item}
|
||
|
</foreach>
|
||
|
</delete>
|
||
|
|
||
|
</mapper>
|