2025-07-03 11:43:44 +08:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace= "com.nflg.wms.repository.mapper.WmsStructuralPackageMapper" >
<select id= "search" resultType= "com.nflg.wms.common.pojo.vo.PackageVO" >
2025-09-23 15:50:24 +08:00
SELECT *
FROM (
SELECT DISTINCT ON ("no") id,"no","order_no","name",drawing_no,weight,cate,eco,version,remark,enable,create_by
,create_time,update_by,update_time,get_modelnos(model_ids) as "modelNos"
FROM wms_structural_package
<where >
<if test= "request.no!=null and request.no!=''" >
and ("no" ilike concat('%', #{request.no}, '%') or "name" ilike concat('%', #{request.no}, '%'))
</if>
<if test= "request.eco!=null and request.eco!=''" >
and eco ilike concat('%', #{request.eco}, '%')
</if>
<if test= "request.drawingNo!=null and request.drawingNo!=''" >
and drawing_no like concat('%', #{request.drawingNo}, '%')
</if>
<if test= "request.modelId!=null" >
and find_in_set(#{request.modelId},model_ids)>0
</if>
<if test= "request.type==0" >
and latest=true
</if>
</where>
ORDER BY "no",id DESC
) t
2025-09-24 16:56:47 +08:00
ORDER BY id DESC
2025-07-03 11:43:44 +08:00
</select>
<select id= "getHistory" resultType= "com.nflg.wms.common.pojo.vo.PackageVO" >
2025-07-22 18:43:17 +08:00
select id,"no","order_no","name",drawing_no,weight,cate,eco,version,remark,enable,create_by,create_time,update_by,update_time,get_modelnos(model_ids) as "modelNos"
2025-07-03 11:43:44 +08:00
from wms_structural_package
where no=#{no}
order by id desc
</select>
<select id= "getInfo" resultType= "com.nflg.wms.common.pojo.vo.PackageVO" >
2025-07-22 18:43:17 +08:00
select *
2025-07-03 11:43:44 +08:00
from wms_structural_package
where id=#{id}
</select>
2025-07-19 20:23:37 +08:00
<select id= "getCurrentOrderNo" resultType= "java.lang.String" >
SELECT MAX(order_no)
FROM wms_structural_package
</select>
<select id= "getOrderNo" resultType= "java.lang.String" >
SELECT DISTINCT order_no
FROM wms_structural_package
WHERE "no"=#{no}
</select>
<select id= "getCurrent" resultType= "com.nflg.wms.common.pojo.vo.PackageVO" >
SELECT *
FROM wms_structural_package
WHERE "no"=#{materialNo}
ORDER BY id DESC
LIMIT 1
</select>
2025-07-03 11:43:44 +08:00
</mapper>