package com.goafanti.common.dao;

import com.goafanti.common.model.OrganizationIdentity;
import com.goafanti.user.bo.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * (OrganizationIdentity)表数据库访问层
 *
 * @author makejava
 * @since 2025-04-16 11:08:21
 */
public interface OrganizationIdentityMapper {

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    OrganizationIdentity selectById(String id);

    



    /**
     * 新增数据
     *
     * @param organizationIdentity 实例对象
     * @return 影响行数
     */
    int insert(OrganizationIdentity organizationIdentity);


    /**
     * 批量新增或按主键更新数据（MyBatis原生foreach方法）
     *
     * @param entities List<OrganizationIdentity> 实例对象列表
     * @return 影响行数
     * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常，请自行校验入参
     */
    int insertOrUpdateBatch(@Param("entities") List<OrganizationIdentity> entities);

    /**
     * 修改数据
     *
     * @param organizationIdentity 实例对象
     * @return 影响行数
     */
    int update(OrganizationIdentity organizationIdentity);

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 影响行数
     */
    int deleteById(String id);



    OrganizationIdentity selectOrgIdentityByUserId(String uid);

    OrgBasicInfoBo selectBasicInfo(String uid, int year);

    OrgIdentityDetailBo selectOrgIdentityDetailByUserId(String uid);

    AuditorOrgIdentityDetailBo selectAuditorOrgIdentityDetailByUserId(@Param("uid")String uid, @Param("year")Integer year);

    OrgIdentityBo selectOrgIdentityBoByUserId(String uid);

    List<OrgUnitNames> selectManagerUnitNames(String aid);

    List<OrgUnitNames> selectAllOrgIndentity(String aid);

    List<OrgUnitNames> selectManagerAchievementOrgOwner(@Param("aid")String aid, @Param("name")String name);

    List<OrgUnitNames> selectAchievementOrgOwner(@Param("aid")String aid, @Param("name")String name);

    int updateServiceByUid(OrganizationIdentity org);

    void insertBatch(List<InputUserChannel> list);

    List<OrganizationIdentity> selectByOrgCode(String orgCode);

}

