package com.fs.doctor.mapper;

import java.util.List;
import com.fs.doctor.domain.DoctorLevelMaterial;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 定级证明材料Mapper接口
 * 
 * @author fs
 * @date 2025-12-30
 */
public interface DoctorLevelMaterialMapper 
{
    /**
     * 查询定级证明材料
     * 
     * @param id 定级证明材料主键
     * @return 定级证明材料
     */
    public DoctorLevelMaterial selectDoctorLevelMaterialById(Long id);

    /**
     * 查询定级证明材料列表
     * 
     * @param doctorLevelMaterial 定级证明材料
     * @return 定级证明材料集合
     */
    public List<DoctorLevelMaterial> selectDoctorLevelMaterialList(DoctorLevelMaterial doctorLevelMaterial);

    /**
     * 新增定级证明材料
     * 
     * @param doctorLevelMaterial 定级证明材料
     * @return 结果
     */
    public int insertDoctorLevelMaterial(DoctorLevelMaterial doctorLevelMaterial);

    /**
     * 修改定级证明材料
     * 
     * @param doctorLevelMaterial 定级证明材料
     * @return 结果
     */
    public int updateDoctorLevelMaterial(DoctorLevelMaterial doctorLevelMaterial);

    /**
     * 删除定级证明材料
     * 
     * @param id 定级证明材料主键
     * @return 结果
     */
    public int deleteDoctorLevelMaterialById(Long id);

    /**
     * 批量删除定级证明材料
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteDoctorLevelMaterialByIds(Long[] ids);

    void batchInsert(List<DoctorLevelMaterial> list);

    @Delete("DELETE FROM doctor_level_material WHERE apply_id = #{applyId}")
    void deleteDoctorLevelMaterialByDoctorLevelApplyId(@Param("applyId") Long applyId);

    @Select("SELECT * FROM doctor_level_material WHERE apply_id = #{applyId} AND deleted = 0 ORDER BY sort_order ASC, id ASC")
    List<DoctorLevelMaterial> selectByApplyId(@Param("applyId") Long applyId);

    void deleteDoctorLevelMaterialByDoctorLevelApplyIds(Long[] ids);
}
