package com.winsun.migration.mapper.db3;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * 一人一码数据接口
 *
 * @date 2021-02-02 10:06
 */
@Mapper
@Component
public interface YrymDatabases {

    @Select("SELECT " +
            " du.*, " +
            " GROUP_CONCAT( dr.NAME ) role_name, " +
            " dus.spervisor  " +
            " FROM " +
            " dzqd_user du " +
            " LEFT JOIN dzqd_user_role dur ON du.user_id = dur.user_id " +
            " LEFT JOIN dzqd_user_supervisor dus ON du.user_id = dus.id " +
            " LEFT JOIN dzqd_role dr ON dur.role_id = dr.role_id " +
            " GROUP BY " +
            " du.user_id ")
    List<Map<String, Object>> getLoginUserList();

    @Select("select * from hhr_school_package where package_id is not null")
    List<Map<String, Object>> getSchoolPackage();

    @Select("select * from hhr_school_xb_package")
    List<Map<String, Object>> getSchoolXbPackage();

}
