选煤厂生产管理平台后台代码
dongyukun
2024-12-10 532d0b7f83815ebeb4be9aa1f7a6683ede831b6a
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
package com.iailab.module.pms.production.warehouse.dao;
 
import com.iailab.framework.common.dao.BaseDao;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.mybatis.core.mapper.BaseMapperX;
import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.iailab.module.pms.production.warehouse.entity.McMzEntity;
import com.iailab.module.pms.production.warehouse.vo.McMzPageReqVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;
 
import java.util.List;
 
@Mapper
@Component
public interface McMzDao extends BaseMapperX<McMzEntity> {
 
    @Select("SELECT * , SUM(proportion) OVER () as den FROM t_mc_mz WHERE mc = #{mc}")
    List<McMzEntity> selectMzList(@Param("mc") String mc);
 
    @Delete("DELETE FROM t_mc_mz WHERE mc = #{mc}")
    void deleteByMc(@Param("mc") String mc);
 
    default PageResult<McMzEntity> selectPage(McMzPageReqVO Entity) {
        return selectPage(Entity, new LambdaQueryWrapperX<McMzEntity>()
                .orderByDesc(McMzEntity::getCreateBy));
    }
}