package cn.iocoder.yudao.module.system.dal.mysql.biz;

/**
 * @Author: jinyd
 * @CreateTime: 2024/8/19  11:34
 * @Description:
 * @Version: 4.0
 */

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.controller.admin.biz.vo.DeviceProductRespVO;
import cn.iocoder.yudao.module.system.controller.admin.biz.vo.SupplierInfoPageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.biz.vo.SupplierInfoRespVO;
import cn.iocoder.yudao.module.system.dal.dataobject.biz.DeviceWarnUserDO;
import cn.iocoder.yudao.module.system.dal.dataobject.biz.SupplierInfoDO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 报警信息 Mapper
 *
 * @author 系统管理员
 */
@Mapper
public interface SupplierInfoMapper extends BaseMapperX<SupplierInfoDO> {

    default PageResult<SupplierInfoDO> selectPage(SupplierInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SupplierInfoDO>()
                .likeIfPresent(SupplierInfoDO::getSupplierName, reqVO.getSupplierName())
                .eqIfPresent(SupplierInfoDO::getTypeName, reqVO.getTypeName())
                .eqIfPresent(SupplierInfoDO::getContacts, reqVO.getContacts())
                .eqIfPresent(SupplierInfoDO::getPhone, reqVO.getPhone())
                .eqIfPresent(SupplierInfoDO::getAddress, reqVO.getAddress())
                .eqIfPresent(SupplierInfoDO::getBusinessScope, reqVO.getBusinessScope())
                .likeIfPresent(SupplierInfoDO::getAccountName, reqVO.getAccountName())
                .eqIfPresent(SupplierInfoDO::getDepositBank, reqVO.getDepositBank())
                .eqIfPresent(SupplierInfoDO::getBankAccount, reqVO.getBankAccount())
                .eqIfPresent(SupplierInfoDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(SupplierInfoDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(SupplierInfoDO::getId));
    }

    List<SupplierInfoRespVO> selectSupplierInfoList(@Param("page") Page<DeviceProductRespVO> page, @Param("pageVO") SupplierInfoPageReqVO pageReqVO);
}
