|
@@ -0,0 +1,418 @@
|
|
|
+<?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.ims.eval.dao.DeptResponsibilityTargetDao">
|
|
|
+
|
|
|
+ <sql id="deptResponsibilityTargetColumns">
|
|
|
+ a.id AS "id",
|
|
|
+ a.responsibility_id AS "responsibilityId",
|
|
|
+ a.indicator_id AS "indicatorId",
|
|
|
+ a.quantization_target AS "quantizationTarget",
|
|
|
+ a.quantization_target_actual AS "quantizationTargetActual",
|
|
|
+ a.evaluation_target AS "evaluationTarget",
|
|
|
+ a.evaluation_target_actual AS "evaluationTargetActual",
|
|
|
+ a.month_threshold AS "monthThreshold",
|
|
|
+ a.season_threshold AS "seasonThreshold",
|
|
|
+ a.year_threshold AS "yearThreshold",
|
|
|
+ a.direction AS "direction",
|
|
|
+ a.order_num AS "orderNum",
|
|
|
+ a.remark AS "remark",
|
|
|
+ a.target_1 AS "target1",
|
|
|
+ a.actual_1 AS "actual1",
|
|
|
+ a.target_2 AS "target2",
|
|
|
+ a.actual_2 AS "actual2",
|
|
|
+ a.target_3 AS "target3",
|
|
|
+ a.actual_3 AS "actual3",
|
|
|
+ a.target_4 AS "target4",
|
|
|
+ a.actual_4 AS "actual4",
|
|
|
+ a.target_5 AS "target5",
|
|
|
+ a.actual_5 AS "actual5",
|
|
|
+ a.target_6 AS "target6",
|
|
|
+ a.actual_6 AS "actual6",
|
|
|
+ a.target_7 AS "target7",
|
|
|
+ a.actual_7 AS "actual7",
|
|
|
+ a.target_8 AS "target8",
|
|
|
+ a.actual_8 AS "actual8",
|
|
|
+ a.target_9 AS "target9",
|
|
|
+ a.actual_9 AS "actual9",
|
|
|
+ a.target_10 AS "target10",
|
|
|
+ a.actual_10 AS "actual10",
|
|
|
+ a.target_11 AS "target11",
|
|
|
+ a.actual_11 AS "actual11",
|
|
|
+ a.target_12 AS "target12",
|
|
|
+ a.actual_12 AS "actual12"
|
|
|
+ </sql>
|
|
|
+
|
|
|
+
|
|
|
+ <sql id="whereStr">
|
|
|
+ 1=1
|
|
|
+ <!-- 快速定位 -->
|
|
|
+ <if test="sqlMap.key != null and sqlMap.key != ''">
|
|
|
+ AND (
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <!-- 高级查询dataFilter -->
|
|
|
+ <if test="sqlMap.df != null and sqlMap.df != ''">
|
|
|
+ AND ( ${sqlMap.df} )
|
|
|
+ </if>
|
|
|
+ <!-- 默认查询baseFilter -->
|
|
|
+ <if test="sqlMap.bf != null and sqlMap.bf != ''">
|
|
|
+ AND ( ${sqlMap.bf} )
|
|
|
+ </if>
|
|
|
+ <!-- 基本Query查询 -->
|
|
|
+ <if test="sqlMap.baseQuery != null and sqlMap.baseQuery != ''">
|
|
|
+ AND ( ${sqlMap.baseQuery} )
|
|
|
+ </if>
|
|
|
+ <!-- 特定Query查询 -->
|
|
|
+ <if test="sqlMap.specQuery != null and sqlMap.specQuery != ''">
|
|
|
+ AND ( ${sqlMap.specQuery} )
|
|
|
+ </if>
|
|
|
+ <if test="sqlMap.dsf != null and sqlMap.dsf != ''">
|
|
|
+ AND (${sqlMap.dsf})
|
|
|
+ </if>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="get" resultType="DeptResponsibilityTarget">
|
|
|
+ SELECT
|
|
|
+ <include refid="deptResponsibilityTargetColumns"/>
|
|
|
+ FROM public.{table.name} a
|
|
|
+
|
|
|
+ WHERE a.id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findList" resultType="DeptResponsibilityTarget">
|
|
|
+ SELECT
|
|
|
+ <include refid="deptResponsibilityTargetColumns"/>
|
|
|
+ FROM public.dept_responsibility_target a
|
|
|
+
|
|
|
+ <where>
|
|
|
+ <include refid="whereStr"/>
|
|
|
+ </where>
|
|
|
+ <choose>
|
|
|
+ <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
+ ORDER BY ${page.orderBy}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findAllList" resultType="DeptResponsibilityTarget">
|
|
|
+ SELECT
|
|
|
+ <include refid="deptResponsibilityTargetColumns"/>
|
|
|
+ FROM public.dept_responsibility_target a
|
|
|
+
|
|
|
+ <where>
|
|
|
+ <include refid="whereStr"/>
|
|
|
+ </where>
|
|
|
+ <choose>
|
|
|
+ <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
+ ORDER BY ${page.orderBy}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <sql id="insertColumns">
|
|
|
+ responsibility_id,
|
|
|
+ indicator_id,
|
|
|
+ quantization_target,
|
|
|
+ quantization_target_actual,
|
|
|
+ evaluation_target,
|
|
|
+ evaluation_target_actual,
|
|
|
+ month_threshold,
|
|
|
+ season_threshold,
|
|
|
+ year_threshold,
|
|
|
+ direction,
|
|
|
+ order_num,
|
|
|
+ remark,
|
|
|
+ target_1,
|
|
|
+ actual_1,
|
|
|
+ target_2,
|
|
|
+ actual_2,
|
|
|
+ target_3,
|
|
|
+ actual_3,
|
|
|
+ target_4,
|
|
|
+ actual_4,
|
|
|
+ target_5,
|
|
|
+ actual_5,
|
|
|
+ target_6,
|
|
|
+ actual_6,
|
|
|
+ target_7,
|
|
|
+ actual_7,
|
|
|
+ target_8,
|
|
|
+ actual_8,
|
|
|
+ target_9,
|
|
|
+ actual_9,
|
|
|
+ target_10,
|
|
|
+ actual_10,
|
|
|
+ target_11,
|
|
|
+ actual_11,
|
|
|
+ target_12,
|
|
|
+ actual_12
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <insert id="insert">
|
|
|
+ <selectKey keyProperty="id" resultType="String" order="BEFORE">
|
|
|
+ <choose>
|
|
|
+ <when test="id == null or id == ''">
|
|
|
+ select get_next_id('dept_responsibility_target','') from dual
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ select #{id} from dual
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </selectKey>
|
|
|
+ INSERT INTO dept_responsibility_target(
|
|
|
+ <include refid="insertColumns"/>
|
|
|
+ ) VALUES (
|
|
|
+ #{responsibilityId
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{indicatorId
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{quantizationTarget
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{quantizationTargetActual
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{evaluationTarget
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{evaluationTargetActual
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{monthThreshold
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{seasonThreshold
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{yearThreshold
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{direction
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{orderNum
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{remark
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{target1
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{actual1
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{target2
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{actual2
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{target3
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{actual3
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{target4
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{actual4
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{target5
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{actual5
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{target6
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{actual6
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{target7
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{actual7
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{target8
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{actual8
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{target9
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{actual9
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{target10
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{actual10
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{target11
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{actual11
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{target12
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+},
|
|
|
+ #{actual12
|
|
|
+, jdbcType=VARCHAR
|
|
|
+
|
|
|
+}
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertList">
|
|
|
+ INSERT INTO dept_responsibility_target(
|
|
|
+ <include refid="insertColumns"/>
|
|
|
+ ) select FFF.* from (
|
|
|
+ <foreach collection="list" item="item" index="index" separator="UNION ALL" >
|
|
|
+ select
|
|
|
+ #{item.responsibilityId, jdbcType=VARCHAR} as "responsibilityId",
|
|
|
+ #{item.indicatorId, jdbcType=VARCHAR} as "indicatorId",
|
|
|
+ #{item.quantizationTarget, jdbcType=VARCHAR} as "quantizationTarget",
|
|
|
+ #{item.quantizationTargetActual, jdbcType=VARCHAR} as "quantizationTargetActual",
|
|
|
+ #{item.evaluationTarget, jdbcType=VARCHAR} as "evaluationTarget",
|
|
|
+ #{item.evaluationTargetActual, jdbcType=VARCHAR} as "evaluationTargetActual",
|
|
|
+ #{item.monthThreshold, jdbcType=VARCHAR} as "monthThreshold",
|
|
|
+ #{item.seasonThreshold, jdbcType=VARCHAR} as "seasonThreshold",
|
|
|
+ #{item.yearThreshold, jdbcType=VARCHAR} as "yearThreshold",
|
|
|
+ #{item.direction, jdbcType=VARCHAR} as "direction",
|
|
|
+ #{item.orderNum, jdbcType=VARCHAR} as "orderNum",
|
|
|
+ #{item.remark, jdbcType=VARCHAR} as "remark",
|
|
|
+ #{item.target1, jdbcType=VARCHAR} as "target1",
|
|
|
+ #{item.actual1, jdbcType=VARCHAR} as "actual1",
|
|
|
+ #{item.target2, jdbcType=VARCHAR} as "target2",
|
|
|
+ #{item.actual2, jdbcType=VARCHAR} as "actual2",
|
|
|
+ #{item.target3, jdbcType=VARCHAR} as "target3",
|
|
|
+ #{item.actual3, jdbcType=VARCHAR} as "actual3",
|
|
|
+ #{item.target4, jdbcType=VARCHAR} as "target4",
|
|
|
+ #{item.actual4, jdbcType=VARCHAR} as "actual4",
|
|
|
+ #{item.target5, jdbcType=VARCHAR} as "target5",
|
|
|
+ #{item.actual5, jdbcType=VARCHAR} as "actual5",
|
|
|
+ #{item.target6, jdbcType=VARCHAR} as "target6",
|
|
|
+ #{item.actual6, jdbcType=VARCHAR} as "actual6",
|
|
|
+ #{item.target7, jdbcType=VARCHAR} as "target7",
|
|
|
+ #{item.actual7, jdbcType=VARCHAR} as "actual7",
|
|
|
+ #{item.target8, jdbcType=VARCHAR} as "target8",
|
|
|
+ #{item.actual8, jdbcType=VARCHAR} as "actual8",
|
|
|
+ #{item.target9, jdbcType=VARCHAR} as "target9",
|
|
|
+ #{item.actual9, jdbcType=VARCHAR} as "actual9",
|
|
|
+ #{item.target10, jdbcType=VARCHAR} as "target10",
|
|
|
+ #{item.actual10, jdbcType=VARCHAR} as "actual10",
|
|
|
+ #{item.target11, jdbcType=VARCHAR} as "target11",
|
|
|
+ #{item.actual11, jdbcType=VARCHAR} as "actual11",
|
|
|
+ #{item.target12, jdbcType=VARCHAR} as "target12",
|
|
|
+ #{item.actual12, jdbcType=VARCHAR} as "actual12"
|
|
|
+ from dual
|
|
|
+ </foreach>
|
|
|
+ ) FFF
|
|
|
+
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="update">
|
|
|
+ UPDATE dept_responsibility_target SET
|
|
|
+ id = #{id},
|
|
|
+ responsibility_id = #{responsibilityId},
|
|
|
+ indicator_id = #{indicatorId},
|
|
|
+ quantization_target = #{quantizationTarget},
|
|
|
+ quantization_target_actual = #{quantizationTargetActual},
|
|
|
+ evaluation_target = #{evaluationTarget},
|
|
|
+ evaluation_target_actual = #{evaluationTargetActual},
|
|
|
+ month_threshold = #{monthThreshold},
|
|
|
+ season_threshold = #{seasonThreshold},
|
|
|
+ year_threshold = #{yearThreshold},
|
|
|
+ direction = #{direction},
|
|
|
+ order_num = #{orderNum},
|
|
|
+ remark = #{remark},
|
|
|
+ target_1 = #{target1},
|
|
|
+ actual_1 = #{actual1},
|
|
|
+ target_2 = #{target2},
|
|
|
+ actual_2 = #{actual2},
|
|
|
+ target_3 = #{target3},
|
|
|
+ actual_3 = #{actual3},
|
|
|
+ target_4 = #{target4},
|
|
|
+ actual_4 = #{actual4},
|
|
|
+ target_5 = #{target5},
|
|
|
+ actual_5 = #{actual5},
|
|
|
+ target_6 = #{target6},
|
|
|
+ actual_6 = #{actual6},
|
|
|
+ target_7 = #{target7},
|
|
|
+ actual_7 = #{actual7},
|
|
|
+ target_8 = #{target8},
|
|
|
+ actual_8 = #{actual8},
|
|
|
+ target_9 = #{target9},
|
|
|
+ actual_9 = #{actual9},
|
|
|
+ target_10 = #{target10},
|
|
|
+ actual_10 = #{actual10},
|
|
|
+ target_11 = #{target11},
|
|
|
+ actual_11 = #{actual11},
|
|
|
+ target_12 = #{target12},
|
|
|
+ actual_12 = #{actual12}
|
|
|
+ WHERE id = #{id, jdbcType=VARCHAR}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="delete">
|
|
|
+ DELETE FROM public.dept_responsibility_target
|
|
|
+ WHERE
|
|
|
+ <choose>
|
|
|
+ <when test="id != null and id != ''">
|
|
|
+ id = #{id, jdbcType=VARCHAR}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </update>
|
|
|
+
|
|
|
+</mapper>
|