fuliqi
2024-04-19 0c1f76c4a9c34a2adb05a94da4b20f3560374a29
ycl-server/src/main/resources/mapper/zgyw/CheckTemplateRuleMapper.xml
@@ -5,16 +5,14 @@
<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">
@@ -22,7 +20,6 @@
        <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>
    
@@ -37,15 +34,11 @@
            <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>
@@ -71,4 +62,11 @@
            #{id}
        </foreach>
    </delete>
    <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 * from t_check_template_rule where check_template_id = #{checkTemplateId}
    </select>
</mapper>