jsk 类型规格权限改造 数量变动

This commit is contained in:
jiask 2026-01-09 10:49:06 +08:00
parent a9983a15c6
commit de622211a4
1 changed files with 197 additions and 190 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.material.ma.mapper.TypeMapper"> <mapper namespace="com.bonus.material.ma.mapper.TypeMapper">
<resultMap type="com.bonus.material.ma.domain.Type" id="TypeResult"> <resultMap type="com.bonus.material.ma.domain.Type" id="TypeResult">
@ -219,7 +219,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
and mt2.type_id is not null and mt2.type_id is not null
and mhs.house_id = #{houseId} and mhs.del_flag = 0 and mhs.house_id = #{houseId} and mhs.del_flag = 0
<if test="companyId != null">and mt2.company_id = #{companyId} and mhs.company_id = #{companyId}</if>
</where> </where>
</select> </select>
@ -261,7 +261,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="samplingRatio != null">sampling_ratio,</if> <if test="samplingRatio != null">sampling_ratio,</if>
<if test="isEnter != null">is_enter,</if> <if test="isEnter != null">is_enter,</if>
<if test="jiJuType != null">jiJu_type,</if> <if test="jiJuType != null">jiJu_type,</if>
<if test="companyId != null">company_id,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="typeName != null and typeName != ''">#{typeName},</if> <if test="typeName != null and typeName != ''">#{typeName},</if>
@ -299,7 +298,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="samplingRatio != null">#{samplingRatio},</if> <if test="samplingRatio != null">#{samplingRatio},</if>
<if test="isEnter != null">#{isEnter},</if> <if test="isEnter != null">#{isEnter},</if>
<if test="jiJuType != null">#{jiJuType},</if> <if test="jiJuType != null">#{jiJuType},</if>
<if test="companyId != null">#{companyId},</if>
</trim> </trim>
</insert> </insert>
@ -381,7 +379,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join ma_type mt1 on mt1.type_id=mt2.parent_id 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_set whs on mt1.type_id=whs.type_id
where mt3.del_flag = 0 and mt3.level = 3 where mt3.del_flag = 0 and mt3.level = 3
<if test="deptId != null">and mt3.company_id = #{deptId}</if>
UNION UNION
select select
@ -391,7 +389,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join ma_type mt1 on mt1.type_id=mt2.parent_id 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_set whs on mt1.type_id=whs.type_id
where mt2.del_flag = 0 and mt2.level = 2 where mt2.del_flag = 0 and mt2.level = 2
<if test="deptId != null">and mt2.company_id = #{deptId}</if>
UNION UNION
select select
@ -400,21 +398,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from ma_type mt1 from ma_type mt1
left join wh_house_set whs on mt1.type_id=whs.type_id left join wh_house_set whs on mt1.type_id=whs.type_id
where mt1.del_flag = 0 and mt1.level = 1 where mt1.del_flag = 0 and mt1.level = 1
<if test="deptId != null">and mt1.company_id = #{deptId}</if>
order by type_id order by type_id
</select> </select>
<!-- <select id="selectMaTypeTree2" resultMap="TypeResult">--> <!-- <select id="selectMaTypeTree2" resultMap="TypeResult">-->
<!-- select--> <!-- select-->
<!-- mt.type_id, mt.type_name, mt.parent_id, mt.storage_num, mt.type_code, mt.model_code, mt.unit_id, mt.unit_name,--> <!-- mt.type_id, mt.type_name, mt.parent_id, mt.storage_num, mt.type_code, mt.model_code, mt.unit_id, mt.unit_name,-->
<!-- mt.manage_type, mt.lease_price, mt.eff_time, mt.rent_price, mt.buy_price, mt.pay_ratio, mt.pay_price,--> <!-- mt.manage_type, mt.lease_price, mt.eff_time, mt.rent_price, mt.buy_price, mt.pay_ratio, mt.pay_price,-->
<!-- mt.tax_ratio, mt.level, mt.rated_load, mt.test_load, mt.holding_time, mt.warn_num,--> <!-- mt.tax_ratio, mt.level, mt.rated_load, mt.test_load, mt.holding_time, mt.warn_num,-->
<!-- mt.create_by, mt.create_time, mt.update_by, mt.update_time, mt.is_plan,mt.is_ancuo,--> <!-- mt.create_by, mt.create_time, mt.update_by, mt.update_time, mt.is_plan,mt.is_ancuo,-->
<!-- mt.remark, mt.fac_model, mt.intelligent_code, whs.house_id--> <!-- mt.remark, mt.fac_model, mt.intelligent_code, whs.house_id-->
<!-- from ma_type mt--> <!-- from ma_type mt-->
<!-- left join wh_house_set whs on mt.type_id=whs.type_id--> <!-- left join wh_house_set whs on mt.type_id=whs.type_id-->
<!-- where mt.del_flag = 0 and mt.level != #{level}--> <!-- where mt.del_flag = 0 and mt.level != #{level}-->
<!-- </select>--> <!-- </select>-->
<select id="selectTypeListAndParent" resultMap="MaTypeVoResult"> <select id="selectTypeListAndParent" resultMap="MaTypeVoResult">
SELECT SELECT
@ -550,6 +548,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN ma_type mt ON mt.type_id = mm.type_id LEFT JOIN ma_type mt ON mt.type_id = mm.type_id
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
WHERE mm.ma_code is not null and mm.ma_status in (1) WHERE mm.ma_code is not null and mm.ma_status in (1)
<if test="companyId != null and companyId !=''">
AND mt.company_id=#{companyId}
</if>
GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = m.type_id GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = m.type_id
LEFT JOIN ( LEFT JOIN (
SELECT SELECT
@ -564,9 +565,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
lease_apply_info lai lease_apply_info lai
LEFT JOIN lease_apply_details lad ON lad.parent_id = lai.id LEFT JOIN lease_apply_details lad ON lad.parent_id = lai.id
LEFT JOIN tm_task tt ON lai.task_id = tt.task_id LEFT JOIN tm_task tt ON lai.task_id = tt.task_id
left join ma_type mt on lad.type_id=mt.type_id
WHERE WHERE
tt.task_status = '3' tt.task_status = '3'
AND tt.task_type = '2' AND tt.task_type = '2'
<if test="companyId != null and companyId !=''">
AND mt.company_id=#{companyId}
</if>
GROUP BY GROUP BY
lad.type_id UNION ALL-- 第二个查询 lad.type_id UNION ALL-- 第二个查询
SELECT SELECT
@ -580,11 +585,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SUM( lod.out_num ) AS alNum SUM( lod.out_num ) AS alNum
FROM FROM
lease_out_details lod lease_out_details lod
left join ma_type mt on lod.type_id=mt.type_id
WHERE WHERE
publish_task IS NOT NULL publish_task IS NOT NULL
<if test="companyId != null and companyId !=''">
AND mt.company_id=#{companyId}
</if>
GROUP BY GROUP BY
lod.type_id lod.type_id
) lod ON lpd.new_type = lod.typeId ) lod ON lpd.new_type = lod.typeId
left join ma_type mt on lpd.new_type=mt.type_id
where 1=1
<if test="companyId != null and companyId !=''">
AND mt.company_id=#{companyId}
</if>
GROUP BY GROUP BY
lpd.new_type lpd.new_type
) combined ) combined
@ -593,15 +607,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
) subquery1 on subquery1.typeId=m.type_id ) subquery1 on subquery1.typeId=m.type_id
<where> <where>
m.del_flag = '0' m.del_flag = '0'
<if test="companyId != null and companyId !=''">
AND m.company_id=#{companyId}
</if>
<if test="typeName != null and typeName !=''"> <if test="typeName != null and typeName !=''">
AND m.type_name like concat('%',#{typeName},'%') AND m.type_name like concat('%',#{typeName},'%')
</if> </if>
<if test="typeId != null and typeId !=''"> <if test="typeId != null and typeId !=''">
AND m.type_id = #{typeId} AND m.type_id = #{typeId}
</if> </if>
<if test="companyId != null">
AND m.company_id = #{companyId}
</if>
</where> </where>
</select> </select>
@ -982,7 +996,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="maId != null">ma_id,</if> <if test="maId != null">ma_id,</if>
create_time, create_time,
<if test="createBy != null and createBy != ''">creater,</if> <if test="createBy != null and createBy != ''">creater,</if>
<if test="companyId != null">company_id,</if>
<if test="style != null and style != ''">style,</if> <if test="style != null and style != ''">style,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
@ -998,7 +1011,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="maId != null">#{maId},</if> <if test="maId != null">#{maId},</if>
NOW(), NOW(),
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="companyId != null">#{companyId},</if>
<if test="style != null and style != ''">#{style},</if> <if test="style != null and style != ''">#{style},</if>
</trim> </trim>
</insert> </insert>
@ -1019,7 +1031,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">status,</if> <if test="status != null">status,</if>
<if test="createBy != null and createBy != ''">creator,</if> <if test="createBy != null and createBy != ''">creator,</if>
<if test="resultMsg != null and resultMsg != ''">result_msg,</if> <if test="resultMsg != null and resultMsg != ''">result_msg,</if>
<if test="companyId != null">company_id,</if>
<if test="inputType != null">input_type,</if> <if test="inputType != null">input_type,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
@ -1036,7 +1047,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">#{status},</if> <if test="status != null">#{status},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="resultMsg != null and resultMsg != ''">#{resultMsg},</if> <if test="resultMsg != null and resultMsg != ''">#{resultMsg},</if>
<if test="companyId != null">#{companyId},</if>
<if test="inputType != null">#{inputType},</if> <if test="inputType != null">#{inputType},</if>
</trim> </trim>
</insert> </insert>
@ -1317,9 +1327,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
or m3.type_name like concat('%',#{type.keyword},'%') or m3.type_name like concat('%',#{type.keyword},'%')
) )
</if> </if>
<if test="type.companyId != null">
and m.company_id = #{type.companyId}
</if>
GROUP BY m.type_id GROUP BY m.type_id
ORDER BY ORDER BY
m.sort_num ASC, m.sort_num ASC,