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

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.unis.framework.common.pojo.PageResult;
import com.unis.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.unis.framework.mybatis.core.mapper.BaseMapperX;
import com.unis.module.coding.controller.admin.delivery.vo.DeliveryPageReqVO;
import com.unis.module.coding.controller.admin.delivery.vo.DeliveryRespVO;
import com.unis.module.coding.controller.admin.delivery.vo.StorePageReqVO;
import com.unis.module.coding.controller.admin.delivery.vo.StoreRespVO;
import com.unis.module.coding.dal.dataobject.dwxx.DwxxDO;
import org.apache.ibatis.annotations.Mapper;
import com.unis.module.coding.controller.admin.dwxx.vo.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 单位信息 Mapper
 *
 * @author 超级管理员
 */
@SuppressWarnings("all")
@Mapper
public interface DwxxMapper extends BaseMapperX<DwxxDO> {

    default PageResult<DwxxDO> selectPage(DwxxPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DwxxDO>()
                .eqIfPresent(DwxxDO::getDwmc, reqVO.getDwmc())
                .orderByDesc(DwxxDO::getId));
    }

    Page<DeliveryRespVO> selectWrapperPage(Page<Object> objectPage, @Param("pageReqVO") DeliveryPageReqVO pageReqVO);

    Page<DeliveryRespVO> selectWrapperPageForSheng(Page<Object> objectPage, @Param("pageReqVO") DeliveryPageReqVO pageReqVO);

    Page<DeliveryRespVO> selectWrapperPageForBank(Page<Object> objectPage, @Param("pageReqVO") DeliveryPageReqVO pageReqVO);

    List<StoreRespVO> getStoreListForNation(@Param("pageReqVO") StorePageReqVO pageReqVO);
    int deleteByDwId(@Param("id")Long id);
}