package com.willalp.push.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.willalp.push.domain.HsAppPush;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * APP用户推送标识信息Mapper接口
 *
 * @author willalp
 * @date 2022-05-13
 */
public interface HsAppPushMapper extends BaseMapper<HsAppPush> {
    /**
     * 查询APP用户推送标识信息列表
     *
     * @param hsAppPush APP用户推送标识信息
     * @return APP用户推送标识信息集合
     */
    List<HsAppPush> selectHsAppPushList(HsAppPush hsAppPush);

    /**
     * @param un
     * @return
     */
    @Select("SELECT open_id FROM willalp_master_dev.sys_user WHERE user_name = #{un}")
    String getOpenIdByUserNo(@Param("un") String un);

    /**
     * @param un
     * @return
     */
    @Select("SELECT open_id pushCid,user_name userNo FROM willalp_master_dev.sys_user")
    List<HsAppPush> getOpenIds();
}
