2 天以前 ac2545f3cd01f3061a107e4980fc6fa59eaeaa6b
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
40
41
42
43
44
package cn.iocoder.yudao.module.mes.dal.mysql.pro.batch;
 
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.mes.controller.admin.pro.batch.vo.MesProBatchPageReqVO;
import cn.iocoder.yudao.module.mes.dal.dataobject.pro.batch.MesProBatchDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
 
/**
 * MES 生产批次 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface MesProBatchMapper extends BaseMapperX<MesProBatchDO> {
 
    default MesProBatchDO selectByCode(String code) {
        return selectOne(MesProBatchDO::getCode, code);
    }
 
    default Long selectCountByLineId(Long lineId) {
        return selectCount(MesProBatchDO::getLineId, lineId);
    }
 
    @Select("SELECT * FROM mes_pro_batch WHERE id = #{id} AND deleted = 0 FOR UPDATE")
    MesProBatchDO selectByIdForUpdate(@org.apache.ibatis.annotations.Param("id") Long id);
 
    default PageResult<MesProBatchDO> selectPage(MesProBatchPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MesProBatchDO>()
                .likeIfPresent(MesProBatchDO::getCode, reqVO.getCode())
                .eqIfPresent(MesProBatchDO::getItemId, reqVO.getItemId())
                .eqIfPresent(MesProBatchDO::getLineId, reqVO.getLineId())
                .likeIfPresent(MesProBatchDO::getLineCode, reqVO.getLineCode())
                .likeIfPresent(MesProBatchDO::getLineName, reqVO.getLineName())
                .eqIfPresent(MesProBatchDO::getOwnerUserId, reqVO.getOwnerUserId())
                .eqIfPresent(MesProBatchDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(MesProBatchDO::getProduceDate, reqVO.getProduceDate())
                .betweenIfPresent(MesProBatchDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MesProBatchDO::getId));
    }
 
}