package com.unis.module.coding.dal.mysql.users;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.unis.framework.mybatis.core.mapper.BaseMapperX;
import com.unis.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.unis.module.coding.dal.dataobject.bank.BankDO;
import com.unis.module.coding.dal.dataobject.users.UsersDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 存粮人选定仓 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface UsersMapper extends BaseMapperX<UsersDO> {

    default List<UsersDO> selectListBycaIds(List<Long> caIds) {
        return selectList(
                new LambdaQueryWrapperX<UsersDO>()
                        .inIfPresent(UsersDO::getCaId, caIds)

        );
    }
    default List<UsersDO> selectListByKqId(Long  kqId) {
        return selectList(
                new LambdaQueryWrapper<UsersDO>()
                        .eq(kqId!=null,UsersDO::getKqId, kqId)
        );
    }
}