@ -83,7 +83,7 @@
</select>
<select id= "eamFamilySearch" parameterType= "com.xujie.sys.modules.pms.data.EamFamilyData" resultType= "com.xujie.sys.modules.pms.data.EamFamilyData" >
<select id= "eamFamilySearch" parameterType= "com.xujie.sys.modules.pms.data.EamFamilyData" resultType= "com.xujie.sys.modules.pms.data.EamFamilyData" >
SELECT
Site,
FamilyID,
@ -108,9 +108,9 @@
AND active = #{query.active}
</if>
</where>
</select>
</select>
<select id= "eamGroupSearch" parameterType= "com.xujie.sys.modules.pms.data.EamGroupData" resultType= "com.xujie.sys.modules.pms.data.EamGroupData" >
<select id= "eamGroupSearch" parameterType= "com.xujie.sys.modules.pms.data.EamGroupData" resultType= "com.xujie.sys.modules.pms.data.EamGroupData" >
SELECT
Site,
GroupID,
@ -135,9 +135,9 @@
AND active = #{query.active}
</if>
</where>
</select>
</select>
<select id= "eamLocationSearch" parameterType= "com.xujie.sys.modules.pms.data.EamLocationData" resultType= "com.xujie.sys.modules.pms.data.EamLocationData" >
<select id= "eamLocationSearch" parameterType= "com.xujie.sys.modules.pms.data.EamLocationData" resultType= "com.xujie.sys.modules.pms.data.EamLocationData" >
SELECT
Site,
LocationID,
@ -162,9 +162,9 @@
AND active = #{query.active}
</if>
</where>
</select>
</select>
<select id= "eamManufacturerSearch" parameterType= "com.xujie.sys.modules.pms.data.EamManufacturerData" resultType= "com.xujie.sys.modules.pms.data.EamManufacturerData" >
<select id= "eamManufacturerSearch" parameterType= "com.xujie.sys.modules.pms.data.EamManufacturerData" resultType= "com.xujie.sys.modules.pms.data.EamManufacturerData" >
SELECT
Site,
ManufacturerID,
@ -194,9 +194,9 @@
AND active = #{query.active}
</if>
</where>
</select>
</select>
<select id= "eamAdminLevelSearch" parameterType= "com.xujie.sys.modules.pms.data.EamAdminLevelData" resultType= "com.xujie.sys.modules.pms.data.EamAdminLevelData" >
<select id= "eamAdminLevelSearch" parameterType= "com.xujie.sys.modules.pms.data.EamAdminLevelData" resultType= "com.xujie.sys.modules.pms.data.EamAdminLevelData" >
SELECT
Site,
AdminLevelID,
@ -221,8 +221,8 @@
AND active = #{query.active}
</if>
</where>
</select>
<select id= "eamSupplierSearch" parameterType= "com.xujie.sys.modules.pms.data.EamSupplierData" resultType= "com.xujie.sys.modules.pms.data.EamSupplierData" >
</select>
<select id= "eamSupplierSearch" parameterType= "com.xujie.sys.modules.pms.data.EamSupplierData" resultType= "com.xujie.sys.modules.pms.data.EamSupplierData" >
SELECT
Site,
SupplierID,
@ -253,9 +253,9 @@
AND active = #{query.active}
</if>
</where>
</select>
</select>
<select id= "searchItemAvailable" resultType= "com.xujie.sys.modules.pms.data.EamPropertiesItemAvailableData" >
<select id= "searchItemAvailable" resultType= "com.xujie.sys.modules.pms.data.EamPropertiesItemAvailableData" >
SELECT
site,
ItemNo,
@ -266,29 +266,29 @@
ItemType
from eam_properties_item_available
where itemNo = #{itemNo} and ItemType = #{itemType} and site = #{site}
</select>
</select>
<select id= "getItemValueNo" resultType= "Double" >
<select id= "getItemValueNo" resultType= "Double" >
SELECT isnull( max(valueNo),0)+1 from eam_properties_item_available where itemNo = #{itemNo} and ItemType = #{itemType} and site = #{site}
</select>
<select id= "getItemValueNoForPlan" resultType= "Double" >
</select>
<select id= "getItemValueNoForPlan" resultType= "Double" >
SELECT isnull( max(valueNo),0)+1 from eam_workPlan_item_available where itemNo=#{itemNo} and ItemType=#{itemType} and site=#{site} and PlanID=#{planID}
</select>
<insert id= "saveItemAvailable" >
</select>
<insert id= "saveItemAvailable" >
insert into eam_properties_item_available (ItemNo,ValueNo,AvailableValue,CreatedDate,CreatedBy,ItemType,site)
values(#{itemNo},#{valueNo},#{availableValue},GetDate(),#{createdBy},#{itemType},#{site})
</insert>
</insert>
<update id= "updateItemAvailable" >
<update id= "updateItemAvailable" >
update eam_properties_item_available set AvailableValue = #{availableValue} where itemNo = #{itemNo} and ItemType = #{itemType} and ValueNo = #{valueNo} and site = #{site}
</update>
</update>
<delete id= "deleteItemAvailable" >
<delete id= "deleteItemAvailable" >
delete from eam_properties_item_available where itemNo = #{itemNo} and ItemType = #{itemType} and ValueNo = #{valueNo} and site = #{site}
</delete>
</delete>
<select id= "eamPropertiesModelSearch" parameterType= "com.xujie.sys.modules.pms.data.EamPropertiesModelHeaderData" resultType= "com.xujie.sys.modules.pms.data.EamPropertiesModelHeaderData" >
<select id= "eamPropertiesModelSearch" parameterType= "com.xujie.sys.modules.pms.data.EamPropertiesModelHeaderData" resultType= "com.xujie.sys.modules.pms.data.EamPropertiesModelHeaderData" >
SELECT
site,
function_type,
@ -300,7 +300,10 @@
update_date,
update_by,
delflag,
version
version,
CASE WHEN dbo.eam_model_is_use(site, function_type, code_no) > 0 THEN 'Y'
else 'N'
END as isUse
FROM eam_properties_model_header
<where >
site = #{query.site}
@ -313,9 +316,15 @@
<if test= "query.active != null and query.active != ''" >
AND active = #{query.active}
</if>
<if test= 'query.isUse != null and query.isUse != "" and query.isUse == "Y"' >
AND dbo.eam_model_is_use(site, function_type, code_no) > 0
</if>
<if test= 'query.isUse != null and query.isUse != "" and query.isUse == "N"' >
AND dbo.eam_model_is_use(site, function_type, code_no) = 0
</if>
and function_type = #{query.functionType}
</where>
</select>
</select>
<insert id= "eamPropertiesModelSave" >
insert into eam_properties_model_header