导出matype

This commit is contained in:
sxu 2024-11-06 16:28:43 +08:00
parent 8e8b6e5842
commit 39a5e5e9c7
1 changed files with 49 additions and 25 deletions

View File

@ -102,31 +102,55 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql> </sql>
<select id="selectTypeList" parameterType="com.bonus.material.ma.domain.Type" resultMap="TypeResult"> <select id="selectTypeList" parameterType="com.bonus.material.ma.domain.Type" resultMap="TypeResult">
<include refid="selectTypeVo"/> select
<where> mt4.type_id, mt4.type_name, mt4.parent_id, mt4.storage_num, mt4.type_code, mt4.model_code, mt4.unit_id, mt4.unit_name, mt4.manage_type, mt4.lease_price,
<if test="typeName != null and typeName != ''"> and type_name like concat('%', #{typeName}, '%')</if> mt4.eff_time, mt4.rent_price, mt4.buy_price, mt4.pay_ratio, mt4.pay_price, mt4.tax_ratio, mt4.level, mt4.rated_load, mt4.test_load, mt4.holding_time, mt4.warn_num,
<if test="parentId != null and parentId != '0' "> and parent_id = #{parentId}</if> mt4.create_by, mt4.create_time, mt4.update_by, mt4.update_time, mt4.is_plan,mt4.is_ancuo, mt4.remark, mt4.fac_model, mt4.intelligent_code, whs.house_id, whi.house_name
<if test="storageNum != null "> and storage_num = #{storageNum}</if> from ma_type mt4
<if test="typeCode != null and typeCode != ''"> and type_code = #{typeCode}</if> left join ma_type mt3 on mt3.type_id=mt4.parent_id
<if test="modelCode != null and modelCode != ''"> and model_code = #{modelCode}</if> left join ma_type mt2 on mt2.type_id=mt3.parent_id
<if test="unitId != null "> and unit_id = #{unitId}</if> left join ma_type mt1 on mt1.type_id=mt2.parent_id
<if test="manageType != null and manageType != ''"> and manage_type = #{manageType}</if> left join wh_house_set whs on mt1.type_id=whs.type_id
<if test="leasePrice != null "> and lease_price = #{leasePrice}</if> left join wh_house_info whi on whs.house_id=whi.house_id
<if test="effTime != null "> and eff_time = #{effTime}</if> where mt4.del_flag = 0 and mt4.level = 4
<if test="rentPrice != null "> and rent_price = #{rentPrice}</if>
<if test="buyPrice != null "> and buy_price = #{buyPrice}</if> UNION
<if test="payRatio != null "> and pay_ratio = #{payRatio}</if>
<if test="level != null and level != ''"> and `level` = #{level}</if> select
<if test="ratedLoad != null and ratedLoad != ''"> and rated_load = #{ratedLoad}</if> mt3.type_id, mt3.type_name, mt3.parent_id, mt3.storage_num, mt3.type_code, mt3.model_code, mt3.unit_id, mt3.unit_name, mt3.manage_type, mt3.lease_price,
<if test="testLoad != null and testLoad != ''"> and test_load = #{testLoad}</if> mt3.eff_time, mt3.rent_price, mt3.buy_price, mt3.pay_ratio, mt3.pay_price, mt3.tax_ratio, mt3.level, mt3.rated_load, mt3.test_load, mt3.holding_time, mt3.warn_num,
<if test="holdingTime != null "> and holding_time = #{holdingTime}</if> mt3.create_by, mt3.create_time, mt3.update_by, mt3.update_time, mt3.is_plan,mt3.is_ancuo, mt3.remark, mt3.fac_model, mt3.intelligent_code, whs.house_id, whi.house_name
<if test="warnNum != null "> and warn_num = #{warnNum}</if> from ma_type mt3
<if test="isPlan != null and isPlan != ''"> and is_plan = #{isPlan}</if> left join ma_type mt2 on mt2.type_id=mt3.parent_id
<if test="isAncuo != null and isAncuo != ''"> and is_ancuo = #{isAncuo}</if> left join ma_type mt1 on mt1.type_id=mt2.parent_id
<if test="facModel != null and facModel != ''"> and fac_model = #{facModel}</if> left join wh_house_set whs on mt1.type_id=whs.type_id
<if test="intelligentCode != null and intelligentCode != ''"> and intelligent_code = #{intelligentCode}</if> left join wh_house_info whi on whs.house_id=whi.house_id
and del_flag = #{delFlag} where mt3.del_flag = 0 and mt3.level = 3
</where>
UNION
select
mt2.type_id, mt2.type_name, mt2.parent_id, mt2.storage_num, mt2.type_code, mt2.model_code, mt2.unit_id, mt2.unit_name, mt2.manage_type, mt2.lease_price,
mt2.eff_time, mt2.rent_price, mt2.buy_price, mt2.pay_ratio, mt2.pay_price, mt2.tax_ratio, mt2.level, mt2.rated_load, mt2.test_load, mt2.holding_time, mt2.warn_num,
mt2.create_by, mt2.create_time, mt2.update_by, mt2.update_time, mt2.is_plan,mt2.is_ancuo, mt2.remark, mt2.fac_model, mt2.intelligent_code, whs.house_id, whi.house_name
from ma_type mt2
left join ma_type mt1 on mt1.type_id=mt2.parent_id
left join wh_house_set whs on mt1.type_id=whs.type_id
left join wh_house_info whi on whs.house_id=whi.house_id
where mt2.del_flag = 0 and mt2.level = 2
UNION
select
mt1.type_id, mt1.type_name, mt1.parent_id, mt1.storage_num, mt1.type_code, mt1.model_code, mt1.unit_id, mt1.unit_name, mt1.manage_type, mt1.lease_price,
mt1.eff_time, mt1.rent_price, mt1.buy_price, mt1.pay_ratio, mt1.pay_price, mt1.tax_ratio, mt1.level, mt1.rated_load, mt1.test_load, mt1.holding_time, mt1.warn_num,
mt1.create_by, mt1.create_time, mt1.update_by, mt1.update_time, mt1.is_plan,mt1.is_ancuo, mt1.remark, mt1.fac_model, mt1.intelligent_code, whs.house_id, whi.house_name
from ma_type mt1
left join wh_house_set whs on mt1.type_id=whs.type_id
left join wh_house_info whi on whs.house_id=whi.house_id
where mt1.del_flag = 0 and mt1.level = 1
order by type_id
</select> </select>
<select id="selectTypeByTypeId" parameterType="Long" resultMap="TypeResult"> <select id="selectTypeByTypeId" parameterType="Long" resultMap="TypeResult">