You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
143 lines
5.3 KiB
143 lines
5.3 KiB
<?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">
|
|
<mapper namespace="com.spring.modules.part.mapper.MasterPartInformationMapper">
|
|
|
|
<!-- master part 信息列表 -->
|
|
<select id="masterPartSearch" parameterType="com.spring.modules.part.vo.MasterPartInformationVo" resultType="com.spring.modules.part.vo.MasterPartInformationVo">
|
|
SELECT
|
|
part_no,
|
|
part_desc,
|
|
um_id,
|
|
dbo.get_um_name(um_id) as umName,
|
|
part_main_group,
|
|
dbo.get_group_name('*', part_main_group) as groupName,
|
|
weight_net,
|
|
uom_for_weight_net,
|
|
volume_net,
|
|
uom_for_volume_net,
|
|
code_no,
|
|
dbo.get_code_desc(#{query.site}, code_no, 'MP') as codeDesc,
|
|
condition_code_usage_db,
|
|
multilevel_tracking_db,
|
|
allow_as_not_consumed_db,
|
|
lot_tracking_code,
|
|
lot_quantity_rule,
|
|
sub_lot_rule,
|
|
component_lot_rule,
|
|
create_date,
|
|
create_by,
|
|
update_date,
|
|
update_by,
|
|
case when official_flag = 'Y' then 'Y' else 'N' end as officialFlag,
|
|
case when official_flag = 'Y' then '正式物料' else '临时物料' end as officialFlagDesc
|
|
FROM part_catalog
|
|
<where>
|
|
official_flag = 'Y'
|
|
<if test = "query.partNo != null and query.partNo != ''">
|
|
AND part_no like #{query.partNo}
|
|
</if>
|
|
<if test = "query.partDesc != null and query.partDesc != ''">
|
|
AND part_desc like #{query.partDesc}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
<!-- 物料信息编辑 -->
|
|
<update id="masterPartInformationEdit" parameterType="com.spring.modules.part.vo.MasterPartInformationVo">
|
|
UPDATE part_catalog
|
|
SET part_desc = #{partDesc},
|
|
part_main_group = #{partMainGroup},
|
|
weight_net = #{weightNet},
|
|
uom_for_weight_net = #{uomForWeightNet},
|
|
volume_net = #{volumeNet},
|
|
uom_for_volume_net = #{uomForVolumeNet},
|
|
condition_code_usage_db = #{conditionCodeUsageDb},
|
|
multilevel_tracking_db = #{multilevelTrackingDb},
|
|
allow_as_not_consumed_db = #{allowAsNotConsumedDb},
|
|
lot_tracking_code = #{lotTrackingCode},
|
|
lot_quantity_rule = #{lotQuantityRule},
|
|
sub_lot_rule = #{subLotRule},
|
|
component_lot_rule = #{componentLotRule},
|
|
code_no = #{codeNo},
|
|
um_id = #{umId},
|
|
update_date = getDate(),
|
|
update_by = #{updateBy}
|
|
WHERE part_no = #{partNo}
|
|
</update>
|
|
|
|
<select id="queryCodeNo" parameterType="com.spring.modules.part.vo.MasterPartInformationVo" resultType="PartSubPropertiesValueData">
|
|
SELECT
|
|
PartNo,
|
|
Site,
|
|
CodeNo,
|
|
SubCodeSeqNo,
|
|
SubCodeDesc,
|
|
RecordType
|
|
FROM PartSubPropertiesValueHeader
|
|
where PartNo = #{partNo} and Site = #{site} and SubCodeSeqNo = 1 and RecordType = 'MP'
|
|
</select>
|
|
<select id="masterPartSearchAny"
|
|
resultType="com.spring.modules.part.vo.MasterPartInformationVo">
|
|
SELECT
|
|
part_no,
|
|
part_desc,
|
|
um_id,
|
|
dbo.get_um_name(um_id) as umName,
|
|
part_main_group,
|
|
dbo.get_group_name('*', part_main_group) as groupName,
|
|
weight_net,
|
|
uom_for_weight_net,
|
|
volume_net,
|
|
uom_for_volume_net,
|
|
code_no,
|
|
dbo.get_code_desc(#{query.site}, code_no, 'MP') as codeDesc,
|
|
condition_code_usage_db,
|
|
multilevel_tracking_db,
|
|
allow_as_not_consumed_db,
|
|
lot_tracking_code,
|
|
lot_quantity_rule,
|
|
sub_lot_rule,
|
|
component_lot_rule,
|
|
create_date,
|
|
create_by,
|
|
update_date,
|
|
update_by,
|
|
case when official_flag = 'Y' then 'Y' else 'N' end as officialFlag,
|
|
case when official_flag = 'Y' then '正式物料' else '临时物料' end as officialFlagDesc
|
|
FROM part_catalog
|
|
<if test="query.whereClause != null and query.whereClause != ''">
|
|
WHERE ${query.whereClause}
|
|
</if>
|
|
<if test="query.orderClause != null and query.orderClause != ''">
|
|
ORDER BY ${query.orderClause}
|
|
</if>
|
|
<if test="query.orderClause == null or query.orderClause == ''">
|
|
order by part_no
|
|
</if>
|
|
</select>
|
|
|
|
<!-- 物料信息编辑 -->
|
|
<update id="updateWeightAndVolume" parameterType="com.spring.modules.part.vo.MasterPartInformationVo">
|
|
UPDATE part
|
|
SET weight_net = #{weightNet},
|
|
uom_for_weight_net = #{uomForWeightNet},
|
|
volume_net = #{volumeNet},
|
|
uom_for_volume_net = #{uomForVolumeNet}
|
|
WHERE part_no = #{partNo}
|
|
</update>
|
|
|
|
<!-- 物料信息编辑 -->
|
|
<update id="updatePartOfficialFlag" parameterType="MasterPartInformationEntity">
|
|
UPDATE part_catalog
|
|
SET official_flag = #{officialFlag},
|
|
update_date = getDate(),
|
|
update_by = #{updateBy}
|
|
WHERE part_no = #{plmPartNo}
|
|
</update>
|
|
|
|
<update id="updateCodeNoByPartNo">
|
|
UPDATE part_catalog
|
|
SET code_no = #{codeNo}
|
|
WHERE part_no = #{partNo}
|
|
</update>
|
|
</mapper>
|