package com.fs.project.mapper;

import java.util.List;
import com.fs.project.domain.ProjectContract;
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 ProjectContractMapper 
{
    /**
     * 查询项目合同信息
     * 
     * @param id 项目合同信息主键
     * @return 项目合同信息
     */
    public ProjectContract selectProjectContractById(Long id);

    /**
     * 查询项目合同信息列表
     * 
     * @param projectContract 项目合同信息
     * @return 项目合同信息集合
     */
    public List<ProjectContract> selectProjectContractList(ProjectContract projectContract);

    /**
     * 新增项目合同信息
     * 
     * @param projectContract 项目合同信息
     * @return 结果
     */
    public int insertProjectContract(ProjectContract projectContract);

    /**
     * 修改项目合同信息
     * 
     * @param projectContract 项目合同信息
     * @return 结果
     */
    public int updateProjectContract(ProjectContract projectContract);

    /**
     * 删除项目合同信息
     * 
     * @param id 项目合同信息主键
     * @return 结果
     */
    public int deleteProjectContractById(Long id);

    /**
     * 批量删除项目合同信息
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteProjectContractByIds(Long[] ids);
    @Delete("delete from project_contract where project_id = #{projectId}")
    void deleteByProjectId(Long projectId);

    @Select("select * from project_contract where project_id = #{projectId} and del_flag = 0")
    List<ProjectContract> selectByProjectId(Long id);

    @Delete({
            "<script>",
            "delete from project_contract where project_id in",
            "<foreach collection='ids' item='id' open='(' separator=',' close=')'>",
            "#{id}",
            "</foreach>",
            "</script>"
    })
    void deleteByProjectIds(@Param("ids")Long[] ids);
}
