Merge remote-tracking branch 'origin/feature/DM/nflg-bom' into feature/DM/nflg-bom

This commit is contained in:
大米 2024-01-03 16:14:27 +08:00
commit 017646bd95
10 changed files with 470 additions and 271 deletions

View File

@ -4,7 +4,9 @@ import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.nflg.product.base.core.api.BaseApi;
import com.nflg.product.base.core.exception.NflgBusinessException;
import com.nflg.product.bomnew.constant.FactoryCodeEnum;
import com.nflg.product.bomnew.constant.MBomConstantEnum;
import com.nflg.product.bomnew.constant.ValueEnum;
import com.nflg.product.bomnew.pojo.query.BomNewMbomParentQuery;
import com.nflg.product.bomnew.pojo.vo.BomNewMbomDetailVO;
import com.nflg.product.bomnew.pojo.vo.BomNewMbomParentVO;
@ -29,7 +31,7 @@ import java.util.Objects;
* @author makejava
* @since 2024-01-01 10:53:24
*/
@Api(tags = "接口")
@Api(tags = "Mbom接口")
@RestController
@RequestMapping("mbom")
public class MBomApi extends BaseApi {
@ -57,6 +59,17 @@ public class MBomApi extends BaseApi {
}
@GetMapping("factoryList")
@ApiOperation("工厂列表")
public ResultVO<List> factoryList() {
List list= EnumUtils.listEnum( FactoryCodeEnum.class);
return ResultVO.success(list);
}
@PostMapping("superSaterialList")
@ApiOperation("设置超级物料列表")
public ResultVO<List<BomNewMbomDetailVO>> superSaterialList(@RequestParam(value = "rowId") Long rowId ) {
@ -81,8 +94,8 @@ public class MBomApi extends BaseApi {
if(StrUtil.isEmpty(EnumUtils.getEnumDescription(MBomConstantEnum.MBomSuperMaterialStatusEnum.class,status))){
throw new NflgBusinessException(STATE.ParamErr,"status 不在范围内");
}
return ResultVO.success();
bomNewMbomDetailService.superSaterialStatusTag(rowId,status);
return ResultVO.success(true);
}

View File

@ -1,11 +1,13 @@
package com.nflg.product.bomnew.constant;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum FactoryCodeEnum {
public enum FactoryCodeEnum implements ValueEnum<String> {
FACTORY_1010 ("1010", "泉州工厂"),
FACTORY_1020("1020", "仙桃工厂");

View File

@ -2,7 +2,15 @@ package com.nflg.product.bomnew.mapper.master;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nflg.product.bomnew.pojo.entity.BomNewMbomParentEntity;
import com.nflg.product.bomnew.pojo.query.BomNewMbomParentQuery;
import com.nflg.product.bomnew.pojo.query.OriginalBomQuery;
import com.nflg.product.bomnew.pojo.vo.BomNewMbomMiddleVO;
import com.nflg.product.bomnew.pojo.vo.BomOriginalListVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* t_bom_new_mbom_parent 表数据库访问层
@ -12,4 +20,25 @@ import com.nflg.product.bomnew.pojo.entity.BomNewMbomParentEntity;
* @since 2024-01-01 10:53:24
*/
public interface BomNewMbomParentMapper extends BaseMapper<BomNewMbomParentEntity> {
Page<BomNewMbomMiddleVO> getMBomListPage(Page<BomNewMbomMiddleVO> page, @Param("query") BomNewMbomParentQuery query );
/**
* 查询索引
* @param page
* @param query
* @return
*/
Page<BomNewMbomMiddleVO> indexListPage(Page<BomNewMbomMiddleVO> page, @Param("query") BomNewMbomParentQuery query );
/**
* 递归向上查找所有数据
* @param rowId 当前行
* @return
*/
List<BomNewMbomMiddleVO> searchList(@Param("rowId") Long rowId );
}

View File

@ -33,10 +33,19 @@ public class BomNewMbomBackMaterialEntity implements Serializable {
/**
* 退回的row_id(和ebom表row_id 关联)
*/
@TableField(value = "source_id")
@ApiModelProperty(value = "退回的row_id(和ebom表row_id 关联)")
private Long sourceId;
@TableField(value = "source_row_id")
@ApiModelProperty(value = "退回的row_id pbom表")
private Long sourceRowId;
@TableField(value = "detail_row_id")
@ApiModelProperty(value = "detail行id)")
private Long detailRowId;
@TableField(value = "bom_row_id")
@ApiModelProperty(value = "mbom_parent表row_id关联)")
private Long bomRowId;
/**
* 退回人名称
*/

View File

@ -20,20 +20,8 @@ import java.time.LocalDate;
@Data
@Accessors(chain = true)
@ApiModel(value="com-nflg-product-bomnew-pojo-new-query-BomNewMbomParentEntityQuery")
public class BomNewMbomParentQuery implements Serializable {
/**
* 主键行ID-雪花
*/
@ApiModelProperty(value = "主键行ID-雪花")
private Long rowId;
/**
* 批号-来自plm-临时
*/
@ApiModelProperty(value = "批号-来自plm-临时")
private String batchNo;
public class BomNewMbomParentQuery extends BasePageQuery implements Serializable {
/**
* 图号
*/
@ -51,222 +39,44 @@ public class BomNewMbomParentQuery implements Serializable {
*/
@ApiModelProperty(value = "物料编码")
private String materialNo;
/**
* 排序号
*/
@ApiModelProperty(value = "排序号")
private String orderNumber;
/**
* 物料名称
*/
@ApiModelProperty(value = "物料名称")
private String materialName;
/**
* 物料描述
*/
@ApiModelProperty(value = "物料描述")
private String materialDesc;
/**
* 材质材料
*/
@ApiModelProperty(value = "材质,材料")
private String materialTexture;
/**
* 单位
*/
@ApiModelProperty(value = "单位")
private String materialUnit;
/**
* 单重
*/
@ApiModelProperty(value = "单重")
private BigDecimal unitWeight;
/**
* 总重
*/
@ApiModelProperty(value = "总重")
private BigDecimal totalWeight;
/**
* 版本号
*/
@ApiModelProperty(value = "版本号")
private String currentVersion;
/**
* 数量
*/
@ApiModelProperty(value = "数量")
private BigDecimal num;
/**
* 是否最新版0- 1-
*/
@ApiModelProperty(value = "是否最新版0-否 1-是")
private Integer lastVersionIs;
/**
* 1待发布sap3=已发布
*/
@ApiModelProperty(value = "1、待发布sap、3=已发布")
private Integer status;
/**
* 发布sap人员
*/
@ApiModelProperty(value = "发布sap人员")
private String sysnSapUserName;
/**
* 发布sap时间
*/
@ApiModelProperty(value = "发布sap时间")
private LocalDateTime sysnSapTime;
/**
* 开始发布sap时间
*/
@ApiModelProperty(value = "发布sap时间开始时间")
private LocalDateTime sysnSapTimeStart;
/**
* 结束发布sap时间
*/
@ApiModelProperty(value = "发布sap时间结束时间")
private LocalDateTime sysnSapTimeEnd;
/**
* 来源行ID(PBOM中parent的行ID)
*/
@ApiModelProperty(value = "来源行ID(PBOM中parent的行ID)")
private Long sourceRowId;
/**
* 设计人员编码
*/
@ApiModelProperty(value = "设计人员编码")
private String deviseUserCode;
/**
* 设计人员名称
*/
@ApiModelProperty(value = "设计人员名称")
private String deviseName;
/**
* 创建人编码
*/
@ApiModelProperty(value = "创建人编码")
private String createdBy;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
private LocalDateTime createdTime;
/**
* 开始创建时间
*/
@ApiModelProperty(value = "创建时间开始时间")
private LocalDateTime createdTimeStart;
/**
* 结束创建时间
*/
@ApiModelProperty(value = "创建时间结束时间")
private LocalDateTime createdTimeEnd;
/**
* 版本过期时间=下个版本的创建时间
*/
@ApiModelProperty(value = "版本过期时间=下个版本的创建时间")
private LocalDateTime expireEndTime;
/**
* 开始版本过期时间=下个版本的创建时间
*/
@ApiModelProperty(value = "版本过期时间=下个版本的创建时间开始时间")
private LocalDateTime expireEndTimeStart;
/**
* 结束版本过期时间=下个版本的创建时间
*/
@ApiModelProperty(value = "版本过期时间=下个版本的创建时间结束时间")
private LocalDateTime expireEndTimeEnd;
/**
* 备注
*/
@ApiModelProperty(value = "备注")
private String remark;
/**
* 设计维护部门名称
*/
@ApiModelProperty(value = "设计维护部门名称")
private String deptName;
/**
* bom树的高度
*/
@ApiModelProperty(value = "bom树的高度")
private Integer levelNum;
/**
* 升版说明
*/
@ApiModelProperty(value = "升版说明")
private String changeDesc;
/**
* 通知单号
*/
@ApiModelProperty(value = "通知单号")
private String noticeNums;
/**
* 订单号
*/
* 订单号
*/
@ApiModelProperty(value = "订单号")
private String orderNo;
@ApiModelProperty(value = "开始时间")
private String startDate;
/**
* 修改时间
*
*/
@ApiModelProperty(value = "修改时间")
private LocalDateTime modifyTime;
@ApiModelProperty(value = "结束时间")
private String endDate;
@ApiModelProperty(value = "前端忽略,创建人编码")
private String createdBy;
/**
* 开始修改时间
*/
@ApiModelProperty(value = "修改时间开始时间")
private LocalDateTime modifyTimeStart;
/**
* 结束修改时间
*/
@ApiModelProperty(value = "修改时间结束时间")
private LocalDateTime modifyTimeEnd;
/**
* 设置每页显示条数
* 1待发布sap3=已发布
*/
@ApiModelProperty(value = "设置每页显示条数")
private Long pageSize = 20L;
/**
* 当前页
*/
@ApiModelProperty(value = "当前页")
private Long page = 1L;
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "前端忽略,状态")
private Integer status;
}

View File

@ -0,0 +1,223 @@
package com.nflg.product.bomnew.pojo.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
/**
* t_bom_new_mbom_parent
*
*
* @author makejava
* @since 2024-01-01 10:53:26
*/
@Data
@Accessors(chain = true)
@ApiModel(value="com-nflg-product-bomnew-pojo-new-vo-BomNewMbomMiddleVO")
public class BomNewMbomMiddleVO extends BaseMaterialVO implements Serializable {
/**
* 主键行ID-雪花
*/
@ApiModelProperty(value = "主键行ID-雪花")
private Long rowId;
/**
* bom版本行ID,和mbom_parent表row_id关联
*/
@ApiModelProperty(value = "bom版本行ID,和mbom_parent表row_id关联")
private Long bomRowId;
/**
* 父级行ID
*/
@ApiModelProperty(value = "父级行ID")
private Long parentRowId;
/**
* 批号-来自plm-临时
*/
@ApiModelProperty(value = "批号-来自plm-临时")
private String batchNo;
/**
* 工厂编码
*/
@ApiModelProperty(value = "工厂编码")
private String facCode;
/**
* 排序号
*/
@ApiModelProperty(value = "排序号")
private String orderNumber;
/**
* 版本号
*/
@ApiModelProperty(value = "版本号")
private String currentVersion;
/**
* 数量
*/
@ApiModelProperty(value = "数量")
private BigDecimal num;
/**
* 是否最新版0- 1-
*/
@ApiModelProperty(value = "是否最新版0-否 1-是")
private Integer lastVersionIs;
/**
* 1待发布sap3=已发布
*/
@ApiModelProperty(value = "1、待发布sap、3=已发布")
private Integer status;
/**
* 发布sap人员
*/
@ApiModelProperty(value = "发布sap人员")
private String sysnSapUserName;
/**
* 发布sap时间
*/
@ApiModelProperty(value = "发布sap时间")
private LocalDateTime sysnSapTime;
/**
* 来源行ID(PBOM中parent的行ID)
*/
@ApiModelProperty(value = "来源行ID(PBOM中parent的行ID)")
private Long sourceRowId;
/**
* 设计人员编码
*/
@ApiModelProperty(value = "设计人员编码")
private String deviseUserCode;
/**
* 设计人员名称
*/
@ApiModelProperty(value = "设计人员名称")
private String deviseName;
/**
* 创建人编码
*/
@ApiModelProperty(value = "创建人编码")
private String createdBy;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
private LocalDateTime createdTime;
/**
* 版本过期时间=下个版本的创建时间
*/
@ApiModelProperty(value = "版本过期时间=下个版本的创建时间")
private LocalDateTime expireEndTime;
/**
* 备注
*/
@ApiModelProperty(value = "备注")
private String remark;
/**
* 设计维护部门名称
*/
@ApiModelProperty(value = "设计维护部门名称")
private String deptName;
/**
* bom树的高度
*/
@ApiModelProperty(value = "bom树的高度")
private Integer levelNum;
/**
* 升版说明
*/
@ApiModelProperty(value = "升版说明")
private String changeDesc;
/**
* 通知单号
*/
@ApiModelProperty(value = "通知单号")
private String noticeNums;
/**
* 订单号
*/
@ApiModelProperty(value = "订单号")
private String orderNo;
/**
* 修改时间
*/
@ApiModelProperty(value = "修改时间")
private LocalDateTime modifyTime;
/**
* 超级物料 0- 1-
*/
@ApiModelProperty(value = "超级物料 0-否 1-是")
private Integer superMaterialStatus;
/**
* 是否虚拟件 0- 1-
*/
@ApiModelProperty(value = "是否虚拟件 0-否 1-是")
private Integer virtualPartIs;
@ApiModelProperty(value = "是否有下级 0-否 1-是")
private Integer bomExist;
public Integer getBomExist(){
if(Objects.isNull(bomExist)){
return 0;
}
if(bomExist>0){return 1;}
return 0;
}
private List<BomNewMbomMiddleVO> childNodes = Collections.emptyList();
}

View File

@ -417,8 +417,19 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
//保存异常
saveException(checkEBomException);
// initBomException(list,new String[]{});
}
public void initBomException(List<BomNewEbomParentVO> list, String ... ignorePropertyList) {
CheckEBomException checkEBomException = new CheckEBomException(list);
checkEBomException.initException(ignorePropertyList);
//保存异常
saveException(checkEBomException);
}
public void checkBomException(List<BomNewEbomParentVO> list) {
CheckEBomException checkEBomException = new CheckEBomException(list);
checkEBomException.checkException();
@ -1326,7 +1337,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
"projectType",
"procureType",
"materialUnit",
"material",
"material",
"materialTexture",
"materialGetType"
};
@ -1337,7 +1348,8 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
// CheckEBomException checkEBomException = new CheckEBomException(checkBom);
// checkEBomException.checkException();
this.initBomException(checkBom);
// this.initBomException(checkBom);
checkBomException(checkBom);
if(CollectionUtil.isNotEmpty(dto.getDatas())){
for (BomNewEbomParentVO vo:
dto.getDatas()) {

View File

@ -33,10 +33,15 @@ import java.util.Objects;
public class BomNewMbomDetailService extends ServiceImpl<BomNewMbomDetailMapper, BomNewMbomDetailEntity> {
/**
* 退回
* @param rowId
*/
public void back(List<Long> rowId){
}

View File

@ -6,7 +6,14 @@
<!--@mbg.generated-->
<!--@Table t_bom_new_mbom_back_material -->
<id column="row_id" property="rowId" jdbcType="BIGINT"/>
<result column="source_id" property="sourceId" jdbcType="BIGINT"/>
<result column="detail_row_id" property="sourceRowId" jdbcType="BIGINT"/>
<result column="bom_row_id" property="bomRowId" jdbcType="BIGINT"/>
<result column="detail_row_id" property="detailRowId" jdbcType="BIGINT"/>
<result column="back_user_name" property="backUserName" jdbcType="VARCHAR"/>
<result column="back_user_code" property="backUserCode" jdbcType="VARCHAR"/>
<result column="status" property="status" jdbcType="INTEGER"/>

View File

@ -3,43 +3,132 @@
<mapper namespace="com.nflg.product.bomnew.mapper.master.BomNewMbomParentMapper">
<resultMap id="BaseResultMap" type="com.nflg.product.bomnew.pojo.entity.BomNewMbomParentEntity">
<!--@mbg.generated-->
<!--@Table t_bom_new_mbom_parent -->
<id column="row_id" property="rowId" jdbcType="BIGINT"/>
<result column="batch_no" property="batchNo" jdbcType="VARCHAR"/>
<result column="drawing_no" property="drawingNo" jdbcType="VARCHAR"/>
<result column="fac_code" property="facCode" jdbcType="VARCHAR"/>
<result column="material_no" property="materialNo" jdbcType="VARCHAR"/>
<result column="order_number" property="orderNumber" jdbcType="VARCHAR"/>
<result column="material_name" property="materialName" jdbcType="VARCHAR"/>
<result column="material_desc" property="materialDesc" jdbcType="VARCHAR"/>
<result column="material_texture" property="materialTexture" jdbcType="VARCHAR"/>
<result column="material_unit" property="materialUnit" jdbcType="VARCHAR"/>
<result column="unit_weight" property="unitWeight" jdbcType="DECIMAL"/>
<result column="total_weight" property="totalWeight" jdbcType="DECIMAL"/>
<result column="current_version" property="currentVersion" jdbcType="VARCHAR"/>
<result column="num" property="num" jdbcType="DECIMAL"/>
<result column="last_version_is" property="lastVersionIs" jdbcType="INTEGER"/>
<result column="status" property="status" jdbcType="INTEGER"/>
<result column="sysn_sap_user_name" property="sysnSapUserName" jdbcType="VARCHAR"/>
<result column="sysn_sap_time" property="sysnSapTime" jdbcType="TIMESTAMP"/>
<result column="source_row_id" property="sourceRowId" jdbcType="BIGINT"/>
<result column="devise_user_code" property="deviseUserCode" jdbcType="VARCHAR"/>
<result column="devise_name" property="deviseName" jdbcType="VARCHAR"/>
<result column="created_by" property="createdBy" jdbcType="VARCHAR"/>
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP"/>
<result column="expire_end_time" property="expireEndTime" jdbcType="TIMESTAMP"/>
<result column="remark" property="remark" jdbcType="VARCHAR"/>
<result column="dept_name" property="deptName" jdbcType="VARCHAR"/>
<result column="level_num" property="levelNum" jdbcType="INTEGER"/>
<result column="change_desc" property="changeDesc" jdbcType="VARCHAR"/>
<result column="notice_nums" property="noticeNums" jdbcType="VARCHAR"/>
<result column="order_no" property="orderNo" jdbcType="VARCHAR"/>
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/>
</resultMap>
<!--@mbg.generated-->
<!--@Table t_bom_new_mbom_parent -->
<id column="row_id" property="rowId" jdbcType="BIGINT"/>
<result column="batch_no" property="batchNo" jdbcType="VARCHAR"/>
<result column="drawing_no" property="drawingNo" jdbcType="VARCHAR"/>
<result column="fac_code" property="facCode" jdbcType="VARCHAR"/>
<result column="material_no" property="materialNo" jdbcType="VARCHAR"/>
<result column="order_number" property="orderNumber" jdbcType="VARCHAR"/>
<result column="material_name" property="materialName" jdbcType="VARCHAR"/>
<result column="material_desc" property="materialDesc" jdbcType="VARCHAR"/>
<result column="material_texture" property="materialTexture" jdbcType="VARCHAR"/>
<result column="material_unit" property="materialUnit" jdbcType="VARCHAR"/>
<result column="unit_weight" property="unitWeight" jdbcType="DECIMAL"/>
<result column="total_weight" property="totalWeight" jdbcType="DECIMAL"/>
<result column="current_version" property="currentVersion" jdbcType="VARCHAR"/>
<result column="num" property="num" jdbcType="DECIMAL"/>
<result column="last_version_is" property="lastVersionIs" jdbcType="INTEGER"/>
<result column="status" property="status" jdbcType="INTEGER"/>
<result column="sysn_sap_user_name" property="sysnSapUserName" jdbcType="VARCHAR"/>
<result column="sysn_sap_time" property="sysnSapTime" jdbcType="TIMESTAMP"/>
<result column="source_row_id" property="sourceRowId" jdbcType="BIGINT"/>
<result column="devise_user_code" property="deviseUserCode" jdbcType="VARCHAR"/>
<result column="devise_name" property="deviseName" jdbcType="VARCHAR"/>
<result column="created_by" property="createdBy" jdbcType="VARCHAR"/>
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP"/>
<result column="expire_end_time" property="expireEndTime" jdbcType="TIMESTAMP"/>
<result column="remark" property="remark" jdbcType="VARCHAR"/>
<result column="dept_name" property="deptName" jdbcType="VARCHAR"/>
<result column="level_num" property="levelNum" jdbcType="INTEGER"/>
<result column="change_desc" property="changeDesc" jdbcType="VARCHAR"/>
<result column="notice_nums" property="noticeNums" jdbcType="VARCHAR"/>
<result column="order_no" property="orderNo" jdbcType="VARCHAR"/>
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
row_id, batch_no, drawing_no, fac_code, material_no, order_number, material_name, material_desc, material_texture, material_unit, unit_weight, total_weight, current_version, num, last_version_is, status, sysn_sap_user_name, sysn_sap_time, source_row_id, devise_user_code, devise_name, created_by, created_time, expire_end_time, remark, dept_name, level_num, change_desc, notice_nums, order_no, modify_time </sql>
row_id, batch_no, drawing_no, fac_code, material_no, order_number, material_name, material_desc,
material_texture, material_unit, unit_weight, total_weight, current_version, num, last_version_is, status,
sysn_sap_user_name, sysn_sap_time, source_row_id, devise_user_code, devise_name, created_by, created_time,
expire_end_time, remark, dept_name, level_num, change_desc, notice_nums, order_no, modify_time
</sql>
<sql id="whr">
<if test="query.drawingNo!=null and query.drawingNo!=''">
and drawing_no=#{query.drawingNo}
</if>
<if test="query.materialNo!=null and query.materialNo!=''">
and material_no=#{query.materialNo}
</if>
<if test="query.facCode!=null and query.facCode!=''">
and fac_code=#{query.facCode}
</if>
<if test="query.status!=null and query.status==1">
<if test="query.startDate!=null and query.startDate!='' and query.endDate!=null and query.endDate!=''">
<![CDATA[ and created_time >= #{query.startDate} and created_time <=#{query.endDate}]]>
</if>
</if>
</sql>
<sql id="whrMore">
<include refid="whr"></include>
<if test="query.orderNo!=null and query.orderNo!=''">
and order_no=#{query.orderNo}
</if>
</sql>
<select id="getMBomListPage" resultType="com.nflg.product.bomnew.pojo.vo.BomNewMbomMiddleVO">
select * from t_bom_new_mbom_parent
where `status`=#{query.status}
<include refid="whrMore"/>
<if test="query.status!=null and query.status==3">
<if test="query.startDate!=null and query.startDate!='' and query.endDate!=null and query.endDate!=''">
<![CDATA[ and sysn_sap_time >= #{query.startDate} and sysn_sap_time <=#{query.endDate}]]>
</if>
</if>
</select>
<select id="getMBomSapListPage" resultType="com.nflg.product.bomnew.pojo.vo.BomNewMbomMiddleVO">
select * from t_bom_new_mbom_parent
where `status`=#{query.status}
<include refid="whrMore"/>
<if test="query.startDate!=null and query.startDate!='' and query.endDate!=null and query.endDate!=''">
<![CDATA[ and sysn_sap_time >= #{query.startDate} and sysn_sap_time <=#{query.endDate}]]>
</if>
</select>
<select id="indexListPage" resultType="com.nflg.product.bomnew.pojo.vo.BomNewMbomMiddleVO">
SELECT max(row_id) row_id ,bom_row_id from t_bom_new_mbom_detail GROUP BY bom_row_id
where `status`=#{status}
<include refid="whr"/>
</select>
<select id="searchList" resultType="com.nflg.product.bomnew.pojo.vo.BomNewMbomMiddleVO">
<![CDATA[
SELECT t2.*,(SELECT count(1) from t_bom_new_mbom_detail where parent_id=t2.row_id) as bomExist
FROM
(
SELECT
@r AS _row_id,
(SELECT @r := parent_row_id FROM t_bom_new_mbom_detail WHERE row_id = _row_id) AS parent_row_id
FROM
(SELECT @r := #{rowId}) vars, t_bom_new_mbom_detail AS h
WHERE @r <> 0
) t1
JOIN t_bom_new_mbom_detail t2
ON t1._row_id = t2.row_id
]]>
</select>
</mapper>