gaoluyang
2026-10-30 cbadfd8e691ab335965202a984db16e55ac8e42c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package cn.iocoder.yudao.module.hrm.dal.mysql.asset;
 
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.hrm.controller.admin.asset.vo.HrmAssetStocktakingPageReqVO;
import cn.iocoder.yudao.module.hrm.dal.dataobject.asset.HrmAssetStocktakingDO;
import org.apache.ibatis.annotations.Mapper;
 
import java.time.LocalDate;
 
/**
 * 资产盘点 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface HrmAssetStocktakingMapper extends BaseMapperX<HrmAssetStocktakingDO> {
 
    default PageResult<HrmAssetStocktakingDO> selectPage(HrmAssetStocktakingPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<HrmAssetStocktakingDO>()
                .eqIfPresent(HrmAssetStocktakingDO::getAssetId, reqVO.getAssetId())
                .betweenIfPresent(HrmAssetStocktakingDO::getStocktakingDate, reqVO.getStocktakingDate())
                .eqIfPresent(HrmAssetStocktakingDO::getResult, reqVO.getResult())
                .orderByDesc(HrmAssetStocktakingDO::getStocktakingDate)
                .orderByDesc(HrmAssetStocktakingDO::getId));
    }
 
    default Long selectCountByAssetId(Long assetId) {
        return selectCount(HrmAssetStocktakingDO::getAssetId, assetId);
    }
 
    default HrmAssetStocktakingDO selectByAssetIdAndDate(Long assetId, LocalDate stocktakingDate) {
        return selectOne(new LambdaQueryWrapperX<HrmAssetStocktakingDO>()
                .eq(HrmAssetStocktakingDO::getAssetId, assetId)
                .eq(HrmAssetStocktakingDO::getStocktakingDate, stocktakingDate));
    }
 
}