查询索引构建
This commit is contained in:
parent
31d760ffba
commit
b0d89937ba
|
|
@ -31,7 +31,7 @@ import java.util.Objects;
|
||||||
* @author makejava
|
* @author makejava
|
||||||
* @since 2024-01-01 10:53:24
|
* @since 2024-01-01 10:53:24
|
||||||
*/
|
*/
|
||||||
@Api(tags = "接口")
|
@Api(tags = "Mbom接口")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("mbom")
|
@RequestMapping("mbom")
|
||||||
public class MBomApi extends BaseApi {
|
public class MBomApi extends BaseApi {
|
||||||
|
|
@ -94,8 +94,8 @@ public class MBomApi extends BaseApi {
|
||||||
if(StrUtil.isEmpty(EnumUtils.getEnumDescription(MBomConstantEnum.MBomSuperMaterialStatusEnum.class,status))){
|
if(StrUtil.isEmpty(EnumUtils.getEnumDescription(MBomConstantEnum.MBomSuperMaterialStatusEnum.class,status))){
|
||||||
throw new NflgBusinessException(STATE.ParamErr,"status 不在范围内");
|
throw new NflgBusinessException(STATE.ParamErr,"status 不在范围内");
|
||||||
}
|
}
|
||||||
|
bomNewMbomDetailService.superSaterialStatusTag(rowId,status);
|
||||||
return ResultVO.success();
|
return ResultVO.success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,15 @@ package com.nflg.product.bomnew.mapper.master;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
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.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 表数据库访问层
|
* t_bom_new_mbom_parent 表数据库访问层
|
||||||
|
|
@ -12,4 +20,20 @@ import com.nflg.product.bomnew.pojo.entity.BomNewMbomParentEntity;
|
||||||
* @since 2024-01-01 10:53:24
|
* @since 2024-01-01 10:53:24
|
||||||
*/
|
*/
|
||||||
public interface BomNewMbomParentMapper extends BaseMapper<BomNewMbomParentEntity> {
|
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 );
|
||||||
|
|
||||||
|
List<BomNewMbomMiddleVO> searchList(@Param("rowId") Long rowId );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -61,8 +61,6 @@ public class BomNewMbomParentQuery extends BasePageQuery implements Serializabl
|
||||||
private String endDate;
|
private String endDate;
|
||||||
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "来源行ID(PBOM中parent的行ID)")
|
|
||||||
private Long sourceRowId;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,207 @@
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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、待发布(sap)、3=已发布
|
||||||
|
*/
|
||||||
|
@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;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -47,6 +47,9 @@
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<sql id="whr">
|
<sql id="whr">
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -57,35 +60,74 @@
|
||||||
and material_no=#{query.materialNo}
|
and material_no=#{query.materialNo}
|
||||||
</if>
|
</if>
|
||||||
<if test="query.facCode!=null and query.facCode!=''">
|
<if test="query.facCode!=null and query.facCode!=''">
|
||||||
and fac_code=#{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>
|
</if>
|
||||||
|
|
||||||
|
|
||||||
</sql>
|
</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.BomNewMbomParentVO">
|
|
||||||
|
<select id="getMBomListPage" resultType="com.nflg.product.bomnew.pojo.vo.BomNewMbomMiddleVO">
|
||||||
select * from t_bom_new_mbom_parent
|
select * from t_bom_new_mbom_parent
|
||||||
where `status`=#{query.status}
|
where `status`=#{query.status}
|
||||||
<include refid="whr"/>
|
<include refid="whrMore"/>
|
||||||
|
|
||||||
<if test="query.startDate!=null and query.startDate!=''">
|
<if test="query.status!=null and query.status==3">
|
||||||
<![CDATA[ and created_time >= #{query.startDate} and created_time <=#{query.endDate}]]>
|
<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>
|
</if>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="getMBomSapListPage" resultType="com.nflg.product.bomnew.pojo.vo.BomNewMbomParentVO">
|
<select id="getMBomSapListPage" resultType="com.nflg.product.bomnew.pojo.vo.BomNewMbomMiddleVO">
|
||||||
select * from t_bom_new_mbom_parent
|
select * from t_bom_new_mbom_parent
|
||||||
where `status`=#{query.status}
|
where `status`=#{query.status}
|
||||||
<include refid="whr"/>
|
<include refid="whrMore"/>
|
||||||
|
|
||||||
<if test="query.startDate!=null and query.startDate!=''">
|
<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}]]>
|
<![CDATA[ and sysn_sap_time >= #{query.startDate} and sysn_sap_time <=#{query.endDate}]]>
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</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.*
|
||||||
|
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>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue