物资类型历史记录查询

This commit is contained in:
syruan 2025-02-13 18:14:52 +08:00
parent 40c7f30b02
commit 8961e76bee
2 changed files with 22 additions and 7 deletions

View File

@ -23,6 +23,12 @@ public class MaTypeHistory {
private String typeName;
private String maType;
private String maName;
private String maModel;
private BigDecimal beforePrice;
private BigDecimal afterPrice;
@ -30,4 +36,6 @@ public class MaTypeHistory {
private LocalDateTime createTime;
private String createBy;
private String keyword;
}

View File

@ -829,18 +829,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getMaTypeHistoryListBy" resultType="com.bonus.material.ma.domain.MaTypeHistory">
select
id, type_id, before_price, after_price, create_time, create_by
mth.id, mth.type_id, mth.before_price, mth.after_price, mth.create_time, mth.create_by,
mt4.type_name as maModel, mt3.type_name as maName, mt2.type_name as maType
from
ma_type_history
ma_type_history mth
left join ma_type mt4 on mt4.type_id = mth.type_id and mt4.level = 4 and mt4.del_flag = 0
left join ma_type mt3 on mt3.type_id = mt4.parent_id and mt3.level = 3 and mt3.del_flag = 0
left join ma_type mt2 on mt2.type_id = mt3.parent_id and mt2.level = 2 and mt2.del_flag = 0
<where>
<if test="typeId != null">
and type_id = #{typeId}
and mth.type_id = #{typeId}
</if>
<if test="createBy != null">
and create_by = #{createBy}
<if test="maModel != null and maModel != ''">
and mt4.type_name like concat('%',#{keyword},'%')
</if>
<if test="createTime != null and createTime != ''">
and create_time between #{startTime} and #{endTime}
<if test="maName != null and maName != ''">
and mt3.type_name like concat('%',#{keyword},'%')
</if>
<if test="maType != null and maType != ''">
and mt2.type_name like concat('%',#{keyword},'%')
</if>
</where>
</select>