<?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.xhpc.general.mapper.XhpcDictBizQuantityCheckMapper">
    <select id="countCodeRows" resultType="java.lang.Integer">
          select count(code) from xhpc_dict_biz where code=#{code} and del_flag=0
    </select>

    <select id="countSameParentChildValueColumns" resultType="java.lang.Integer">
        select count(dict_biz_id) from xhpc_dict_biz where parent_id=#{id} and dict_value=#{key} and del_flag=0
    </select>

    <select id="countSameParentChildKeyColumns" resultType="java.lang.Integer">
        select count(dict_biz_id) from xhpc_dict_biz where parent_id=#{id} and dict_key=#{key} and del_flag=0
    </select>

    <select id="countParentName" resultType="java.lang.Integer">
        select count(dict_biz_id) from xhpc_dict_biz where parent_id=0 and dict_value=#{name} and del_flag=0
    </select>
</mapper>