package com.xhpc.general.mapper;

import org.apache.ibatis.annotations.Param;

/**
 * 业务字典数条数mapper
 * program: Getting the quantity of one column's rows.
 * User: HongYun
 * Date:2021-07-28 15
 */
public interface XhpcDictBizQuantityCheckMapper {
    /**
     * Ensuring the father's code is unique.
     * @param code
     * @return
     */
    int countCodeRows(@Param("code") String code);

    /**
     * Ensuring the child's keyValue is unique.
     * @param parentId
     * @param key  Value
     * @return
     */
    int countSameParentChildValueColumns(@Param("id") Long parentId, @Param("key") String key);

    int countSameParentChildKeyColumns(@Param("id") Long parentId, @Param("key") String key);

    /**
     * Judging the name whether has existed in father items.
     * @param name
     * @return
     */
    int countParentName(@Param("name") String name);






}
