|
|
@ -30,10 +30,11 @@
|
|
|
|
<result property="workshopSection" column="workshop_section" />
|
|
|
|
<result property="workshopSection" column="workshop_section" />
|
|
|
|
<result property="equipmentLocation" column="equipment_location" />
|
|
|
|
<result property="equipmentLocation" column="equipment_location" />
|
|
|
|
<result property="hourlyUnitPrice" column="hourly_unit_price" />
|
|
|
|
<result property="hourlyUnitPrice" column="hourly_unit_price" />
|
|
|
|
|
|
|
|
<result property="delFlag" column="del_flag" />
|
|
|
|
</resultMap>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
|
|
<sql id="selectBaseEquipmentVo">
|
|
|
|
<sql id="selectBaseEquipmentVo">
|
|
|
|
select equipment_id, equipment_code, equipment_name, equipment_brand, equipment_spec, equipment_type_id, equipment_type_code, equipment_type_name, workshop_id, workshop_code, workshop_name, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, workshop_section, equipment_location, hourly_unit_price,unit_working_hours from base_equipment
|
|
|
|
select equipment_id, equipment_code, equipment_name, equipment_brand, equipment_spec, equipment_type_id, equipment_type_code, equipment_type_name, workshop_id, workshop_code, workshop_name, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, workshop_section, equipment_location, hourly_unit_price,unit_working_hours,del_flag from base_equipment
|
|
|
|
</sql>
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectBaseEquipmentList" parameterType="BaseEquipment" resultMap="BaseEquipmentResult">
|
|
|
|
<select id="selectBaseEquipmentList" parameterType="BaseEquipment" resultMap="BaseEquipmentResult">
|
|
|
@ -58,12 +59,14 @@
|
|
|
|
<if test="workshopSection != null and workshopSection != ''"> and workshop_section = #{workshopSection}</if>
|
|
|
|
<if test="workshopSection != null and workshopSection != ''"> and workshop_section = #{workshopSection}</if>
|
|
|
|
<if test="equipmentLocation != null and equipmentLocation != ''"> and equipment_location = #{equipmentLocation}</if>
|
|
|
|
<if test="equipmentLocation != null and equipmentLocation != ''"> and equipment_location = #{equipmentLocation}</if>
|
|
|
|
<if test="hourlyUnitPrice != null and hourlyUnitPrice != ''"> and hourly_unit_price = #{hourlyUnitPrice}</if>
|
|
|
|
<if test="hourlyUnitPrice != null and hourlyUnitPrice != ''"> and hourly_unit_price = #{hourlyUnitPrice}</if>
|
|
|
|
|
|
|
|
and del_flag ='0'
|
|
|
|
</where>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectBaseEquipmentByEquipmentId" parameterType="Long" resultMap="BaseEquipmentResult">
|
|
|
|
<select id="selectBaseEquipmentByEquipmentId" parameterType="Long" resultMap="BaseEquipmentResult">
|
|
|
|
<include refid="selectBaseEquipmentVo"/>
|
|
|
|
<include refid="selectBaseEquipmentVo"/>
|
|
|
|
where equipment_id = #{equipmentId}
|
|
|
|
where equipment_id = #{equipmentId}
|
|
|
|
|
|
|
|
and del_flag ='0'
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<insert id="insertBaseEquipment" parameterType="BaseEquipment" useGeneratedKeys="true" keyProperty="equipmentId">
|
|
|
|
<insert id="insertBaseEquipment" parameterType="BaseEquipment" useGeneratedKeys="true" keyProperty="equipmentId">
|
|
|
@ -153,16 +156,20 @@
|
|
|
|
where equipment_id = #{equipmentId}
|
|
|
|
where equipment_id = #{equipmentId}
|
|
|
|
</update>
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
|
|
<delete id="deleteBaseEquipmentByEquipmentId" parameterType="Long">
|
|
|
|
<update id="deleteBaseEquipmentByEquipmentId" parameterType="Long">
|
|
|
|
delete from base_equipment where equipment_id = #{equipmentId}
|
|
|
|
update base_equipment
|
|
|
|
</delete>
|
|
|
|
set del_flag = '1'
|
|
|
|
|
|
|
|
where equipment_id = #{equipmentId}
|
|
|
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
|
|
<delete id="deleteBaseEquipmentByEquipmentIds" parameterType="String">
|
|
|
|
<update id="deleteBaseEquipmentByEquipmentIds" parameterType="String">
|
|
|
|
delete from base_equipment where equipment_id in
|
|
|
|
update base_equipment
|
|
|
|
|
|
|
|
set del_flag = '1'
|
|
|
|
|
|
|
|
where equipment_id in
|
|
|
|
<foreach item="equipmentId" collection="array" open="(" separator="," close=")">
|
|
|
|
<foreach item="equipmentId" collection="array" open="(" separator="," close=")">
|
|
|
|
#{equipmentId}
|
|
|
|
#{equipmentId}
|
|
|
|
</foreach>
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getEquipmentTypeName" parameterType="BaseEquipment" resultType="java.lang.String">
|
|
|
|
<select id="getEquipmentTypeName" parameterType="BaseEquipment" resultType="java.lang.String">
|
|
|
|
select dict_label
|
|
|
|
select dict_label
|
|
|
@ -174,18 +181,21 @@
|
|
|
|
select equipment_name
|
|
|
|
select equipment_name
|
|
|
|
from base_equipment
|
|
|
|
from base_equipment
|
|
|
|
where equipment_name = #{equipmentName}
|
|
|
|
where equipment_name = #{equipmentName}
|
|
|
|
|
|
|
|
and del_flag = '0'
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="checkEquipmentCodeUnique" parameterType="BaseEquipment" resultType ="java.lang.String">
|
|
|
|
<select id="checkEquipmentCodeUnique" parameterType="BaseEquipment" resultType ="java.lang.String">
|
|
|
|
select equipment_code
|
|
|
|
select equipment_code
|
|
|
|
from base_equipment
|
|
|
|
from base_equipment
|
|
|
|
where equipment_code = #{equipmentCode}
|
|
|
|
where equipment_code = #{equipmentCode}
|
|
|
|
|
|
|
|
and del_flag = '0'
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getWorkCenterName" parameterType="BaseEquipment" resultType="java.lang.String">
|
|
|
|
<select id="getWorkCenterName" parameterType="BaseEquipment" resultType="java.lang.String">
|
|
|
|
select factory_name
|
|
|
|
select factory_name
|
|
|
|
from sys_factory
|
|
|
|
from sys_factory
|
|
|
|
where factory_code = #{workshopCode}
|
|
|
|
where factory_code = #{workshopCode}
|
|
|
|
|
|
|
|
and del_flag = '0'
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
</mapper>
|
|
|
|
</mapper>
|