<?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.xintong.visualinspection.dao.master.CheckRuleItemDao" >

    <insert id="insert" parameterType="com.xintong.visualinspection.bean.CheckItem" >
        INSERT INTO
        check_rule_item
        (rule_id,item_id)
        VALUES
        (#{rule_id},#{id})
    </insert>

    
    <delete id="delete" parameterType="com.xintong.visualinspection.bean.CheckItem" >
        DELETE FROM
        check_rule_item
        WHERE
        rule_id=#{rule_id} and item_id=#{id}
    </delete>
    
    <select id="selectItemCount" parameterType="com.xintong.visualinspection.bean.CheckItem" resultType="java.lang.Integer">
    	SELECT COUNT(1) FROM check_rule_item 
    	WHERE
    	rule_id=#{rule_id} and item_id=#{id}
    </select>
    
</mapper>