From fdcdd41fba7874c045766e3dea54d56d70df73ef Mon Sep 17 00:00:00 2001 From: zxl <763096477@qq.com> Date: 星期一, 12 五月 2025 10:06:50 +0800 Subject: [PATCH] (部级录像可用率,重点录像可用率,录像可用率)计算可用率 --- ycl-server/src/main/resources/mapper/zgyw/CheckTemplateRuleMapper.xml | 44 +++++++++++++++++++++++++++----------------- 1 files changed, 27 insertions(+), 17 deletions(-) diff --git a/ycl-server/src/main/resources/mapper/zgyw/CheckTemplateRuleMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CheckTemplateRuleMapper.xml index 0f94c61..384f4bd 100644 --- a/ycl-server/src/main/resources/mapper/zgyw/CheckTemplateRuleMapper.xml +++ b/ycl-server/src/main/resources/mapper/zgyw/CheckTemplateRuleMapper.xml @@ -3,49 +3,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.ycl.platform.mapper.CheckTemplateRuleMapper"> - + <resultMap type="com.ycl.platform.domain.entity.CheckTemplateRule" id="CheckTemplateRuleResult"> - <result property="id" column="id" /> + <result property="id" column="id" /> <result property="checkTemplateId" column="check_template_id" /> <result property="checkRuleId" column="check_rule_id" /> <result property="weight" column="weight" /> - <result property="maxScore" column="max_score" /> - <result property="auditState" column="audit_state" /> </resultMap> <sql id="selectCheckTemplateRuleVo"> - select id, check_template_id, check_rule_id, weight, max_score, audit_state from t_check_template_rule + select id, check_template_id, check_rule_id, weight from t_check_template_rule </sql> <select id="selectCheckTemplateRuleList" resultMap="CheckTemplateRuleResult"> <include refid="selectCheckTemplateRuleVo"/> - <where> + <where> <if test="checkTemplateId != null "> and check_template_id = #{checkTemplateId}</if> <if test="checkRuleId != null "> and check_rule_id = #{checkRuleId}</if> - <if test="auditState != null "> and audit_state = #{auditState}</if> </where> </select> - + <select id="selectCheckTemplateRuleById" resultMap="CheckTemplateRuleResult"> <include refid="selectCheckTemplateRuleVo"/> where id = #{id} </select> - + <insert id="insertCheckTemplateRule" useGeneratedKeys="true" keyProperty="id"> insert into t_check_template_rule <trim prefix="(" suffix=")" suffixOverrides=","> <if test="checkTemplateId != null">check_template_id,</if> <if test="checkRuleId != null">check_rule_id,</if> <if test="weight != null">weight,</if> - <if test="maxScore != null">max_score,</if> - <if test="auditState != null">audit_state,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="checkTemplateId != null">#{checkTemplateId},</if> <if test="checkRuleId != null">#{checkRuleId},</if> <if test="weight != null">#{weight},</if> - <if test="maxScore != null">#{maxScore},</if> - <if test="auditState != null">#{auditState},</if> </trim> </insert> @@ -55,8 +48,6 @@ <if test="checkTemplateId != null">check_template_id = #{checkTemplateId},</if> <if test="checkRuleId != null">check_rule_id = #{checkRuleId},</if> <if test="weight != null">weight = #{weight},</if> - <if test="maxScore != null">max_score = #{maxScore},</if> - <if test="auditState != null">audit_state = #{auditState},</if> </trim> where id = #{id} </update> @@ -66,9 +57,28 @@ </delete> <delete id="deleteCheckTemplateRuleByIds"> - delete from t_check_template_rule where id in + delete from t_check_template_rule where id in <foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach> </delete> -</mapper> \ No newline at end of file + + <delete id="deleteByTemplateId"> + delete from t_check_template_rule where check_template_id = #{templateId} + </delete> + <select id="selectListByTemplateId" resultType="com.ycl.platform.domain.entity.CheckTemplateRule"> + select tctr.*,tcr.rule_name as checkRuleName,tcr.rule_index from t_check_template_rule tctr + left join t_check_rule tcr on tctr.check_rule_id = tcr.id + where tctr.check_template_id = #{checkTemplateId} + </select> + + <select id="getAllRuleTemplate" resultType="com.ycl.platform.domain.vo.RuleExcelVO"> + select cr.id as ruleId,ct.examine_category as examineCategory,ct.examine_tag as examineTag,ct.template_name as templateName,cr.rule_name as ruleName,ctr.weight as weight,cr.rule_description as ruleDescription + from t_check_template_rule ctr + left join t_check_template ct on ctr.check_template_id = ct.id + left join t_check_rule cr on ctr.check_rule_id = cr.id + where ct.status = 0 and ct.deleted = 0 + + </select> + +</mapper> -- Gitblit v1.8.0