package com.cf.imes.module.manage.dal.mysql.pack;


import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.cf.imes.module.manage.controller.admin.process.vo.OrderBodyRespVo;
import com.cf.imes.module.manage.dal.dataobject.pack.OrderBodyDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface OrderBodyMapper extends BaseMapperX<OrderBodyDO> {


    default List<OrderBodyDO> selectGroup(Long orderId) {
        return selectList(new LambdaQueryWrapperX<OrderBodyDO>()
                .eqIfPresent(OrderBodyDO::getOrderId, orderId)
                .orderByDesc(OrderBodyDO::getId));
    }




    default List<OrderBodyDO> selectListByOrderId(Long orderId,Long organId,Long bodyId) {
        return selectList(new LambdaQueryWrapperX<OrderBodyDO>()
                .eq(OrderBodyDO::getOrganId,organId)
                .eqIfPresent(OrderBodyDO::getId,bodyId)
                .eqIfPresent(OrderBodyDO::getOrderId, orderId));
    }


}
