jsk 类型规格权限改造 数量变动
This commit is contained in:
parent
a9983a15c6
commit
de622211a4
|
|
@ -1,7 +1,7 @@
|
|||
<?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">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.material.ma.mapper.TypeMapper">
|
||||
|
||||
<resultMap type="com.bonus.material.ma.domain.Type" id="TypeResult">
|
||||
|
|
@ -219,7 +219,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
and mt2.type_id is not null
|
||||
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>
|
||||
</select>
|
||||
|
||||
|
|
@ -261,7 +261,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="samplingRatio != null">sampling_ratio,</if>
|
||||
<if test="isEnter != null">is_enter,</if>
|
||||
<if test="jiJuType != null">jiJu_type,</if>
|
||||
<if test="companyId != null">company_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<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="isEnter != null">#{isEnter},</if>
|
||||
<if test="jiJuType != null">#{jiJuType},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
</trim>
|
||||
</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 wh_house_set whs on mt1.type_id=whs.type_id
|
||||
where mt3.del_flag = 0 and mt3.level = 3
|
||||
<if test="deptId != null">and mt3.company_id = #{deptId}</if>
|
||||
|
||||
UNION
|
||||
|
||||
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 wh_house_set whs on mt1.type_id=whs.type_id
|
||||
where mt2.del_flag = 0 and mt2.level = 2
|
||||
<if test="deptId != null">and mt2.company_id = #{deptId}</if>
|
||||
|
||||
UNION
|
||||
|
||||
select
|
||||
|
|
@ -400,21 +398,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from ma_type mt1
|
||||
left join wh_house_set whs on mt1.type_id=whs.type_id
|
||||
where mt1.del_flag = 0 and mt1.level = 1
|
||||
<if test="deptId != null">and mt1.company_id = #{deptId}</if>
|
||||
|
||||
order by type_id
|
||||
</select>
|
||||
|
||||
<!-- <select id="selectMaTypeTree2" resultMap="TypeResult">-->
|
||||
<!-- 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.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.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-->
|
||||
<!-- from ma_type mt-->
|
||||
<!-- left join wh_house_set whs on mt.type_id=whs.type_id-->
|
||||
<!-- where mt.del_flag = 0 and mt.level != #{level}-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="selectMaTypeTree2" resultMap="TypeResult">-->
|
||||
<!-- 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.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.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-->
|
||||
<!-- from ma_type mt-->
|
||||
<!-- left join wh_house_set whs on mt.type_id=whs.type_id-->
|
||||
<!-- where mt.del_flag = 0 and mt.level != #{level}-->
|
||||
<!-- </select>-->
|
||||
|
||||
<select id="selectTypeListAndParent" resultMap="MaTypeVoResult">
|
||||
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 mt2 ON mt2.type_id = mt.parent_id
|
||||
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
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
|
|
@ -564,9 +565,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
lease_apply_info lai
|
||||
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 ma_type mt on lad.type_id=mt.type_id
|
||||
WHERE
|
||||
tt.task_status = '3'
|
||||
AND tt.task_type = '2'
|
||||
<if test="companyId != null and companyId !=''">
|
||||
AND mt.company_id=#{companyId}
|
||||
</if>
|
||||
GROUP BY
|
||||
lad.type_id UNION ALL-- 第二个查询
|
||||
SELECT
|
||||
|
|
@ -580,11 +585,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
SUM( lod.out_num ) AS alNum
|
||||
FROM
|
||||
lease_out_details lod
|
||||
left join ma_type mt on lod.type_id=mt.type_id
|
||||
WHERE
|
||||
publish_task IS NOT NULL
|
||||
<if test="companyId != null and companyId !=''">
|
||||
AND mt.company_id=#{companyId}
|
||||
</if>
|
||||
GROUP BY
|
||||
lod.type_id
|
||||
) 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
|
||||
lpd.new_type
|
||||
) combined
|
||||
|
|
@ -593,15 +607,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
) subquery1 on subquery1.typeId=m.type_id
|
||||
<where>
|
||||
m.del_flag = '0'
|
||||
<if test="companyId != null and companyId !=''">
|
||||
AND m.company_id=#{companyId}
|
||||
</if>
|
||||
<if test="typeName != null and typeName !=''">
|
||||
AND m.type_name like concat('%',#{typeName},'%')
|
||||
</if>
|
||||
<if test="typeId != null and typeId !=''">
|
||||
AND m.type_id = #{typeId}
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
AND m.company_id = #{companyId}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
|
@ -982,7 +996,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="maId != null">ma_id,</if>
|
||||
create_time,
|
||||
<if test="createBy != null and createBy != ''">creater,</if>
|
||||
<if test="companyId != null">company_id,</if>
|
||||
<if test="style != null and style != ''">style,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
|
|
@ -998,7 +1011,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="maId != null">#{maId},</if>
|
||||
NOW(),
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
<if test="style != null and style != ''">#{style},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
|
@ -1019,7 +1031,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="status != null">status,</if>
|
||||
<if test="createBy != null and createBy != ''">creator,</if>
|
||||
<if test="resultMsg != null and resultMsg != ''">result_msg,</if>
|
||||
<if test="companyId != null">company_id,</if>
|
||||
<if test="inputType != null">input_type,</if>
|
||||
</trim>
|
||||
<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="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="resultMsg != null and resultMsg != ''">#{resultMsg},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
<if test="inputType != null">#{inputType},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
|
@ -1317,9 +1327,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
or m3.type_name like concat('%',#{type.keyword},'%')
|
||||
)
|
||||
</if>
|
||||
<if test="type.companyId != null">
|
||||
and m.company_id = #{type.companyId}
|
||||
</if>
|
||||
GROUP BY m.type_id
|
||||
ORDER BY
|
||||
m.sort_num ASC,
|
||||
|
|
|
|||
Loading…
Reference in New Issue