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

import com.unis.framework.common.pojo.PageResult;
import com.unis.framework.mybatis.core.mapper.BaseMapperX;
import com.unis.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.unis.module.coding.controller.admin.lqjcxx.vo.LqjcxxPageReqVO;
import com.unis.module.coding.dal.dataobject.lqjcxx.LqjcxxDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 粮情检测信息 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface LqjcxxMapper extends BaseMapperX<LqjcxxDO> {

    default PageResult<LqjcxxDO> selectPage(LqjcxxPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<LqjcxxDO>()
                .eqIfPresent(LqjcxxDO::getCfId, reqVO.getCfId())
                .eqIfPresent(LqjcxxDO::getHwkId, reqVO.getHwkId())
                .eqIfPresent(LqjcxxDO::getCww, reqVO.getCww())
                .eqIfPresent(LqjcxxDO::getCws, reqVO.getCws())
                .eqIfPresent(LqjcxxDO::getCnw, reqVO.getCnw())
                .eqIfPresent(LqjcxxDO::getCns, reqVO.getCns())
                .eqIfPresent(LqjcxxDO::getLszgw, reqVO.getLszgw())
                .eqIfPresent(LqjcxxDO::getLszdw, reqVO.getLszdw())
                .eqIfPresent(LqjcxxDO::getLspjw, reqVO.getLspjw())
                .eqIfPresent(LqjcxxDO::getFileIds, reqVO.getFileIds())
                .betweenIfPresent(LqjcxxDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(LqjcxxDO::getId));
    }

}