You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
242 lines
16 KiB
XML
242 lines
16 KiB
XML
<?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.op.device.mapper.EquEquipmentMapper">
|
|
|
|
<resultMap type="EquEquipment" id="EquEquipmentResult">
|
|
<result property="equipmentId" column="equipment_id" />
|
|
<result property="equipmentCode" column="equipment_code" />
|
|
<result property="equipmentName" column="equipment_name" />
|
|
<result property="equipmentBrand" column="equipment_brand" />
|
|
<result property="equipmentSpec" column="equipment_spec" />
|
|
<result property="equipmentTypeId" column="equipment_type_id" />
|
|
<result property="equipmentTypeCode" column="equipment_type_code" />
|
|
<result property="equipmentTypeName" column="equipment_type_name" />
|
|
<result property="workshopId" column="workshop_id" />
|
|
<result property="workshopCode" column="workshop_code" />
|
|
<result property="workshopName" column="workshop_name" />
|
|
<result property="status" column="status" />
|
|
<result property="remark" column="remark" />
|
|
<result property="attr1" column="attr1" />
|
|
<result property="attr2" column="attr2" />
|
|
<result property="attr3" column="attr3" />
|
|
<result property="attr4" column="attr4" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="workshopSection" column="workshop_section" />
|
|
<result property="equipmentLocation" column="equipment_location" />
|
|
<result property="hourlyUnitPrice" column="hourly_unit_price" />
|
|
<result property="equipmentBarcode" column="equipment_barcode" />
|
|
<result property="equipmentBarcodeImage" column="equipment_barcode_image" />
|
|
<result property="manufacturer" column="manufacturer" />
|
|
<result property="supplier" column="supplier" />
|
|
<result property="useLife" column="use_life" />
|
|
<result property="buyTime" column="buy_time" />
|
|
<result property="assetOriginalValue" column="asset_original_value" />
|
|
<result property="netAssetValue" column="net_asset_value" />
|
|
<result property="assetHead" column="asset_head" />
|
|
<result property="fixedAssetCode" column="fixed_asset_code" />
|
|
<result property="department" column="department" />
|
|
<result property="unitWorkingHours" column="unit_working_hours" />
|
|
<result property="plcIp" column="plc_ip" />
|
|
<result property="plcPort" column="plc_port" />
|
|
<result property="delFlag" column="del_flag" />
|
|
<result property="sapAsset" column="sap_asset" />
|
|
</resultMap>
|
|
|
|
<sql id="selectEquEquipmentVo">
|
|
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, equipment_barcode, equipment_barcode_image, manufacturer, supplier, use_life, buy_time, asset_original_value, net_asset_value, asset_head, fixed_asset_code, department, unit_working_hours, plc_ip, plc_port, del_flag, sap_asset from base_equipment
|
|
</sql>
|
|
|
|
<select id="selectEquEquipmentList" parameterType="EquEquipment" resultMap="EquEquipmentResult">
|
|
<include refid="selectEquEquipmentVo"/>
|
|
<where>
|
|
<if test="equipmentCode != null and equipmentCode != ''"> and equipment_code like concat('%', #{equipmentCode}, '%')</if>
|
|
<if test="equipmentName != null and equipmentName != ''"> and equipment_name like concat('%', #{equipmentName}, '%')</if>
|
|
<if test="equipmentBrand != null and equipmentBrand != ''"> and equipment_brand = #{equipmentBrand}</if>
|
|
<if test="equipmentSpec != null and equipmentSpec != ''"> and equipment_spec = #{equipmentSpec}</if>
|
|
<if test="equipmentTypeId != null "> and equipment_type_id = #{equipmentTypeId}</if>
|
|
<if test="equipmentTypeCode != null and equipmentTypeCode != ''"> and equipment_type_code = #{equipmentTypeCode}</if>
|
|
<if test="equipmentTypeName != null and equipmentTypeName != ''"> and equipment_type_name like concat('%', #{equipmentTypeName}, '%')</if>
|
|
<if test="workshopId != null "> and workshop_id = #{workshopId}</if>
|
|
<if test="workshopCode != null and workshopCode != ''"> and workshop_code = #{workshopCode}</if>
|
|
<if test="workshopName != null and workshopName != ''"> and workshop_name like concat('%', #{workshopName}, '%')</if>
|
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
|
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
|
|
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
|
|
<if test="attr3 != null "> and attr3 = #{attr3}</if>
|
|
<if test="attr4 != null "> and attr4 = #{attr4}</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="hourlyUnitPrice != null "> and hourly_unit_price = #{hourlyUnitPrice}</if>
|
|
<if test="equipmentBarcode != null and equipmentBarcode != ''"> and equipment_barcode = #{equipmentBarcode}</if>
|
|
<if test="equipmentBarcodeImage != null and equipmentBarcodeImage != ''"> and equipment_barcode_image = #{equipmentBarcodeImage}</if>
|
|
<if test="manufacturer != null and manufacturer != ''"> and manufacturer = #{manufacturer}</if>
|
|
<if test="supplier != null and supplier != ''"> and supplier = #{supplier}</if>
|
|
<if test="useLife != null and useLife != ''"> and use_life = #{useLife}</if>
|
|
<if test="buyTime != null "> and buy_time = #{buyTime}</if>
|
|
<if test="assetOriginalValue != null and assetOriginalValue != ''"> and asset_original_value = #{assetOriginalValue}</if>
|
|
<if test="netAssetValue != null and netAssetValue != ''"> and net_asset_value = #{netAssetValue}</if>
|
|
<if test="assetHead != null and assetHead != ''"> and asset_head = #{assetHead}</if>
|
|
<if test="fixedAssetCode != null and fixedAssetCode != ''"> and fixed_asset_code = #{fixedAssetCode}</if>
|
|
<if test="department != null and department != ''"> and department = #{department}</if>
|
|
<if test="unitWorkingHours != null and unitWorkingHours != ''"> and unit_working_hours = #{unitWorkingHours}</if>
|
|
<if test="plcIp != null and plcIp != ''"> and plc_ip = #{plcIp}</if>
|
|
<if test="plcPort != null "> and plc_port = #{plcPort}</if>
|
|
<if test="sapAsset != null and sapAsset != ''"> and sap_asset = #{sapAsset}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectEquEquipmentByEquEquipmentId" parameterType="Long" resultMap="EquEquipmentResult">
|
|
<include refid="selectEquEquipmentVo"/>
|
|
where equipment_id = #{equipmentId}
|
|
</select>
|
|
|
|
<insert id="insertEquEquipment" parameterType="EquEquipment">
|
|
insert into base_equipment
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="equipmentId != null">equipment_id,</if>
|
|
<if test="equipmentCode != null">equipment_code,</if>
|
|
<if test="equipmentName != null">equipment_name,</if>
|
|
<if test="equipmentBrand != null">equipment_brand,</if>
|
|
<if test="equipmentSpec != null">equipment_spec,</if>
|
|
<if test="equipmentTypeId != null">equipment_type_id,</if>
|
|
<if test="equipmentTypeCode != null">equipment_type_code,</if>
|
|
<if test="equipmentTypeName != null">equipment_type_name,</if>
|
|
<if test="workshopId != null">workshop_id,</if>
|
|
<if test="workshopCode != null">workshop_code,</if>
|
|
<if test="workshopName != null">workshop_name,</if>
|
|
<if test="status != null">status,</if>
|
|
<if test="remark != null">remark,</if>
|
|
<if test="attr1 != null">attr1,</if>
|
|
<if test="attr2 != null">attr2,</if>
|
|
<if test="attr3 != null">attr3,</if>
|
|
<if test="attr4 != null">attr4,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="workshopSection != null">workshop_section,</if>
|
|
<if test="equipmentLocation != null">equipment_location,</if>
|
|
<if test="hourlyUnitPrice != null">hourly_unit_price,</if>
|
|
<if test="equipmentBarcode != null">equipment_barcode,</if>
|
|
<if test="equipmentBarcodeImage != null">equipment_barcode_image,</if>
|
|
<if test="manufacturer != null">manufacturer,</if>
|
|
<if test="supplier != null">supplier,</if>
|
|
<if test="useLife != null">use_life,</if>
|
|
<if test="buyTime != null">buy_time,</if>
|
|
<if test="assetOriginalValue != null">asset_original_value,</if>
|
|
<if test="netAssetValue != null">net_asset_value,</if>
|
|
<if test="assetHead != null">asset_head,</if>
|
|
<if test="fixedAssetCode != null">fixed_asset_code,</if>
|
|
<if test="department != null">department,</if>
|
|
<if test="unitWorkingHours != null">unit_working_hours,</if>
|
|
<if test="plcIp != null">plc_ip,</if>
|
|
<if test="plcPort != null">plc_port,</if>
|
|
<if test="delFlag != null">del_flag,</if>
|
|
<if test="sapAsset != null">sap_asset,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="equipmentId != null">#{equipmentId},</if>
|
|
<if test="equipmentCode != null">#{equipmentCode},</if>
|
|
<if test="equipmentName != null">#{equipmentName},</if>
|
|
<if test="equipmentBrand != null">#{equipmentBrand},</if>
|
|
<if test="equipmentSpec != null">#{equipmentSpec},</if>
|
|
<if test="equipmentTypeId != null">#{equipmentTypeId},</if>
|
|
<if test="equipmentTypeCode != null">#{equipmentTypeCode},</if>
|
|
<if test="equipmentTypeName != null">#{equipmentTypeName},</if>
|
|
<if test="workshopId != null">#{workshopId},</if>
|
|
<if test="workshopCode != null">#{workshopCode},</if>
|
|
<if test="workshopName != null">#{workshopName},</if>
|
|
<if test="status != null">#{status},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
<if test="attr1 != null">#{attr1},</if>
|
|
<if test="attr2 != null">#{attr2},</if>
|
|
<if test="attr3 != null">#{attr3},</if>
|
|
<if test="attr4 != null">#{attr4},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="workshopSection != null">#{workshopSection},</if>
|
|
<if test="equipmentLocation != null">#{equipmentLocation},</if>
|
|
<if test="hourlyUnitPrice != null">#{hourlyUnitPrice},</if>
|
|
<if test="equipmentBarcode != null">#{equipmentBarcode},</if>
|
|
<if test="equipmentBarcodeImage != null">#{equipmentBarcodeImage},</if>
|
|
<if test="manufacturer != null">#{manufacturer},</if>
|
|
<if test="supplier != null">#{supplier},</if>
|
|
<if test="useLife != null">#{useLife},</if>
|
|
<if test="buyTime != null">#{buyTime},</if>
|
|
<if test="assetOriginalValue != null">#{assetOriginalValue},</if>
|
|
<if test="netAssetValue != null">#{netAssetValue},</if>
|
|
<if test="assetHead != null">#{assetHead},</if>
|
|
<if test="fixedAssetCode != null">#{fixedAssetCode},</if>
|
|
<if test="department != null">#{department},</if>
|
|
<if test="unitWorkingHours != null">#{unitWorkingHours},</if>
|
|
<if test="plcIp != null">#{plcIp},</if>
|
|
<if test="plcPort != null">#{plcPort},</if>
|
|
<if test="delFlag != null">#{delFlag},</if>
|
|
<if test="sapAsset != null">#{sapAsset},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateEquEquipment" parameterType="EquEquipment">
|
|
update base_equipment
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="equipmentCode != null">equipment_code = #{equipmentCode},</if>
|
|
<if test="equipmentName != null">equipment_name = #{equipmentName},</if>
|
|
<if test="equipmentBrand != null">equipment_brand = #{equipmentBrand},</if>
|
|
<if test="equipmentSpec != null">equipment_spec = #{equipmentSpec},</if>
|
|
<if test="equipmentTypeId != null">equipment_type_id = #{equipmentTypeId},</if>
|
|
<if test="equipmentTypeCode != null">equipment_type_code = #{equipmentTypeCode},</if>
|
|
<if test="equipmentTypeName != null">equipment_type_name = #{equipmentTypeName},</if>
|
|
<if test="workshopId != null">workshop_id = #{workshopId},</if>
|
|
<if test="workshopCode != null">workshop_code = #{workshopCode},</if>
|
|
<if test="workshopName != null">workshop_name = #{workshopName},</if>
|
|
<if test="status != null">status = #{status},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
<if test="attr1 != null">attr1 = #{attr1},</if>
|
|
<if test="attr2 != null">attr2 = #{attr2},</if>
|
|
<if test="attr3 != null">attr3 = #{attr3},</if>
|
|
<if test="attr4 != null">attr4 = #{attr4},</if>
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="workshopSection != null">workshop_section = #{workshopSection},</if>
|
|
<if test="equipmentLocation != null">equipment_location = #{equipmentLocation},</if>
|
|
<if test="hourlyUnitPrice != null">hourly_unit_price = #{hourlyUnitPrice},</if>
|
|
<if test="equipmentBarcode != null">equipment_barcode = #{equipmentBarcode},</if>
|
|
<if test="equipmentBarcodeImage != null">equipment_barcode_image = #{equipmentBarcodeImage},</if>
|
|
<if test="manufacturer != null">manufacturer = #{manufacturer},</if>
|
|
<if test="supplier != null">supplier = #{supplier},</if>
|
|
<if test="useLife != null">use_life = #{useLife},</if>
|
|
<if test="buyTime != null">buy_time = #{buyTime},</if>
|
|
<if test="assetOriginalValue != null">asset_original_value = #{assetOriginalValue},</if>
|
|
<if test="netAssetValue != null">net_asset_value = #{netAssetValue},</if>
|
|
<if test="assetHead != null">asset_head = #{assetHead},</if>
|
|
<if test="fixedAssetCode != null">fixed_asset_code = #{fixedAssetCode},</if>
|
|
<if test="department != null">department = #{department},</if>
|
|
<if test="unitWorkingHours != null">unit_working_hours = #{unitWorkingHours},</if>
|
|
<if test="plcIp != null">plc_ip = #{plcIp},</if>
|
|
<if test="plcPort != null">plc_port = #{plcPort},</if>
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
<if test="sapAsset != null">sap_asset = #{sapAsset},</if>
|
|
</trim>
|
|
where equipment_id = #{equipmentId}
|
|
</update>
|
|
|
|
<delete id="deleteEquEquipmentByEquEquipmentId" parameterType="Long">
|
|
delete from base_equipment where equipment_id = #{equipmentId}
|
|
</delete>
|
|
|
|
<delete id="deleteEquEquipmentByEquEquipmentIds" parameterType="String">
|
|
delete from base_equipment where equipment_id in
|
|
<foreach item="equipmentId" collection="array" open="(" separator="," close=")">
|
|
#{equipmentId}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |