配件规格排序

This commit is contained in:
hayu 2025-07-16 22:48:48 +08:00
parent 8a283c3bfa
commit 73b8ebfd68
6 changed files with 99 additions and 33 deletions

View File

@ -226,11 +226,28 @@ order by tpa.create_time desc
where tpa.id=#{id}
</select>
<select id="getDetailsList" resultType="com.bonus.gzgqj.business.app.entity.PartApplyDetailAppVo">
select ppd.id,ppd.apply_id applyId, ppd.part_id partId, ppd.apply_num applyNum,
ppd.part_type partType, ppd.part_name partName, ppd.part_model partModel,ppd.part_unit partUnit,
pt.price ,(ppd.apply_num*pt.price ) money,pt.num
from t_part_apply_details ppd
LEFT JOIN pa_type pt on pt.id=ppd.part_id
where ppd.apply_id=#{id}
select ppd.id,
ppd.apply_id applyId,
ppd.part_id partId,
ppd.apply_num applyNum,
ppd.part_type partType,
ppd.part_name partName,
ppd.part_model partModel,
ppd.part_unit partUnit,
pt.price,
(ppd.apply_num * pt.price) money,
pt.num
from t_part_apply_details ppd
LEFT JOIN pa_type pt on pt.id = ppd.part_id
where ppd.apply_id = #{id}
ORDER BY CASE
WHEN ppd.part_model REGEXP '^[0-9]+$' THEN 1
ELSE 0
END,
CASE
WHEN ppd.part_model REGEXP '^[0-9]+$' THEN CAST(ppd.part_model AS UNSIGNED)
ELSE NULL
END,
ppd.part_model ASC
</select>
</mapper>

View File

@ -61,21 +61,31 @@
where tpa.id=#{id}
</select>
<select id="getDetailsList" resultType="com.bonus.gzgqj.business.app.entity.PartApplyDetailAppVo">
select ppd.id,ppd.apply_id applyId, ppd.part_id partId, ppd.apply_num applyNum,ppd.remark,
select ppd.id,ppd.apply_id applyId, ppd.part_id partId, ppd.apply_num applyNum,ppd.remark,
ppd.part_type partType, ppd.part_name partName, ppd.part_model partModel,ppd.part_unit partUnit,pt.price ,
(pt.price*ppd.apply_num ) money
from t_part_apply_details ppd
(pt.price*ppd.apply_num ) money
from t_part_apply_details ppd
LEFT JOIN pa_type pt on pt.id=ppd.part_id
where ppd.apply_id=#{id}
<if test="partType!=null and partType !=''">
and ppd.part_type like concat('%',#{partType},'%')
</if>
<if test="partName!=null and partName !=''">
and ppd.part_name like concat('%',#{partName},'%')
</if>
<if test="partModel!=null and partModel !=''">
and ppd.part_model like concat('%',#{partModel},'%')
</if>
<if test="partType!=null and partType !=''">
and ppd.part_type like concat('%',#{partType},'%')
</if>
<if test="partName!=null and partName !=''">
and ppd.part_name like concat('%',#{partName},'%')
</if>
<if test="partModel!=null and partModel !=''">
and ppd.part_model like concat('%',#{partModel},'%')
</if>
ORDER BY
CASE
WHEN ppd.part_model REGEXP '^[0-9]+$' THEN 1
ELSE 0
END,
CASE
WHEN ppd.part_model REGEXP '^[0-9]+$' THEN CAST(ppd.part_model AS UNSIGNED)
ELSE NULL
END,
ppd.part_model ASC
</select>
<!--审核状态-->
<select id="getAuditStatus" resultType="com.bonus.gzgqj.business.app.entity.PartApplyAppVo">

View File

@ -71,20 +71,30 @@
</select>
<select id="getInfoDetailList" resultType="com.bonus.gzgqj.business.bases.entity.PartBackDetailsVo">
SELECT id, back_id backId, back_num backNum,
part_id partId, part_type partType,
part_name partName, part_model partModel, part_unit partUnit, remark
SELECT id, back_id backId, back_num backNum,
part_id partId, part_type partType,
part_name partName, part_model partModel, part_unit partUnit, remark
FROM t_part_back_details
WHERE back_id=#{id}
<if test="partType!=null and partType !=''">
and part_type like concat('%',#{partType},'%')
</if>
<if test="partName!=null and partName !=''">
and part_name like concat('%',#{partName},'%')
</if>
<if test="partModel!=null and partModel !=''">
and part_model like concat('%',#{partModel},'%')
</if>
WHERE back_id=#{id}
<if test="partType!=null and partType !=''">
and part_type like concat('%',#{partType},'%')
</if>
<if test="partName!=null and partName !=''">
and part_name like concat('%',#{partName},'%')
</if>
<if test="partModel!=null and partModel !=''">
and part_model like concat('%',#{partModel},'%')
</if>
ORDER BY
CASE
WHEN part_model REGEXP '^[0-9]+$' THEN 1
ELSE 0
END,
CASE
WHEN part_model REGEXP '^[0-9]+$' THEN CAST(part_model AS UNSIGNED)
ELSE NULL
END,
part_model ASC
</select>
<select id="getInfoDetails" resultType="com.bonus.gzgqj.business.bases.entity.PartBackVo">
select tpb.id, tpb.code, tpb.creator,pu.TELPHONE phone ,tpb.back_num backNum,tpb.user_name userName,

View File

@ -70,7 +70,16 @@
<if test="partModel!=null and partModel !=''">
and pid.part_model like concat('%',#{partModel},'%')
</if>
ORDER BY
CASE
WHEN pid.part_model REGEXP '^[0-9]+$' THEN 1
ELSE 0
END,
CASE
WHEN pid.part_model REGEXP '^[0-9]+$' THEN CAST(pid.part_model AS UNSIGNED)
ELSE NULL
END,
pid.part_model ASC
</select>
<!--入库数量-->
<select id="getNum" resultType="java.lang.Integer">

View File

@ -69,6 +69,16 @@
<if test="partModel!=null and partModel !=''">
and psd.part_model like concat('%',#{partModel},'%')
</if>
ORDER BY
CASE
WHEN psd.part_model REGEXP '^[0-9]+$' THEN 1
ELSE 0
END,
CASE
WHEN psd.part_model REGEXP '^[0-9]+$' THEN CAST(psd.part_model AS UNSIGNED)
ELSE NULL
END,
psd.part_model ASC
</select>
<select id="getInfo" resultType="java.lang.String">
select ANY_VALUE(CONCAT(part_name,":",SUM(scrap_num))) detail

View File

@ -21,7 +21,7 @@
</select>
<select id="findByPage" resultType="com.bonus.gzgqj.business.bases.entity.PaTypeVo">
select pt.id, pt.parent_id parentId,pt.name model ,pt.num,
pt.price,pt.unit ,pt.weight,pt.is_consumables ,
IFNULL(pt.price,0) as price,pt.unit ,pt.weight,pt.is_consumables ,
pt.remarks,pt.is_active ,pt.level,pt.warn_num,pt1.`name` name ,pt2.name type
FROM pa_type pt
left join pa_type pt1 on pt.parent_id=pt1.id and pt1.`level`=2 and pt1.is_active=1
@ -42,6 +42,16 @@
<if test='isWarn=="2"'>
and pt.num>0
</if>
ORDER BY
CASE
WHEN pt.name REGEXP '^[0-9]+$' THEN 1
ELSE 0
END,
CASE
WHEN pt.name REGEXP '^[0-9]+$' THEN CAST(pt.name AS UNSIGNED)
ELSE NULL
END,
pt.name ASC
</select>
<!--工程统计领料单查询-->
<select id="getProListPage" resultType="com.bonus.gzgqj.business.bases.entity.ProjectInfoVo">