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

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.cwxx.vo.CwxxPageReqVO;
import com.unis.module.coding.dal.dataobject.cwxx.CwxxDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 财务信息 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface CwxxMapper extends BaseMapperX<CwxxDO> {

    default PageResult<CwxxDO> selectPage(CwxxPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CwxxDO>()
                .eqIfPresent(CwxxDO::getSfgykg, reqVO.getSfgykg())
                .eqIfPresent(CwxxDO::getSyndzzc, reqVO.getSyndzzc())
                .eqIfPresent(CwxxDO::getGd, reqVO.getGd())
                .eqIfPresent(CwxxDO::getDeptId, reqVO.getDeptId())
                .orderByDesc(CwxxDO::getId));
    }

    default CwxxDO selectByKqId(Long kqId){
        return selectOne(CwxxDO::getKqid,kqId);
    }
}