|
|
|
@ -4,22 +4,22 @@ |
|
|
|
<!-- 查询点检项目 --> |
|
|
|
<select id="plmPropertiesItemSearch" parameterType="PlmPropertiesItemData" resultType="PlmPropertiesItemData"> |
|
|
|
SELECT ppi.site, |
|
|
|
ItemNo, |
|
|
|
ItemDesc, |
|
|
|
DefaultValue, |
|
|
|
ValueType, |
|
|
|
ValueType_DB as valueTypeDb, |
|
|
|
ValueChooseFlag, |
|
|
|
CreatedDate, |
|
|
|
CreatedBy, |
|
|
|
ppi.update_date, |
|
|
|
ppi.update_by, |
|
|
|
MaxValue, |
|
|
|
MinValue, |
|
|
|
ItemType, |
|
|
|
pt.function_type_desc |
|
|
|
ItemNo, |
|
|
|
ItemDesc, |
|
|
|
DefaultValue, |
|
|
|
ValueType, |
|
|
|
ValueType_DB as valueTypeDb, |
|
|
|
ValueChooseFlag, |
|
|
|
CreatedDate, |
|
|
|
CreatedBy, |
|
|
|
ppi.update_date, |
|
|
|
ppi.update_by, |
|
|
|
MaxValue, |
|
|
|
MinValue, |
|
|
|
ItemType, |
|
|
|
pt.function_type_desc |
|
|
|
FROM plm_properties_item ppi |
|
|
|
left join properties_type pt on pt.function_type = ppi.itemType |
|
|
|
left join properties_type pt on pt.function_type = ppi.itemType |
|
|
|
<where> |
|
|
|
ppi.site = #{query.site} |
|
|
|
<if test="query.itemType != null and query.itemType != ''"> |
|
|
|
@ -31,7 +31,7 @@ |
|
|
|
<if test="query.itemDesc != null and query.itemDesc != ''"> |
|
|
|
AND ppi.ItemDesc LIKE '%' + #{query.itemDesc} + '%' |
|
|
|
</if> |
|
|
|
<if test="query.valueType != null and query.valueType != ''"> |
|
|
|
<if test="query.valueType != null and query.valueType != ''"> |
|
|
|
AND ppi.valueType LIKE '%' + #{query.valueType} + '%' |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
@ -130,29 +130,29 @@ |
|
|
|
<select id="plmPropertiesModelSearch" parameterType="PlmPropertiesModelHeaderData" |
|
|
|
resultType="PlmPropertiesModelHeaderData"> |
|
|
|
SELECT pmh.site, |
|
|
|
pmh.function_type, |
|
|
|
pmh.code_no, |
|
|
|
pmh.code_desc, |
|
|
|
pmh.active, |
|
|
|
pmh.created_date, |
|
|
|
pmh.created_by, |
|
|
|
pmh.update_date, |
|
|
|
pmh.update_by, |
|
|
|
pmh.delflag, |
|
|
|
pmh.version, |
|
|
|
pmh.is_system, |
|
|
|
pr.function_group_desc, |
|
|
|
pg.menu_id as [group], |
|
|
|
pmh.function_group, |
|
|
|
pt.function_type_desc |
|
|
|
pmh.function_type, |
|
|
|
pmh.code_no, |
|
|
|
pmh.code_desc, |
|
|
|
pmh.active, |
|
|
|
pmh.created_date, |
|
|
|
pmh.created_by, |
|
|
|
pmh.update_date, |
|
|
|
pmh.update_by, |
|
|
|
pmh.delflag, |
|
|
|
pmh.version, |
|
|
|
pmh.is_system, |
|
|
|
pr.function_group_desc, |
|
|
|
pg.menu_id as [group], |
|
|
|
pmh.function_group, |
|
|
|
pt.function_type_desc |
|
|
|
FROM plm_properties_model_header pmh |
|
|
|
left join properties_group pg |
|
|
|
on pg.site = pmh.site and pg.function_type = pmh.function_type and pg.code_no = pmh.code_no |
|
|
|
left join properties_bu bu |
|
|
|
on bu.site = pmh.site and bu.function_type = pmh.function_type and bu.code_no = pmh.code_no |
|
|
|
left join properties_type pt on pt.function_type = pmh.function_type |
|
|
|
left join properties_relationship pr |
|
|
|
on pr.function_group = pmh.function_group and pr.function_type = pmh.function_type |
|
|
|
left join properties_group pg |
|
|
|
on pg.site = pmh.site and pg.function_type = pmh.function_type and pg.code_no = pmh.code_no |
|
|
|
left join properties_bu bu |
|
|
|
on bu.site = pmh.site and bu.function_type = pmh.function_type and bu.code_no = pmh.code_no |
|
|
|
left join properties_type pt on pt.function_type = pmh.function_type |
|
|
|
left join properties_relationship pr |
|
|
|
on pr.function_group = pmh.function_group and pr.function_type = pmh.function_type |
|
|
|
<where> |
|
|
|
pmh.site = #{query.site} |
|
|
|
<if test="query.codeNo != null and query.codeNo != ''"> |
|
|
|
@ -298,15 +298,15 @@ |
|
|
|
|
|
|
|
<select id="getItemLists" resultType="PlmPropertiesItemData"> |
|
|
|
SELECT a.itemNo, |
|
|
|
a.ItemDesc |
|
|
|
a.ItemDesc |
|
|
|
FROM plm_properties_item a |
|
|
|
LEFT JOIN plm_properties_model_detail b |
|
|
|
on b.function_type = #{functionType} and b.code_no = #{codeNo} and |
|
|
|
b.properties_item_no = a.ItemNo and a.site = b.site |
|
|
|
LEFT JOIN plm_properties_model_detail b |
|
|
|
on b.function_type = #{functionType} and b.code_no = #{codeNo} and |
|
|
|
b.properties_item_no = a.ItemNo and a.site = b.site |
|
|
|
<where> |
|
|
|
a.ItemType = #{functionType} |
|
|
|
and a.site = #{site} |
|
|
|
AND b.code_no is null |
|
|
|
and a.site = #{site} |
|
|
|
AND b.code_no is null |
|
|
|
<if test="itemNo != null and itemNo != ''"> |
|
|
|
AND a.ItemNo LIKE '%' + #{itemNo} + '%' |
|
|
|
</if> |
|
|
|
@ -342,18 +342,18 @@ |
|
|
|
|
|
|
|
<select id="searchPropertiesUnChoose" resultType="PlmPropertiesItemData"> |
|
|
|
SELECT b.site, |
|
|
|
b.ItemType as functionType, |
|
|
|
b.ItemNo, |
|
|
|
b.ItemDesc, |
|
|
|
b.DefaultValue, |
|
|
|
b.ValueType, |
|
|
|
b.ValueType_DB, |
|
|
|
b.ValueChooseFlag, |
|
|
|
b.MaxValue, |
|
|
|
b.MinValue |
|
|
|
b.ItemType as functionType, |
|
|
|
b.ItemNo, |
|
|
|
b.ItemDesc, |
|
|
|
b.DefaultValue, |
|
|
|
b.ValueType, |
|
|
|
b.ValueType_DB, |
|
|
|
b.ValueChooseFlag, |
|
|
|
b.MaxValue, |
|
|
|
b.MinValue |
|
|
|
FROM plm_properties_item b |
|
|
|
where b.ItemType = #{codeType} |
|
|
|
and b.site = #{site} |
|
|
|
and b.site = #{site} |
|
|
|
<if test="list != null and list.size() != 0"> |
|
|
|
and b.ItemNo not in ( |
|
|
|
<foreach collection="list" item="item" separator=","> |
|
|
|
@ -363,6 +363,30 @@ |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
<!--查询属性选择内容 --> |
|
|
|
<select id="searchPropertiesChoose" resultType="PlmPropertiesItemData"> |
|
|
|
SELECT b.site, |
|
|
|
b.ItemType as functionType, |
|
|
|
b.ItemNo, |
|
|
|
b.ItemDesc, |
|
|
|
b.DefaultValue, |
|
|
|
b.ValueType, |
|
|
|
b.ValueType_DB, |
|
|
|
b.ValueChooseFlag, |
|
|
|
b.MaxValue, |
|
|
|
b.MinValue |
|
|
|
FROM plm_properties_item b |
|
|
|
where b.ItemType = #{codeType} |
|
|
|
and b.site = #{site} |
|
|
|
<if test="list != null and list.size() != 0"> |
|
|
|
and b.ItemNo in ( |
|
|
|
<foreach collection="list" item="item" separator=","> |
|
|
|
#{item} |
|
|
|
</foreach> |
|
|
|
) |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="checkValueHeaderData" resultType="PartSubPropertiesValueHeaderData"> |
|
|
|
SELECT PartNo, Site, CodeNo, SubCodeSeqNo, SubCodeDesc, RecordType |
|
|
|
from PartSubPropertiesValueHeader |
|
|
|
@ -424,26 +448,26 @@ |
|
|
|
|
|
|
|
<select id="getItemModal" resultType="PartSubPropertiesValueData"> |
|
|
|
SELECT a.PartNo |
|
|
|
, a.Site |
|
|
|
, a.CodeNo |
|
|
|
, a.SubCodeSeqNo |
|
|
|
, a.SubCodeDesc |
|
|
|
, a.ItemNo |
|
|
|
, a.PropertiesItemNo |
|
|
|
, a.TextValue |
|
|
|
, a.NumValue |
|
|
|
, a.RecordType |
|
|
|
, b.ItemDesc ItemDesc |
|
|
|
, b.ValueType |
|
|
|
, b.ValueType_DB |
|
|
|
, b.ValueChooseFlag |
|
|
|
, a.Site |
|
|
|
, a.CodeNo |
|
|
|
, a.SubCodeSeqNo |
|
|
|
, a.SubCodeDesc |
|
|
|
, a.ItemNo |
|
|
|
, a.PropertiesItemNo |
|
|
|
, a.TextValue |
|
|
|
, a.NumValue |
|
|
|
, a.RecordType |
|
|
|
, b.ItemDesc ItemDesc |
|
|
|
, b.ValueType |
|
|
|
, b.ValueType_DB |
|
|
|
, b.ValueChooseFlag |
|
|
|
FROM PartSubPropertiesValue a |
|
|
|
left join plm_properties_item b |
|
|
|
on a.PropertiesItemNo = b.ItemNo and a.site = b.site and a.RecordType = b.ItemType |
|
|
|
left join plm_properties_item b |
|
|
|
on a.PropertiesItemNo = b.ItemNo and a.site = b.site and a.RecordType = b.ItemType |
|
|
|
<where> |
|
|
|
AND a.site = #{site} |
|
|
|
and RecordType = 'IP' |
|
|
|
AND a.PartNo = #{partNo,jdbcType=VARCHAR} |
|
|
|
and RecordType = 'IP' |
|
|
|
AND a.PartNo = #{partNo,jdbcType=VARCHAR} |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
|
|
|
|
@ -504,22 +528,22 @@ |
|
|
|
|
|
|
|
<select id="propertiesModelSearchForBM" parameterType="PlmBmModelHeaderData" resultType="PlmBmModelHeaderData"> |
|
|
|
SELECT site, |
|
|
|
bu_no, |
|
|
|
dbo.plm_get_bu_desc(site, bu_no) buDesc, |
|
|
|
function_type, |
|
|
|
code_no, |
|
|
|
code_desc, |
|
|
|
active, |
|
|
|
created_date, |
|
|
|
created_by, |
|
|
|
update_date, |
|
|
|
update_by, |
|
|
|
delflag, |
|
|
|
version, |
|
|
|
edit_flag, |
|
|
|
properties_code_no, |
|
|
|
code_type, |
|
|
|
dbo.get_properties_codeDesc(site, function_type, properties_code_no) properties_code_desc |
|
|
|
bu_no, |
|
|
|
dbo.plm_get_bu_desc(site, bu_no) buDesc, |
|
|
|
function_type, |
|
|
|
code_no, |
|
|
|
code_desc, |
|
|
|
active, |
|
|
|
created_date, |
|
|
|
created_by, |
|
|
|
update_date, |
|
|
|
update_by, |
|
|
|
delflag, |
|
|
|
version, |
|
|
|
edit_flag, |
|
|
|
properties_code_no, |
|
|
|
code_type, |
|
|
|
dbo.get_properties_codeDesc(site, function_type, properties_code_no) properties_code_desc |
|
|
|
FROM plm_bm_model_header |
|
|
|
<where> |
|
|
|
and site = #{query.site} and delflag='N' |
|
|
|
@ -582,15 +606,15 @@ |
|
|
|
|
|
|
|
<select id="getItemListsForBM" resultType="PlmPropertiesItemData"> |
|
|
|
SELECT a.itemNo, |
|
|
|
a.ItemDesc |
|
|
|
a.ItemDesc |
|
|
|
FROM plm_properties_item a |
|
|
|
LEFT JOIN plm_bm_model_detail b on b.function_type = #{functionType} and b.code_no = #{codeNo} and |
|
|
|
b.properties_item_no = a.ItemNo and a.site = b.site and |
|
|
|
b.bu_no = #{buNo} |
|
|
|
LEFT JOIN plm_bm_model_detail b on b.function_type = #{functionType} and b.code_no = #{codeNo} and |
|
|
|
b.properties_item_no = a.ItemNo and a.site = b.site and |
|
|
|
b.bu_no = #{buNo} |
|
|
|
<where> |
|
|
|
a.ItemType = #{functionType} |
|
|
|
and a.site = #{site} |
|
|
|
AND b.code_no is null |
|
|
|
and a.site = #{site} |
|
|
|
AND b.code_no is null |
|
|
|
<if test="itemNo != null and itemNo != ''"> |
|
|
|
AND a.ItemNo LIKE '%' + #{itemNo} + '%' |
|
|
|
</if> |
|
|
|
@ -651,27 +675,53 @@ |
|
|
|
</insert> |
|
|
|
<select id="getPropertiesListByPartAndCodeNo" resultType="PartSubPropertiesValueData"> |
|
|
|
SELECT a.PartNo |
|
|
|
, a.Site |
|
|
|
, a.CodeNo |
|
|
|
, a.SubCodeSeqNo |
|
|
|
, a.SubCodeDesc |
|
|
|
, a.ItemNo |
|
|
|
, a.PropertiesItemNo |
|
|
|
, a.TextValue |
|
|
|
, a.NumValue |
|
|
|
, a.RecordType |
|
|
|
, b.ItemDesc ItemDesc |
|
|
|
, b.ValueType |
|
|
|
, b.ValueType_DB |
|
|
|
, b.ValueChooseFlag |
|
|
|
, a.Site |
|
|
|
, a.CodeNo |
|
|
|
, a.SubCodeSeqNo |
|
|
|
, a.SubCodeDesc |
|
|
|
, a.ItemNo |
|
|
|
, a.PropertiesItemNo |
|
|
|
, a.TextValue |
|
|
|
, a.NumValue |
|
|
|
, a.RecordType |
|
|
|
, b.ItemDesc ItemDesc |
|
|
|
, b.ValueType |
|
|
|
, b.ValueType_DB |
|
|
|
, b.ValueChooseFlag |
|
|
|
FROM PartSubPropertiesValue a |
|
|
|
left join plm_properties_item b |
|
|
|
on a.PropertiesItemNo = b.ItemNo and a.site = b.site and a.RecordType = b.ItemType |
|
|
|
left join plm_properties_item b |
|
|
|
on a.PropertiesItemNo = b.ItemNo and a.site = b.site and a.RecordType = b.ItemType |
|
|
|
<where> |
|
|
|
AND a.site = #{site} |
|
|
|
and a.RecordType = #{recordType} |
|
|
|
and a.codeNo = #{codeNo} |
|
|
|
AND a.PartNo = #{partNo,jdbcType=VARCHAR} |
|
|
|
</where> |
|
|
|
order by a.order_id |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="getPropertiesListByPartAndCodeNoForTool" resultType="PartSubPropertiesValueData"> |
|
|
|
SELECT a.PartNo |
|
|
|
, a.Site |
|
|
|
, a.CodeNo |
|
|
|
, a.SubCodeSeqNo |
|
|
|
, a.SubCodeDesc |
|
|
|
, a.ItemNo |
|
|
|
, a.PropertiesItemNo |
|
|
|
, a.TextValue |
|
|
|
, a.NumValue |
|
|
|
, a.RecordType |
|
|
|
, b.ItemDesc ItemDesc |
|
|
|
, b.ValueType |
|
|
|
, b.ValueType_DB |
|
|
|
, b.ValueChooseFlag |
|
|
|
FROM PartSubPropertiesValue a |
|
|
|
left join plm_properties_item b on a.PropertiesItemNo = b.ItemNo and b.site = '*' and a.RecordType = b.ItemType |
|
|
|
<where> |
|
|
|
AND a.site = #{site} |
|
|
|
and a.RecordType = #{recordType} |
|
|
|
and a.codeNo = #{codeNo} |
|
|
|
AND a.PartNo = #{partNo,jdbcType=VARCHAR} |
|
|
|
and a.RecordType = #{recordType} |
|
|
|
and a.codeNo = #{codeNo} |
|
|
|
AND a.PartNo = #{partNo,jdbcType=VARCHAR} |
|
|
|
</where> |
|
|
|
order by a.order_id |
|
|
|
</select> |
|
|
|
@ -699,17 +749,17 @@ |
|
|
|
|
|
|
|
<select id="getUpItemdata" resultType="com.spring.modules.base.entity.PlmPropertiesModelDetail"> |
|
|
|
select top 1 site, |
|
|
|
function_type, |
|
|
|
code_no, |
|
|
|
properties_item_no, |
|
|
|
seq_no, |
|
|
|
created_date, |
|
|
|
created_by, |
|
|
|
update_date, |
|
|
|
update_by, |
|
|
|
delflag, |
|
|
|
version, |
|
|
|
order_id |
|
|
|
function_type, |
|
|
|
code_no, |
|
|
|
properties_item_no, |
|
|
|
seq_no, |
|
|
|
created_date, |
|
|
|
created_by, |
|
|
|
update_date, |
|
|
|
update_by, |
|
|
|
delflag, |
|
|
|
version, |
|
|
|
order_id |
|
|
|
from plm_properties_model_detail |
|
|
|
where #{orderId} > order_id |
|
|
|
and site = #{site} |
|
|
|
@ -720,17 +770,17 @@ |
|
|
|
|
|
|
|
<select id="getDownItemdata" resultType="com.spring.modules.base.entity.PlmPropertiesModelDetail"> |
|
|
|
select top 1 site, |
|
|
|
function_type, |
|
|
|
code_no, |
|
|
|
properties_item_no, |
|
|
|
seq_no, |
|
|
|
created_date, |
|
|
|
created_by, |
|
|
|
update_date, |
|
|
|
update_by, |
|
|
|
delflag, |
|
|
|
version, |
|
|
|
order_id |
|
|
|
function_type, |
|
|
|
code_no, |
|
|
|
properties_item_no, |
|
|
|
seq_no, |
|
|
|
created_date, |
|
|
|
created_by, |
|
|
|
update_date, |
|
|
|
update_by, |
|
|
|
delflag, |
|
|
|
version, |
|
|
|
order_id |
|
|
|
from plm_properties_model_detail |
|
|
|
where order_id > #{orderId} |
|
|
|
and site = #{site} |
|
|
|
@ -750,20 +800,20 @@ |
|
|
|
|
|
|
|
<select id="propertiesListSearch" resultType="com.spring.modules.base.entity.PlmPropertiesModelHeader"> |
|
|
|
SELECT site, |
|
|
|
function_type, |
|
|
|
code_no, |
|
|
|
code_desc, |
|
|
|
active, |
|
|
|
created_date, |
|
|
|
created_by, |
|
|
|
update_date, |
|
|
|
update_by, |
|
|
|
delflag, |
|
|
|
version |
|
|
|
function_type, |
|
|
|
code_no, |
|
|
|
code_desc, |
|
|
|
active, |
|
|
|
created_date, |
|
|
|
created_by, |
|
|
|
update_date, |
|
|
|
update_by, |
|
|
|
delflag, |
|
|
|
version |
|
|
|
FROM plm_properties_model_header |
|
|
|
<where> |
|
|
|
site = #{site} |
|
|
|
and active = 'Y' |
|
|
|
and active = 'Y' |
|
|
|
<if test="codeNo != null and codeNo != ''"> |
|
|
|
AND code_no like '%' + #{codeNo} + '%' |
|
|
|
</if> |
|
|
|
@ -778,8 +828,8 @@ |
|
|
|
<select id="searchWorkCenterBMType" resultType="WorkCenterBMTypeData"> |
|
|
|
select a.site, a.work_center_no, a.work_center_desc, b.itemType, c.type_desc |
|
|
|
from work_center a |
|
|
|
left join WorkCenter_BMType b on a.site = b.site and a.work_center_no = b.workCenterNo |
|
|
|
left join plm_route_itemType c on b.itemType = c.item_type |
|
|
|
left join WorkCenter_BMType b on a.site = b.site and a.work_center_no = b.workCenterNo |
|
|
|
left join plm_route_itemType c on b.itemType = c.item_type |
|
|
|
<where> |
|
|
|
a.site = #{site} |
|
|
|
|
|
|
|
@ -835,7 +885,7 @@ |
|
|
|
<select id="searchBUPropertiesList" resultType="com.spring.modules.base.entity.Bu"> |
|
|
|
select a.bu_no, b.bu_desc |
|
|
|
from properties_bu a |
|
|
|
left join BU b on a.site = b.site and a.bu_no = b.bu_no |
|
|
|
left join BU b on a.site = b.site and a.bu_no = b.bu_no |
|
|
|
<where> |
|
|
|
<if test="functionType != null and functionType != ''"> |
|
|
|
and a.function_type = #{functionType} |
|
|
|
|