933 lines
31 KiB
XML
933 lines
31 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.assessment.dao.SubtaskDao">
|
|
<resultMap id="subtaskPOJO" type="com.hx.slj.modules.assessment.entity.Subtask">
|
|
<id property="id" column="id"/>
|
|
<result property="standardTaskId" column="standard_task_id"/>
|
|
<result property="khtxTargetId" column="khtx_target_id"/>
|
|
<result property="startTime" column="start_time"/>
|
|
<result property="endTime" column="end_time"/>
|
|
<result property="publishStatus" column="publish_status"/>
|
|
<result property="finalScore" column="final_score"/>
|
|
<result property="status" column="status"/>
|
|
<result property="overdue" column="overdue"/>
|
|
<result property="sort" column="sort"/>
|
|
<result property="application_update" column="applicationUpdate"/>
|
|
|
|
</resultMap>
|
|
|
|
<sql id="subtaskColumns">
|
|
a.id,
|
|
a.standard_task_id AS "standardTaskId",
|
|
a.khtx_target_id AS "khtxTargetId",
|
|
a.start_time AS "startTime",
|
|
a.end_time AS "endTime",
|
|
a.publish_status AS "publishStatus",
|
|
a.final_score AS "finalScore",
|
|
a.status AS "status",
|
|
a.overdue AS "overdue",
|
|
a.sort,
|
|
a.create_by AS "createBy.id",
|
|
a.create_date,
|
|
a.update_by AS "updateBy.id",
|
|
a.update_date,
|
|
a.remarks,
|
|
a.del_flag,
|
|
a.direct_yes_no AS "directYesNo",
|
|
a.file_submit_status AS "fileSubmitStatus",
|
|
a.wj_file_submit_status AS "wjFileSubmitStatus",
|
|
a.feedback AS "feedback",
|
|
a.application_update AS applicationUpdate
|
|
</sql>
|
|
<!--指标-->
|
|
<sql id="indexColumns">
|
|
i.id AS "acIndex.id",
|
|
i.system_ID AS "acIndex.systemID",
|
|
i.parent_id AS "acIndex.parentID",
|
|
i.parent_ids AS "acIndex.parentids",
|
|
i.name AS "acIndex.name",
|
|
i.href AS "acIndex.href",
|
|
i.target AS "acIndex.target",
|
|
i.icon AS "acIndex.icon",
|
|
i.sort AS "acIndex.sort",
|
|
i.is_show AS "acIndex.isShow",
|
|
i.permission AS "acIndex.permission",
|
|
i.level AS "acIndex.level",
|
|
i.isFinal AS "acIndex.isFinal",
|
|
i.isRoot AS "acIndex.isRoot",
|
|
i.description AS "acIndex.description",
|
|
i.datasource AS "acIndex.datasource",
|
|
i.object AS "acIndex.object",
|
|
i.score AS "acIndex.score",
|
|
i.method AS "acIndex.method"
|
|
</sql>
|
|
<!--公式-->
|
|
<sql id="indexFormulaColumns">
|
|
f.id AS "formula.id",
|
|
f.khtx_target_id AS "formula.targetId",
|
|
f.formula_kind AS "formula.ormulaKind",
|
|
f.formula_type AS "formula.formulaType",
|
|
f.formula_left AS "formula.formulaLeft",
|
|
f.formula_right AS "formula.formulaRight",
|
|
f.formula_center AS "formula.formulaCenter",
|
|
f.execution_order AS "formula.executionOrder"
|
|
</sql>
|
|
<!--指标变量-->
|
|
<sql id="indexVarColumns">
|
|
v.id AS "params.id",
|
|
v.khtx_target_id AS "params.targetId",
|
|
v.var_name AS "params.varName",
|
|
v.var_name_en AS "params.varNameEn",
|
|
v.var_type AS "params.varType",
|
|
v.questionnaire_id AS "params.questionnaireId",
|
|
v.question_id AS "params.questionId",
|
|
v.option_id AS "params.optionId",
|
|
v.basics_tablename_ch AS "params.basicsTableNameCh",
|
|
v.basics_tablename_en AS "params.basicsTablenameEn",
|
|
v.basics_columnname_ch AS "params.basicsColumnnameCh",
|
|
v.basics_columnname_en AS "params.basicsColumnnameEn",
|
|
v.sort AS "params.sort"
|
|
</sql>
|
|
<select id="get" resultType="com.hx.slj.modules.assessment.entity.Subtask">
|
|
SELECT
|
|
<include refid="subtaskColumns"/>,
|
|
p.id AS "plan.id",
|
|
p.cycle AS "plan.cycle",
|
|
p.`year` AS "plan.year",
|
|
p.title AS "plan.title",
|
|
p.`enable` AS "plan.enable",
|
|
p.assessment_start_date AS "plan.assessmentStartDate",
|
|
p.assessment_end_date AS "plan.assessmentEndDate",
|
|
p.assessment_system_id AS "plan.assessmentSystemId",
|
|
t.id AS "task.id",
|
|
t.sys_office_id AS "task.sysOfficeId",
|
|
o.`CODE` AS "office.code",
|
|
o.PARENT_ID AS "office.parent.id",
|
|
o.PARENT_IDS AS "office.parentIds",
|
|
o.`NAME` AS "office.name",
|
|
o.id AS "office.id",
|
|
o.AREA_ID AS "office.area.id",
|
|
n.`NAME` AS "acIndex.name",
|
|
n.PARENT_ID AS "acIndex.parentID",
|
|
n.parent_ids AS "acIndex.parentids",
|
|
n.description AS "acIndex.description",
|
|
n.score AS "acIndex.score",
|
|
n.evaluation AS "acIndex.evaluation",
|
|
n.method AS "acIndex.method",
|
|
n.isFinal AS "acIndex.isFinal",
|
|
n.isRoot AS "acIndex.isRoot"
|
|
FROM
|
|
standard_subtask a
|
|
LEFT JOIN standard_task t ON a.standard_task_id = t.id
|
|
LEFT JOIN sys_office o ON t.sys_office_id = o.id
|
|
LEFT JOIN standard_plan p ON t.standard_plan_id = p.id
|
|
LEFT JOIN assessment_index n ON a.khtx_target_id = n.ID
|
|
|
|
WHERE a.id = #{id}
|
|
</select>
|
|
|
|
<select id="findList" resultType="com.hx.slj.modules.assessment.entity.Subtask">
|
|
SELECT
|
|
<include refid="subtaskColumns"/>
|
|
FROM standard_subtask a
|
|
WHERE a.del_flag = #{DEL_FLAG_NORMAL}
|
|
<choose>
|
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
ORDER BY ${page.orderBy}
|
|
</when>
|
|
<otherwise>
|
|
ORDER BY a.update_date
|
|
</otherwise>
|
|
</choose>
|
|
</select>
|
|
<select id="getSubtaskList" resultType="com.hx.slj.modules.assessment.entity.Subtask">
|
|
SELECT
|
|
<include refid="subtaskColumns"/>,
|
|
p.id AS "plan.id",
|
|
p.cycle AS "plan.cycle",
|
|
p.`year` AS "plan.year",
|
|
p.title AS "plan.title",
|
|
p.`enable` AS "plan.enable",
|
|
p.assessment_start_date AS "plan.assessmentStartDate",
|
|
p.assessment_end_date AS "plan.assessmentEndDate",
|
|
p.assessment_system_id AS "plan.assessmentSystemId",
|
|
t.id AS "task.id",
|
|
t.sys_office_id AS "task.sysOfficeId",
|
|
o.`CODE` AS "office.code",
|
|
o.PARENT_ID AS "office.parent.id",
|
|
o.PARENT_IDS AS "office.parentIds",
|
|
o.`NAME` AS "office.name",
|
|
o.id AS "office.id",
|
|
o.AREA_ID AS "office.area.id",
|
|
n.id AS "acIndex.id",
|
|
n.system_ID AS "acIndex.systemID",
|
|
n.parent_id AS "acIndex.parentID",
|
|
n.parent_ids AS "acIndex.parentids",
|
|
n.name AS "acIndex.name",
|
|
n.href AS "acIndex.href",
|
|
n.target AS "acIndex.target",
|
|
n.icon AS "acIndex.icon",
|
|
n.sort AS "acIndex.sort",
|
|
n.is_show AS "acIndex.isShow",
|
|
n.permission AS "acIndex.permission",
|
|
n.level AS "acIndex.level",
|
|
n.isFinal AS "acIndex.isFinal",
|
|
n.isRoot AS "acIndex.isRoot",
|
|
n.description AS "acIndex.description",
|
|
n.datasource AS "acIndex.datasource",
|
|
n.object AS "acIndex.object",
|
|
n.score AS "acIndex.score",
|
|
n.method AS "acIndex.method"
|
|
FROM
|
|
standard_subtask a
|
|
LEFT JOIN standard_task t ON a.standard_task_id = t.id
|
|
LEFT JOIN sys_office o ON t.sys_office_id = o.id
|
|
LEFT JOIN standard_plan p ON t.standard_plan_id = p.id
|
|
LEFT JOIN assessment_index n ON a.khtx_target_id = n.ID
|
|
where
|
|
a.del_flag= #{DEL_FLAG_NORMAL}
|
|
<if test="standardTaskId!=null and standardTaskId!=''">
|
|
and
|
|
a.standard_task_id =#{standardTaskId}
|
|
</if>
|
|
and a.publish_status != 0
|
|
<if test="publishStatus !=null and publishStatus !=''">
|
|
and a.publish_status=#{publishStatus}
|
|
</if>
|
|
<if test="plan.id !=null and plan.id !=''">
|
|
and p.id=#{plan.id}
|
|
</if>
|
|
<if test="office.name !=null and office.name !=''">
|
|
and o.name like CONCAT('%',#{office.name},'%')
|
|
</if>
|
|
<if test="office.id !=null and office.id !=''">
|
|
and o.id = #{office.id}
|
|
</if>
|
|
<if test="acIndex.name !=null and acIndex.name !=''">
|
|
and n.name like CONCAT('%',#{acIndex.name},'%')
|
|
</if>
|
|
<if test="currentUser !=null and currentUser.office !=null and currentUser.office.id!=null and currentUser.office.id!=''">
|
|
and o.PARENT_ID =#{currentUser.office.id}
|
|
</if>
|
|
|
|
</select>
|
|
<select id="getOverdueList" resultType="com.hx.slj.modules.assessment.entity.Subtask">
|
|
SELECT
|
|
<include refid="subtaskColumns"/>,
|
|
p.id AS "plan.id",
|
|
p.cycle AS "plan.cycle",
|
|
p.`year` AS "plan.year",
|
|
p.title AS "plan.title",
|
|
p.`enable` AS "plan.enable",
|
|
p.assessment_start_date AS "plan.assessmentStartDate",
|
|
p.assessment_end_date AS "plan.assessmentEndDate",
|
|
p.assessment_system_id AS "plan.assessmentSystemId",
|
|
t.id AS "task.id",
|
|
t.sys_office_id AS "task.sysOfficeId",
|
|
o.`CODE` AS "office.code",
|
|
o.PARENT_ID AS "office.parent.id",
|
|
o.PARENT_IDS AS "office.parentIds",
|
|
o.`NAME` AS "office.name",
|
|
o.id AS "office.id",
|
|
o.AREA_ID AS "office.area.id",
|
|
n.id AS "acIndex.id",
|
|
n.system_ID AS "acIndex.systemID",
|
|
n.parent_id AS "acIndex.parentID",
|
|
n.parent_ids AS "acIndex.parentids",
|
|
n.name AS "acIndex.name",
|
|
n.href AS "acIndex.href",
|
|
n.target AS "acIndex.target",
|
|
n.icon AS "acIndex.icon",
|
|
n.sort AS "acIndex.sort",
|
|
n.is_show AS "acIndex.isShow",
|
|
n.permission AS "acIndex.permission",
|
|
n.level AS "acIndex.level",
|
|
n.isFinal AS "acIndex.isFinal",
|
|
n.isRoot AS "acIndex.isRoot",
|
|
n.description AS "acIndex.description",
|
|
n.datasource AS "acIndex.datasource",
|
|
n.object AS "acIndex.object",
|
|
n.score AS "acIndex.score",
|
|
n.method AS "acIndex.method"
|
|
FROM
|
|
standard_subtask a
|
|
LEFT JOIN standard_task t ON a.standard_task_id = t.id
|
|
LEFT JOIN sys_office o ON t.sys_office_id = o.id
|
|
LEFT JOIN standard_plan p ON t.standard_plan_id = p.id
|
|
LEFT JOIN assessment_index n ON a.khtx_target_id = n.ID
|
|
where
|
|
a.del_flag= #{DEL_FLAG_NORMAL}
|
|
<if test="standardTaskId!=null and standardTaskId!=''">
|
|
and a.standard_task_id =#{standardTaskId}
|
|
</if>
|
|
and a.publish_status != 0
|
|
and (a.overdue=2 or a.overdue=3 )
|
|
<if test="publishStatus !=null and publishStatus !=''">
|
|
and a.publish_status=#{publishStatus}
|
|
</if>
|
|
<if test="overdue !=null and overdue !=''">
|
|
and a.overdue=#{overdue}
|
|
</if>
|
|
<if test="plan.id !=null and plan.id !=''">
|
|
and p.id=#{plan.id}
|
|
</if>
|
|
<if test="office.name !=null and office.name !=''">
|
|
and o.name like CONCAT('%',#{office.name},'%')
|
|
</if>
|
|
<if test="office.id !=null and office.id !=''">
|
|
and o.id = #{office.id}
|
|
</if>
|
|
<if test="acIndex.name !=null and acIndex.name !=''">
|
|
and n.name like CONCAT('%',#{acIndex.name},'%')
|
|
</if>
|
|
<if test="currentUser !=null and currentUser.office !=null and currentUser.office.id!=null and currentUser.office.id!=''">
|
|
and o.PARENT_ID =#{currentUser.office.id}
|
|
</if>
|
|
|
|
</select>
|
|
<select id="receiveList" resultType="com.hx.slj.modules.assessment.entity.Subtask">
|
|
SELECT
|
|
<include refid="subtaskColumns"/>,
|
|
p.id AS "plan.id",
|
|
p.cycle AS "plan.cycle",
|
|
p.`year` AS "plan.year",
|
|
p.title AS "plan.title",
|
|
p.`enable` AS "plan.enable",
|
|
p.assessment_start_date AS "plan.assessmentStartDate",
|
|
p.assessment_end_date AS "plan.assessmentEndDate",
|
|
p.assessment_system_id AS "plan.assessmentSystemId",
|
|
t.id AS "task.id",
|
|
t.sys_office_id AS "task.sysOfficeId",
|
|
o.`CODE` AS "office.code",
|
|
o.PARENT_ID AS "office.parent.id",
|
|
o.PARENT_IDS AS "office.parentIds",
|
|
o.`NAME` AS "office.name",
|
|
o.id AS "office.id",
|
|
o.AREA_ID AS "office.area.id",
|
|
n.id AS "acIndex.id",
|
|
n.system_ID AS "acIndex.systemID",
|
|
n.parent_id AS "acIndex.parentID",
|
|
n.parent_ids AS "acIndex.parentids",
|
|
n.name AS "acIndex.name",
|
|
n.href AS "acIndex.href",
|
|
n.target AS "acIndex.target",
|
|
n.icon AS "acIndex.icon",
|
|
n.sort AS "acIndex.sort",
|
|
n.is_show AS "acIndex.isShow",
|
|
n.permission AS "acIndex.permission",
|
|
n.level AS "acIndex.level",
|
|
n.isFinal AS "acIndex.isFinal",
|
|
n.isRoot AS "acIndex.isRoot",
|
|
n.description AS "acIndex.description",
|
|
n.datasource AS "acIndex.datasource",
|
|
n.object AS "acIndex.object",
|
|
n.score AS "acIndex.score",
|
|
n.method AS "acIndex.method"
|
|
FROM
|
|
standard_subtask a
|
|
LEFT JOIN standard_task t ON a.standard_task_id = t.id
|
|
LEFT JOIN sys_office o ON t.sys_office_id = o.id
|
|
LEFT JOIN standard_plan p ON t.standard_plan_id = p.id
|
|
LEFT JOIN assessment_index n ON a.khtx_target_id = n.ID
|
|
where
|
|
a.del_flag= #{DEL_FLAG_NORMAL}
|
|
<if test="standardTaskId!=null and standardTaskId!=''">
|
|
and a.standard_task_id =#{standardTaskId}
|
|
</if>
|
|
and a.publish_status != 0
|
|
and a.overdue !=2
|
|
<if test="publishStatus !=null and publishStatus !=''">
|
|
and a.publish_status=#{publishStatus}
|
|
</if>
|
|
<if test="fileSubmitStatus !=null and fileSubmitStatus !=''">
|
|
and a.file_submit_status=#{fileSubmitStatus}
|
|
</if>
|
|
<if test="plan.id !=null and plan.id !=''">
|
|
and p.id=#{plan.id}
|
|
</if>
|
|
<if test="office.name !=null and office.name !=''">
|
|
and o.name like CONCAT('%',#{office.name},'%')
|
|
</if>
|
|
<if test="office.id !=null and office.id !=''">
|
|
and o.id = #{office.id}
|
|
</if>
|
|
<if test="acIndex.name !=null and acIndex.name !=''">
|
|
and n.name like CONCAT('%',#{acIndex.name},'%')
|
|
</if>
|
|
|
|
</select>
|
|
<select id="viewList" resultType="com.hx.slj.modules.assessment.entity.Subtask">
|
|
SELECT
|
|
<include refid="subtaskColumns"/>,
|
|
p.id AS "plan.id",
|
|
p.cycle AS "plan.cycle",
|
|
p.`year` AS "plan.year",
|
|
p.title AS "plan.title",
|
|
p.`enable` AS "plan.enable",
|
|
p.assessment_start_date AS "plan.assessmentStartDate",
|
|
p.assessment_end_date AS "plan.assessmentEndDate",
|
|
p.assessment_system_id AS "plan.assessmentSystemId",
|
|
t.id AS "task.id",
|
|
t.sys_office_id AS "task.sysOfficeId",
|
|
o.`CODE` AS "office.code",
|
|
o.PARENT_ID AS "office.parent.id",
|
|
o.PARENT_IDS AS "office.parentIds",
|
|
o.`NAME` AS "office.name",
|
|
o.id AS "office.id",
|
|
o.AREA_ID AS "office.area.id",
|
|
n.id AS "acIndex.id",
|
|
n.system_ID AS "acIndex.systemID",
|
|
n.parent_id AS "acIndex.parentID",
|
|
n.parent_ids AS "acIndex.parentids",
|
|
n.name AS "acIndex.name",
|
|
n.href AS "acIndex.href",
|
|
n.target AS "acIndex.target",
|
|
n.icon AS "acIndex.icon",
|
|
n.sort AS "acIndex.sort",
|
|
n.is_show AS "acIndex.isShow",
|
|
n.permission AS "acIndex.permission",
|
|
n.level AS "acIndex.level",
|
|
n.isFinal AS "acIndex.isFinal",
|
|
n.isRoot AS "acIndex.isRoot",
|
|
n.description AS "acIndex.description",
|
|
n.datasource AS "acIndex.datasource",
|
|
n.object AS "acIndex.object",
|
|
n.score AS "acIndex.score",
|
|
n.method AS "acIndex.method"
|
|
FROM
|
|
standard_subtask a
|
|
LEFT JOIN standard_task t ON a.standard_task_id = t.id
|
|
LEFT JOIN sys_office o ON t.sys_office_id = o.id
|
|
LEFT JOIN standard_plan p ON t.standard_plan_id = p.id
|
|
LEFT JOIN assessment_index n ON a.khtx_target_id = n.ID
|
|
where
|
|
a.del_flag= #{DEL_FLAG_NORMAL}
|
|
and
|
|
<if test="standardTaskId!=null and standardTaskId!=''">
|
|
a.standard_task_id =#{standardTaskId}
|
|
</if>
|
|
<if test="publishStatus !=null and publishStatus !=''">
|
|
and a.publish_status >=#{publishStatus}
|
|
</if>
|
|
<if test="fileSubmitStatus !=null and fileSubmitStatus !=''">
|
|
and a.file_submit_status = #{fileSubmitStatus}
|
|
</if>
|
|
<if test="wjFileSubmitStatus !=null and wjFileSubmitStatus !=''">
|
|
and a.wj_file_submit_status = #{wjFileSubmitStatus}
|
|
</if>
|
|
<if test="plan.id !=null and plan.id !=''">
|
|
and p.id=#{plan.id}
|
|
</if>
|
|
<if test="office.name !=null and office.name !=''">
|
|
and o.name like CONCAT('%',#{office.name},'%')
|
|
</if>
|
|
<if test="office.id !=null and office.id !=''">
|
|
and o.id = #{office.id}
|
|
</if>
|
|
<if test="acIndex.name !=null and acIndex.name !=''">
|
|
and n.name like CONCAT('%',#{acIndex.name},'%')
|
|
</if>
|
|
</select>
|
|
<insert id="insert">
|
|
INSERT INTO standard_subtask(
|
|
id,
|
|
standard_task_id,
|
|
khtx_target_id,
|
|
start_time,
|
|
end_time,
|
|
publish_status,
|
|
final_score,
|
|
status,
|
|
sort,
|
|
create_by,
|
|
create_date,
|
|
update_by,
|
|
update_date,
|
|
remarks,
|
|
del_flag,
|
|
direct_yes_no,
|
|
feedback
|
|
) VALUES (
|
|
#{id},
|
|
#{standardTaskId},
|
|
#{khtxTargetId},
|
|
#{startTime},
|
|
#{endTime},
|
|
#{publishStatus},
|
|
#{finalScore},
|
|
#{status},
|
|
#{sort},
|
|
#{createBy.id},
|
|
#{createDate},
|
|
#{updateBy.id},
|
|
#{updateDate},
|
|
#{remarks},
|
|
#{delFlag},
|
|
#{directYesNo},
|
|
#{feedback}
|
|
)
|
|
</insert>
|
|
|
|
<update id="update">
|
|
UPDATE standard_subtask SET
|
|
standard_task_id = #{standardTaskId},
|
|
khtx_target_id = #{khtxTargetId},
|
|
publish_status= #{publishStatus},
|
|
final_score= #{finalScore},
|
|
status = #{status},
|
|
sort = #{sort},
|
|
create_by = #{createBy.id},
|
|
create_date = #{createDate},
|
|
update_by = #{updateBy.id},
|
|
update_date = #{updateDate},
|
|
remarks = #{remarks},
|
|
del_flag = #{delFlag},
|
|
direct_yes_no=#{directYesNo},
|
|
feedback = #{feedback}
|
|
WHERE id = #{id}
|
|
</update>
|
|
<update id="publishSubtask">
|
|
UPDATE standard_subtask SET
|
|
<if test="publishStatus!=null and publishStatus !=''">
|
|
publish_status= #{publishStatus},
|
|
</if>
|
|
start_time= #{startTime},
|
|
end_time= #{endTime},
|
|
update_by = #{updateBy.id},
|
|
update_date = #{updateDate}
|
|
WHERE id = #{id}
|
|
and overdue =1
|
|
</update>
|
|
<update id="updateOverdue">
|
|
UPDATE standard_subtask SET
|
|
<if test="overdue!=null and overdue !=''">
|
|
overdue= #{overdue},
|
|
</if>
|
|
<if test="startTime != null">
|
|
start_time= #{startTime},
|
|
</if>
|
|
<if test="endTime != null">
|
|
end_time= #{endTime},
|
|
</if>
|
|
<if test="wjFileSubmitStatus != null and wjFileSubmitStatus !=''">
|
|
wj_file_submit_status= #{wjFileSubmitStatus},
|
|
</if>
|
|
update_by = #{updateBy.id},
|
|
update_date = #{updateDate}
|
|
WHERE id = #{id}
|
|
</update>
|
|
<update id="updateFileSubmitStatus">
|
|
UPDATE standard_subtask SET
|
|
file_submit_status= #{fileSubmitStatus},
|
|
update_by = #{updateBy.id},
|
|
update_date = #{updateDate}
|
|
WHERE id = #{id}
|
|
</update>
|
|
|
|
|
|
<update id="deleteById">
|
|
UPDATE standard_subtask SET
|
|
del_flag = #{delFlag}
|
|
WHERE id = #{id}
|
|
</update>
|
|
|
|
<!--根据任务id 查出所有子任务 根据子任务指标id 关联指标信息 指标公式 指标变量-->
|
|
<select id="indexListByTaskId" resultType="com.hx.slj.modules.assessment.entity.Subtask">
|
|
SELECT
|
|
<include refid="subtaskColumns"/>
|
|
,
|
|
<include refid="indexColumns"/>
|
|
<!--,
|
|
<include refid="indexFormulaColumns"/>
|
|
,
|
|
<include refid="indexVarColumns"/>-->
|
|
FROM standard_subtask a
|
|
LEFT JOIN assessment_index i ON i.ID = a.khtx_target_id
|
|
/*LEFT JOIN khtx_formula f ON f.khtx_target_id =a.khtx_target_id
|
|
LEFT JOIN khtx_var v ON v.khtx_target_id =a.khtx_target_id*/
|
|
WHERE a.del_flag= #{DEL_FLAG_NORMAL}
|
|
AND
|
|
a.standard_task_id =#{standardTaskId}
|
|
<if test=" status !=null and status !=''">
|
|
AND a.status = #{status}
|
|
</if>
|
|
<if test="acIndex!=null and acIndex.parentids !=null and acIndex.parentids !=''">
|
|
AND i.parent_ids LIKE CONCAT('%',#{acIndex.parentids},'%')
|
|
</if>
|
|
<if test="acIndex!=null and acIndex.parentID !=null and acIndex.parentID !=''">
|
|
AND i.parent_id = #{acIndex.parentID}
|
|
</if>
|
|
<if test="acIndex!=null and acIndex.method !=null and acIndex.method !=''">
|
|
AND i.method = #{acIndex.method}
|
|
</if>
|
|
ORDER BY i.sort
|
|
</select>
|
|
<!--根据id 查出子任务并关联指标数据 指标公式 指标变量-->
|
|
<select id="getAcindex" resultType="com.hx.slj.modules.assessment.entity.Subtask">
|
|
SELECT
|
|
<include refid="subtaskColumns"/>
|
|
,
|
|
<include refid="indexColumns"/>
|
|
<!--,
|
|
<include refid="indexFormulaColumns"/>
|
|
,
|
|
<include refid="indexVarColumns"/>-->
|
|
FROM standard_subtask a
|
|
LEFT JOIN assessment_index i ON i.ID = a.khtx_target_id
|
|
/* LEFT JOIN khtx_formula f ON f.khtx_target_id =a.khtx_target_id
|
|
LEFT JOIN khtx_var v ON v.khtx_target_id =a.khtx_target_id*/
|
|
WHERE
|
|
a.id =#{id}
|
|
</select>
|
|
<!--根据id 以及分数更新该指标的提交状态以及得分-->
|
|
<update id="updateStatusAndScore">
|
|
UPDATE standard_subtask SET
|
|
direct_yes_no=#{directYesNo},
|
|
final_score=#{finalScore},
|
|
status= #{status},
|
|
update_by = #{updateBy.id},
|
|
update_date = #{updateDate},
|
|
feedback = #{feedback}
|
|
WHERE id = #{id}
|
|
</update>
|
|
<!--根据指标id和任务id 以及分数更新该指标的提交状态以及得分-->
|
|
<update id="updateIdsStatusAndScore">
|
|
UPDATE standard_subtask SET
|
|
final_score= #{finalScore},
|
|
status= #{status},
|
|
update_by = #{updateBy.id},
|
|
update_date = #{updateDate}
|
|
WHERE khtx_target_id = #{khtxTargetId}
|
|
AND standard_task_id=#{standardTaskId}
|
|
</update>
|
|
<!--根据指标id和任务id 查出子任务并关联指标数据 指标公式 指标变量-->
|
|
<select id="getSubtaskByTidAndIid" resultType="com.hx.slj.modules.assessment.entity.Subtask">
|
|
SELECT
|
|
<include refid="subtaskColumns"/>
|
|
,
|
|
<include refid="indexColumns"/>
|
|
<!--,
|
|
<include refid="indexFormulaColumns"/>
|
|
,
|
|
<include refid="indexVarColumns"/>-->
|
|
FROM standard_subtask a
|
|
LEFT JOIN assessment_index i ON i.ID = a.khtx_target_id
|
|
/* LEFT JOIN khtx_formula f ON f.khtx_target_id =a.khtx_target_id
|
|
LEFT JOIN khtx_var v ON v.khtx_target_id =a.khtx_target_id*/
|
|
WHERE
|
|
a.del_flag= #{DEL_FLAG_NORMAL}
|
|
and
|
|
a.khtx_target_id =#{khtxTargetId}
|
|
and a.standard_task_id=#{standardTaskId}
|
|
</select>
|
|
|
|
<select id="getSubtaskByIndexName" resultType="com.hx.slj.modules.assessment.entity.Subtask">
|
|
SELECT
|
|
<include refid="subtaskColumns"/>,
|
|
p.id AS "plan.id",
|
|
p.cycle AS "plan.cycle",
|
|
p.`year` AS "plan.year",
|
|
p.title AS "plan.title",
|
|
p.`enable` AS "plan.enable",
|
|
p.assessment_start_date AS "plan.assessmentStartDate",
|
|
p.assessment_end_date AS "plan.assessmentEndDate",
|
|
p.assessment_system_id AS "plan.assessmentSystemId",
|
|
t.id AS "task.id",
|
|
t.sys_office_id AS "task.sysOfficeId",
|
|
o.`CODE` AS "office.code",
|
|
o.PARENT_ID AS "office.parent.id",
|
|
o.PARENT_IDS AS "office.parentIds",
|
|
o.`NAME` AS "office.name",
|
|
o.id AS "office.id",
|
|
o.AREA_ID AS "office.area.id",
|
|
n.`NAME` AS "acIndex.name",
|
|
n.PARENT_ID AS "acIndex.parentID",
|
|
n.parent_ids AS "acIndex.parentids",
|
|
n.description AS "acIndex.description",
|
|
n.score AS "acIndex.score",
|
|
n.evaluation AS "acIndex.evaluation",
|
|
n.method AS "acIndex.method",
|
|
n.isFinal AS "acIndex.isFinal",
|
|
n.isRoot AS "acIndex.isRoot"
|
|
FROM
|
|
standard_subtask a
|
|
LEFT JOIN standard_task t ON a.standard_task_id = t.id
|
|
LEFT JOIN sys_office o ON t.sys_office_id = o.id
|
|
LEFT JOIN standard_plan p ON t.standard_plan_id = p.id
|
|
LEFT JOIN assessment_index n ON a.khtx_target_id = n.ID
|
|
|
|
where
|
|
a.del_flag= #{DEL_FLAG_NORMAL}
|
|
and t.del_flag =0
|
|
<if test="publishStatus !=null and publishStatus !=''">
|
|
and a.publish_status=#{publishStatus}
|
|
</if>
|
|
<if test="plan.id !=null and plan.id !=''">
|
|
and p.id=#{plan.id}
|
|
</if>
|
|
<if test="office.name !=null and office.name !=''">
|
|
and o.name like CONCAT('%',#{office.name},'%')
|
|
</if>
|
|
<if test="office.id !=null and office.id !=''">
|
|
and o.id = #{office.id}
|
|
</if>
|
|
<if test="acIndex.name !=null and acIndex.name !=''">
|
|
and n.name =#{acIndex.name}
|
|
</if>
|
|
<if test="currentUser !=null and currentUser.office !=null and currentUser.office.id!=null and currentUser.office.id!=''">
|
|
and o.PARENT_ID =#{currentUser.office.id}
|
|
</if>
|
|
|
|
</select>
|
|
<!--根据指标考核方式 问卷 问卷是否有文件提交-->
|
|
<select id="findSubtaskListByMethod" resultType="com.hx.slj.modules.assessment.entity.Subtask">
|
|
SELECT
|
|
<include refid="subtaskColumns"/>,
|
|
p.id AS "plan.id",
|
|
p.cycle AS "plan.cycle",
|
|
p.`year` AS "plan.year",
|
|
p.title AS "plan.title",
|
|
p.`enable` AS "plan.enable",
|
|
p.assessment_start_date AS "plan.assessmentStartDate",
|
|
p.assessment_end_date AS "plan.assessmentEndDate",
|
|
p.assessment_system_id AS "plan.assessmentSystemId",
|
|
t.id AS "task.id",
|
|
t.sys_office_id AS "task.sysOfficeId",
|
|
o.`CODE` AS "office.code",
|
|
o.PARENT_ID AS "office.parent.id",
|
|
o.PARENT_IDS AS "office.parentIds",
|
|
o.`NAME` AS "office.name",
|
|
o.id AS "office.id",
|
|
o.AREA_ID AS "office.area.id",
|
|
n.id AS "acIndex.id",
|
|
n.system_ID AS "acIndex.systemID",
|
|
n.parent_id AS "acIndex.parentID",
|
|
n.parent_ids AS "acIndex.parentids",
|
|
n.name AS "acIndex.name",
|
|
n.href AS "acIndex.href",
|
|
n.target AS "acIndex.target",
|
|
n.icon AS "acIndex.icon",
|
|
n.sort AS "acIndex.sort",
|
|
n.is_show AS "acIndex.isShow",
|
|
n.permission AS "acIndex.permission",
|
|
n.level AS "acIndex.level",
|
|
n.isFinal AS "acIndex.isFinal",
|
|
n.isRoot AS "acIndex.isRoot",
|
|
n.description AS "acIndex.description",
|
|
n.datasource AS "acIndex.datasource",
|
|
n.object AS "acIndex.object",
|
|
n.score AS "acIndex.score",
|
|
n.method AS "acIndex.method"
|
|
FROM
|
|
standard_subtask a
|
|
LEFT JOIN standard_task t ON a.standard_task_id = t.id
|
|
LEFT JOIN sys_office o ON t.sys_office_id = o.id
|
|
LEFT JOIN standard_plan p ON t.standard_plan_id = p.id
|
|
LEFT JOIN assessment_index n ON a.khtx_target_id = n.ID
|
|
where
|
|
a.del_flag= #{DEL_FLAG_NORMAL}
|
|
|
|
and (a.wj_file_submit_status = '1' or a.wj_file_submit_status='3')
|
|
|
|
<if test="standardTaskId!=null and standardTaskId!=''">
|
|
and a.standard_task_id =#{standardTaskId}
|
|
</if>
|
|
|
|
<if test="publishStatus !=null and publishStatus !=''">
|
|
and a.publish_status=#{publishStatus}
|
|
</if>
|
|
<if test="fileSubmitStatus !=null and fileSubmitStatus !=''">
|
|
and a.file_submit_status=#{fileSubmitStatus}
|
|
</if>
|
|
<if test="plan.id !=null and plan.id !=''">
|
|
and p.id=#{plan.id}
|
|
</if>
|
|
<if test="office.name !=null and office.name !=''">
|
|
and o.name like CONCAT('%',#{office.name},'%')
|
|
</if>
|
|
<if test="office.id !=null and office.id !=''">
|
|
and o.id = #{office.id}
|
|
</if>
|
|
<if test="acIndex.name !=null and acIndex.name !=''">
|
|
and n.name like CONCAT('%',#{acIndex.name},'%')
|
|
</if>
|
|
<if test="acIndex.method !=null and acIndex.method !=''">
|
|
and n.method =#{acIndex.method}
|
|
</if>
|
|
|
|
</select>
|
|
<!--更新问卷文件上传状态-->
|
|
<update id="updateWjFileSubmitStatus">
|
|
UPDATE standard_subtask SET
|
|
wj_file_submit_status= #{wjFileSubmitStatus},
|
|
update_by = #{updateBy.id},
|
|
update_date = #{updateDate}
|
|
WHERE id = #{id}
|
|
</update>
|
|
|
|
<!--修改申请标识-->
|
|
<update id="xiugai">
|
|
UPDATE standard_subtask SET application_update='1' WHERE ID =#{subtaskId}
|
|
</update>
|
|
|
|
<!--同意申请标识-->
|
|
<update id="tongyi">
|
|
UPDATE standard_subtask SET application_update='0',
|
|
final_score='0',
|
|
`status`='1', file_submit_status='0'
|
|
WHERE ID =#{subtaskId}
|
|
</update>
|
|
|
|
|
|
<!--问卷文件上传过期任务-->
|
|
<select id="getWJOverdueList" resultType="com.hx.slj.modules.assessment.entity.Subtask">
|
|
SELECT
|
|
<include refid="subtaskColumns"/>,
|
|
p.id AS "plan.id",
|
|
p.cycle AS "plan.cycle",
|
|
p.`year` AS "plan.year",
|
|
p.title AS "plan.title",
|
|
p.`enable` AS "plan.enable",
|
|
p.assessment_start_date AS "plan.assessmentStartDate",
|
|
p.assessment_end_date AS "plan.assessmentEndDate",
|
|
p.assessment_system_id AS "plan.assessmentSystemId",
|
|
t.id AS "task.id",
|
|
t.sys_office_id AS "task.sysOfficeId",
|
|
o.`CODE` AS "office.code",
|
|
o.PARENT_ID AS "office.parent.id",
|
|
o.PARENT_IDS AS "office.parentIds",
|
|
o.`NAME` AS "office.name",
|
|
o.id AS "office.id",
|
|
o.AREA_ID AS "office.area.id",
|
|
n.id AS "acIndex.id",
|
|
n.system_ID AS "acIndex.systemID",
|
|
n.parent_id AS "acIndex.parentID",
|
|
n.parent_ids AS "acIndex.parentids",
|
|
n.name AS "acIndex.name",
|
|
n.href AS "acIndex.href",
|
|
n.target AS "acIndex.target",
|
|
n.icon AS "acIndex.icon",
|
|
n.sort AS "acIndex.sort",
|
|
n.is_show AS "acIndex.isShow",
|
|
n.permission AS "acIndex.permission",
|
|
n.level AS "acIndex.level",
|
|
n.isFinal AS "acIndex.isFinal",
|
|
n.isRoot AS "acIndex.isRoot",
|
|
n.description AS "acIndex.description",
|
|
n.datasource AS "acIndex.datasource",
|
|
n.object AS "acIndex.object",
|
|
n.score AS "acIndex.score",
|
|
n.method AS "acIndex.method"
|
|
FROM
|
|
standard_subtask a
|
|
LEFT JOIN standard_task t ON a.standard_task_id = t.id
|
|
LEFT JOIN sys_office o ON t.sys_office_id = o.id
|
|
LEFT JOIN standard_plan p ON t.standard_plan_id = p.id
|
|
LEFT JOIN assessment_index n ON a.khtx_target_id = n.ID
|
|
where
|
|
a.del_flag= #{DEL_FLAG_NORMAL}
|
|
<if test="standardTaskId!=null and standardTaskId!=''">
|
|
and a.standard_task_id =#{standardTaskId}
|
|
</if>
|
|
and a.wj_file_submit_status = '2'
|
|
<if test="overdue !=null and overdue !=''">
|
|
and a.overdue=#{overdue}
|
|
</if>
|
|
<if test="plan.id !=null and plan.id !=''">
|
|
and p.id=#{plan.id}
|
|
</if>
|
|
<if test="office.name !=null and office.name !=''">
|
|
and o.name like CONCAT('%',#{office.name},'%')
|
|
</if>
|
|
<if test="office.id !=null and office.id !=''">
|
|
and o.id = #{office.id}
|
|
</if>
|
|
<if test="acIndex.name !=null and acIndex.name !=''">
|
|
and n.name like CONCAT('%',#{acIndex.name},'%')
|
|
</if>
|
|
<if test="currentUser !=null and currentUser.office !=null and currentUser.office.id!=null and currentUser.office.id!=''">
|
|
and o.PARENT_ID =#{currentUser.office.id}
|
|
</if>
|
|
<if test="acIndex.method !=null and acIndex.method !=''">
|
|
and n.method = #{acIndex.method}
|
|
</if>
|
|
</select>
|
|
|
|
<!--根据指标考核方式 问卷 问卷文件查看页面-->
|
|
<select id="findSubtaskViewListByMethod" resultType="com.hx.slj.modules.assessment.entity.Subtask">
|
|
SELECT
|
|
<include refid="subtaskColumns"/>,
|
|
p.id AS "plan.id",
|
|
p.cycle AS "plan.cycle",
|
|
p.`year` AS "plan.year",
|
|
p.title AS "plan.title",
|
|
p.`enable` AS "plan.enable",
|
|
p.assessment_start_date AS "plan.assessmentStartDate",
|
|
p.assessment_end_date AS "plan.assessmentEndDate",
|
|
p.assessment_system_id AS "plan.assessmentSystemId",
|
|
t.id AS "task.id",
|
|
t.sys_office_id AS "task.sysOfficeId",
|
|
o.`CODE` AS "office.code",
|
|
o.PARENT_ID AS "office.parent.id",
|
|
o.PARENT_IDS AS "office.parentIds",
|
|
o.`NAME` AS "office.name",
|
|
o.id AS "office.id",
|
|
o.AREA_ID AS "office.area.id",
|
|
n.id AS "acIndex.id",
|
|
n.system_ID AS "acIndex.systemID",
|
|
n.parent_id AS "acIndex.parentID",
|
|
n.parent_ids AS "acIndex.parentids",
|
|
n.name AS "acIndex.name",
|
|
n.href AS "acIndex.href",
|
|
n.target AS "acIndex.target",
|
|
n.icon AS "acIndex.icon",
|
|
n.sort AS "acIndex.sort",
|
|
n.is_show AS "acIndex.isShow",
|
|
n.permission AS "acIndex.permission",
|
|
n.level AS "acIndex.level",
|
|
n.isFinal AS "acIndex.isFinal",
|
|
n.isRoot AS "acIndex.isRoot",
|
|
n.description AS "acIndex.description",
|
|
n.datasource AS "acIndex.datasource",
|
|
n.object AS "acIndex.object",
|
|
n.score AS "acIndex.score",
|
|
n.method AS "acIndex.method"
|
|
FROM
|
|
standard_subtask a
|
|
LEFT JOIN standard_task t ON a.standard_task_id = t.id
|
|
LEFT JOIN sys_office o ON t.sys_office_id = o.id
|
|
LEFT JOIN standard_plan p ON t.standard_plan_id = p.id
|
|
LEFT JOIN assessment_index n ON a.khtx_target_id = n.ID
|
|
where
|
|
a.del_flag= #{DEL_FLAG_NORMAL}
|
|
|
|
and (a.wj_file_submit_status = '1' or a.wj_file_submit_status='2' or a.wj_file_submit_status='3')
|
|
|
|
<if test="standardTaskId!=null and standardTaskId!=''">
|
|
and a.standard_task_id =#{standardTaskId}
|
|
</if>
|
|
|
|
<if test="publishStatus !=null and publishStatus !=''">
|
|
and a.publish_status=#{publishStatus}
|
|
</if>
|
|
<if test="fileSubmitStatus !=null and fileSubmitStatus !=''">
|
|
and a.file_submit_status=#{fileSubmitStatus}
|
|
</if>
|
|
<if test="plan.id !=null and plan.id !=''">
|
|
and p.id=#{plan.id}
|
|
</if>
|
|
<if test="office.name !=null and office.name !=''">
|
|
and o.name like CONCAT('%',#{office.name},'%')
|
|
</if>
|
|
<if test="office.id !=null and office.id !=''">
|
|
and o.id = #{office.id}
|
|
</if>
|
|
<if test="acIndex.name !=null and acIndex.name !=''">
|
|
and n.name like CONCAT('%',#{acIndex.name},'%')
|
|
</if>
|
|
<if test="acIndex.method !=null and acIndex.method !=''">
|
|
and n.method =#{acIndex.method}
|
|
</if>
|
|
|
|
</select>
|
|
</mapper> |