191 lines
4.8 KiB
XML
191 lines
4.8 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.hx.slj.modules.assessmentCriterion.dao.IndexMapper">
|
|
<resultMap id="ACIndexPojo" type="com.hx.slj.modules.assessmentCriterion.entity.ACIndex">
|
|
<id property="id" column="id"/>
|
|
<result property="systemID" column="system_ID"/>
|
|
<result property="parentID" column="parent_id"/>
|
|
<result property="name" column="name"/>
|
|
<result property="level" column="level"/>
|
|
<result property="isFinal" column="isFinal"/>
|
|
<result property="description" column="description"/>
|
|
<result property="datasource" column="datasource"/>
|
|
<result property="score" column="score"/>
|
|
<result property="method" column="method"/>
|
|
<result property="evaluation" column="evaluation"/>
|
|
</resultMap>
|
|
|
|
<sql id="ACIndexColumns">
|
|
a.id,
|
|
a.system_ID AS systemID,
|
|
a.parent_id AS parentID,
|
|
a.parent_ids AS parentids,
|
|
a.name,
|
|
a.href,
|
|
a.target,
|
|
a.icon,
|
|
a.sort,
|
|
a.is_show,
|
|
a.permission,
|
|
a.level,
|
|
a.isFinal,
|
|
a.isRoot,
|
|
a.description,
|
|
a.datasource,
|
|
a.object,
|
|
a.score,
|
|
a.method,
|
|
a.evaluation,
|
|
a.create_by AS "createBy.id",
|
|
a.create_date,
|
|
a.update_by AS "updateBy.id",
|
|
a.update_date,
|
|
a.remarks,
|
|
a.del_flag
|
|
</sql>
|
|
|
|
<select id="get" resultType="com.hx.slj.modules.assessmentCriterion.entity.ACIndex">
|
|
SELECT
|
|
<include refid="ACIndexColumns"/>
|
|
FROM assessment_index a
|
|
WHERE a.id = #{id}
|
|
</select>
|
|
|
|
<select id="findUniqueByProperty" resultType="com.hx.slj.modules.assessmentCriterion.entity.ACIndex" statementType="STATEMENT">
|
|
select
|
|
<include refid="ACIndexColumns"/>
|
|
from assessment_index where ${propertyName} = ${value}
|
|
</select>
|
|
|
|
<select id="findList" resultType="com.hx.slj.modules.assessmentCriterion.entity.ACIndex">
|
|
SELECT
|
|
<include refid="ACIndexColumns"/>
|
|
FROM assessment_index a
|
|
WHERE a.del_flag = #{DEL_FLAG_NORMAL}
|
|
<if test="systemID != null and systemID != ''">
|
|
AND a.system_ID = #{systemID}
|
|
</if>
|
|
<if test="parentID != null and parentID != ''">
|
|
AND a.PARENT_ID = #{parentID}
|
|
</if>
|
|
<if test="isRoot != null and isRoot != ''">
|
|
AND a.isRoot = #{isRoot}
|
|
</if>
|
|
|
|
<if test="parentids!=null and parentids !=''">
|
|
AND parent_ids LIKE
|
|
<if test="dbName == 'oracle'">'%,'||#{parentids}||',%'</if>
|
|
<if test="dbName == 'mysql'">CONCAT('%,', #{parentids}, ',%')</if>
|
|
</if>
|
|
|
|
ORDER BY a.sort
|
|
</select>
|
|
|
|
<select id="findMap" resultMap="ACIndexPojo" parameterType="com.hx.slj.modules.assessmentCriterion.entity.ACIndex">
|
|
SELECT
|
|
<include refid="ACIndexColumns"/>
|
|
FROM assessment_index a
|
|
WHERE a.del_flag = #{DEL_FLAG_NORMAL}
|
|
<if test="systemID != null and systemID != ''">
|
|
AND a.system_ID = #{systemID}
|
|
</if>
|
|
<if test="parentID != null and parentID != ''">
|
|
AND a.PARENT_ID = #{parentID}
|
|
</if>
|
|
|
|
ORDER BY a.sort
|
|
</select>
|
|
|
|
<insert id="insert">
|
|
INSERT INTO assessment_index(
|
|
id,
|
|
system_ID,
|
|
parent_id,
|
|
parent_ids,
|
|
name,
|
|
href,
|
|
target,
|
|
icon,
|
|
sort,
|
|
is_show,
|
|
permission,
|
|
level,
|
|
isFinal,
|
|
isRoot,
|
|
description,
|
|
datasource,
|
|
object,
|
|
score,
|
|
method,
|
|
evaluation,
|
|
create_by,
|
|
create_date,
|
|
update_by,
|
|
update_date,
|
|
remarks,
|
|
del_flag
|
|
) VALUES (
|
|
#{id},
|
|
#{systemID},
|
|
#{parentID},
|
|
#{parentids},
|
|
#{name},
|
|
#{href},
|
|
#{target},
|
|
#{icon},
|
|
#{sort},
|
|
#{isShow},
|
|
#{permission},
|
|
#{level},
|
|
#{isFinal},
|
|
#{isRoot},
|
|
#{description},
|
|
#{datasource},
|
|
#{object},
|
|
#{score},
|
|
#{method},
|
|
#{evaluation},
|
|
#{createBy.id},
|
|
#{createDate},
|
|
#{updateBy.id},
|
|
#{updateDate},
|
|
#{remarks},
|
|
#{delFlag}
|
|
)
|
|
</insert>
|
|
|
|
<update id="update">
|
|
UPDATE assessment_index SET
|
|
name = #{name},
|
|
description = #{description},
|
|
datasource = #{datasource},
|
|
object = #{object},
|
|
score = #{score},
|
|
method = #{method},
|
|
evaluation = #{evaluation},
|
|
update_by = #{updateBy.id},
|
|
update_date = #{updateDate},
|
|
remarks = #{remarks},
|
|
isFinal=#{isFinal}
|
|
WHERE id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteBySystemId">
|
|
DELETE FROM assessment_index WHERE system_ID = #{systemID}
|
|
</delete>
|
|
<select id="getListByIn" resultType="com.hx.slj.modules.assessmentCriterion.entity.ACIndex">
|
|
SELECT
|
|
<include refid="ACIndexColumns"/>
|
|
FROM assessment_index a
|
|
WHERE a.id in ${id}
|
|
</select>
|
|
|
|
<update id="delete">
|
|
UPDATE assessment_index SET
|
|
del_flag = #{DEL_FLAG_DELETE}
|
|
WHERE id = #{id} OR parent_ids LIKE
|
|
<if test="dbName == 'oracle'">'%,'||#{id}||',%'</if>
|
|
<if test="dbName == 'mysql'">CONCAT('%,', #{id}, ',%')</if>
|
|
</update>
|
|
|
|
</mapper> |