package pwc.taxtech.atms.dao;

import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyMapper;
import pwc.taxtech.atms.dto.user.UserOrgRoleDto;
import pwc.taxtech.atms.entitiy.UserOrganizationRole;
import pwc.taxtech.atms.entitiy.UserOrganizationRoleExample;

@Mapper
public interface UserOrganizationRoleMapper extends MyMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table UserOrganizationRole
     *
     * @mbg.generated
     */
    long countByExample(UserOrganizationRoleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table UserOrganizationRole
     *
     * @mbg.generated
     */
    int deleteByExample(UserOrganizationRoleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table UserOrganizationRole
     *
     * @mbg.generated
     */
    int deleteByPrimaryKey(String ID);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table UserOrganizationRole
     *
     * @mbg.generated
     */
    int insert(UserOrganizationRole record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table UserOrganizationRole
     *
     * @mbg.generated
     */
    int insertSelective(UserOrganizationRole record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table UserOrganizationRole
     *
     * @mbg.generated
     */
    List<UserOrganizationRole> selectByExampleWithRowbounds(UserOrganizationRoleExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table UserOrganizationRole
     *
     * @mbg.generated
     */
    List<UserOrganizationRole> selectByExample(UserOrganizationRoleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table UserOrganizationRole
     *
     * @mbg.generated
     */
    UserOrganizationRole selectByPrimaryKey(String ID);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table UserOrganizationRole
     *
     * @mbg.generated
     */
    int updateByExampleSelective(@Param("record") UserOrganizationRole record, @Param("example") UserOrganizationRoleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table UserOrganizationRole
     *
     * @mbg.generated
     */
    int updateByExample(@Param("record") UserOrganizationRole record, @Param("example") UserOrganizationRoleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table UserOrganizationRole
     *
     * @mbg.generated
     */
    int updateByPrimaryKeySelective(UserOrganizationRole record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table UserOrganizationRole
     *
     * @mbg.generated
     */
    int updateByPrimaryKey(UserOrganizationRole record);


    List<UserOrgRoleDto> getUserOrganizationRoleList();

    @Select("SELECT UserOrganization.UserID from UserOrganizationRole "
            + "JOIN UserOrganization ON UserOrganizationRole.UserOrganizationID = UserOrganization.ID "
            + "WHERE UserOrganizationRole.RoleID=#{roleID}")
    List<String> getUserIDByUserOrganizationRole(@Param("roleID") String roleID);
}