package com.emr.dao.emrReasonAnnoModel;

import com.emr.entity.emrReasonAnnoModel.Emr_Reason_Anno_Model;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface Emr_Reason_Anno_ModelMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Emr_Reason_Anno_Model record);

    int insertSelective(Emr_Reason_Anno_Model record);

    Emr_Reason_Anno_Model selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Emr_Reason_Anno_Model record);

    int updateByPrimaryKey(Emr_Reason_Anno_Model record);
    /**
     *根据用户名称查询分类
     * */
    List<Emr_Reason_Anno_Model> selectAllAnnoTypeByCreater(@Param("creaters") String creaters,@Param("isEffective")Integer isEffective);
    /**
     *根据用户名称查询未添加内容的分类
     * */
    List<Emr_Reason_Anno_Model> selectNotContentAllAnnoTypeByCreater(@Param("creaters") String creaters);
    /**
     *根据用户名称查询模板集合
     * */
    List<Emr_Reason_Anno_Model> selectAnnoTemplateListByCreater(@Param("typeFlag")String typeFlag,@Param("creaters") String creaters,@Param("record")Emr_Reason_Anno_Model record);
    /**
     *根据用户名和收藏类别名称查验类别名称是否存在
     * */
    Emr_Reason_Anno_Model checkAnoTypeNameByCreaterAndTypeName(@Param("creater")String creater,@Param("typeFlag")String typeFlag,@Param("typeName")String typeName,@Param("parentId")Integer parentId);
    /**
     *根据标志分类原因模板集合和标注模板集合
     * */
    List<Emr_Reason_Anno_Model> selectReasonOrAnnoTemplateList(@Param("typeFlag")String typeFlag,@Param("creaters")String creaters);
    /**
     *根据模板id查询内容
     * */
    String selectContentByParentId(@Param("parentId")Integer parentId);
    /**
     *根据模板id查询内容是否存在
     * */
    Emr_Reason_Anno_Model checkContentByParentId(@Param("creater") String creater,@Param("record")Emr_Reason_Anno_Model record);
    /**
     *删除父集时，父id置空
     * */
    void updateByDelParentId(Integer parentId);
    /**
     *根据id查询带类别名称的对象
     * */
    Emr_Reason_Anno_Model getAnnoTemplateById(@Param("id")Integer id);
    /**
     *根据id集合查询
     * */
    List<Emr_Reason_Anno_Model> selectAllByIds(@Param("checks")String checks);
}