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.
137 lines
8.8 KiB
137 lines
8.8 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.ruoyi.system.mapper.SysEquipmentMapper">
|
|
|
|
<resultMap type="SysEquipment" id="SysEquipmentResult">
|
|
<result property="equipmentId" column="equipment_id" />
|
|
<result property="equipmentCode" column="equipment_code" />
|
|
<result property="equipmentName" column="equipment_name" />
|
|
<result property="equipmentModel" column="equipment_model" />
|
|
<result property="equipmentWeight" column="equipment_weight" />
|
|
<result property="unitOfMeasurement" column="unit_of_measurement" />
|
|
<result property="equipmentCategory" column="equipment_category" />
|
|
<result property="factoryNumber" column="factory_number" />
|
|
<result property="equipmentPrice" column="equipment_price" />
|
|
<result property="manufacturerNumber" column="manufacturer_number" />
|
|
<result property="dateOfManufacture" column="date_of_manufacture" />
|
|
<result property="equipmentDept" column="equipment_dept" />
|
|
<result property="manufacturerName" column="manufacturer_name" />
|
|
<result property="dateOfUse" column="date_of_use" />
|
|
<result property="depreciationYear" column="depreciation_year" />
|
|
<result property="depreciationRate" column="depreciation_rate" />
|
|
<result property="storageLocation" column="storage_location" />
|
|
<result property="completionOfProcess" column="completion_of_process" />
|
|
<result property="equipmentManager" column="equipment_manager" />
|
|
<result property="equipmentRemark" column="equipment_remark" />
|
|
<result property="firstAddTime" column="first_add_time" />
|
|
<result property="updateInfoTime" column="update_info_time" />
|
|
</resultMap>
|
|
|
|
<sql id="selectSysEquipmentVo">
|
|
select equipment_id, equipment_code, equipment_name, equipment_model, equipment_weight, unit_of_measurement, equipment_category, factory_number, equipment_price, manufacturer_number, date_of_manufacture, equipment_dept, manufacturer_name, date_of_use, depreciation_year, depreciation_rate, storage_location, completion_of_process, equipment_manager, equipment_remark, first_add_time, update_info_time from sys_equipment
|
|
</sql>
|
|
|
|
<select id="selectSysEquipmentList" parameterType="SysEquipment" resultMap="SysEquipmentResult">
|
|
<include refid="selectSysEquipmentVo"/>
|
|
<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="manufacturerNumber != null and manufacturerNumber != ''"> and manufacturer_number like concat('%', #{manufacturerNumber}, '%')</if>
|
|
<if test="manufacturerName != null and manufacturerName != ''"> and manufacturer_name like concat('%', #{manufacturerName}, '%')</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectSysEquipmentById" parameterType="Long" resultMap="SysEquipmentResult">
|
|
<include refid="selectSysEquipmentVo"/>
|
|
where equipment_id = #{equipmentId}
|
|
</select>
|
|
|
|
<insert id="insertSysEquipment" parameterType="SysEquipment" useGeneratedKeys="true" keyProperty="equipmentId">
|
|
insert into sys_equipment
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="equipmentCode != null">equipment_code,</if>
|
|
<if test="equipmentName != null">equipment_name,</if>
|
|
<if test="equipmentModel != null">equipment_model,</if>
|
|
<if test="equipmentWeight != null">equipment_weight,</if>
|
|
<if test="unitOfMeasurement != null">unit_of_measurement,</if>
|
|
<if test="equipmentCategory != null">equipment_category,</if>
|
|
<if test="factoryNumber != null">factory_number,</if>
|
|
<if test="equipmentPrice != null">equipment_price,</if>
|
|
<if test="manufacturerNumber != null">manufacturer_number,</if>
|
|
<if test="dateOfManufacture != null">date_of_manufacture,</if>
|
|
<if test="equipmentDept != null">equipment_dept,</if>
|
|
<if test="manufacturerName != null">manufacturer_name,</if>
|
|
<if test="dateOfUse != null">date_of_use,</if>
|
|
<if test="depreciationYear != null">depreciation_year,</if>
|
|
<if test="depreciationRate != null">depreciation_rate,</if>
|
|
<if test="storageLocation != null">storage_location,</if>
|
|
<if test="completionOfProcess != null">completion_of_process,</if>
|
|
<if test="equipmentManager != null">equipment_manager,</if>
|
|
<if test="equipmentRemark != null">equipment_remark,</if>
|
|
first_add_time,
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="equipmentCode != null">#{equipmentCode},</if>
|
|
<if test="equipmentName != null">#{equipmentName},</if>
|
|
<if test="equipmentModel != null">#{equipmentModel},</if>
|
|
<if test="equipmentWeight != null">#{equipmentWeight},</if>
|
|
<if test="unitOfMeasurement != null">#{unitOfMeasurement},</if>
|
|
<if test="equipmentCategory != null">#{equipmentCategory},</if>
|
|
<if test="factoryNumber != null">#{factoryNumber},</if>
|
|
<if test="equipmentPrice != null">#{equipmentPrice},</if>
|
|
<if test="manufacturerNumber != null">#{manufacturerNumber},</if>
|
|
<if test="dateOfManufacture != null">#{dateOfManufacture},</if>
|
|
<if test="equipmentDept != null">#{equipmentDept},</if>
|
|
<if test="manufacturerName != null">#{manufacturerName},</if>
|
|
<if test="dateOfUse != null">#{dateOfUse},</if>
|
|
<if test="depreciationYear != null">#{depreciationYear},</if>
|
|
<if test="depreciationRate != null">#{depreciationRate},</if>
|
|
<if test="storageLocation != null">#{storageLocation},</if>
|
|
<if test="completionOfProcess != null">#{completionOfProcess},</if>
|
|
<if test="equipmentManager != null">#{equipmentManager},</if>
|
|
<if test="equipmentRemark != null">#{equipmentRemark},</if>
|
|
now(),
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateSysEquipment" parameterType="SysEquipment">
|
|
update sys_equipment
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="equipmentCode != null">equipment_code = #{equipmentCode},</if>
|
|
<if test="equipmentName != null">equipment_name = #{equipmentName},</if>
|
|
<if test="equipmentModel != null">equipment_model = #{equipmentModel},</if>
|
|
<if test="equipmentWeight != null">equipment_weight = #{equipmentWeight},</if>
|
|
<if test="unitOfMeasurement != null">unit_of_measurement = #{unitOfMeasurement},</if>
|
|
<if test="equipmentCategory != null">equipment_category = #{equipmentCategory},</if>
|
|
<if test="factoryNumber != null">factory_number = #{factoryNumber},</if>
|
|
<if test="equipmentPrice != null">equipment_price = #{equipmentPrice},</if>
|
|
<if test="manufacturerNumber != null">manufacturer_number = #{manufacturerNumber},</if>
|
|
<if test="dateOfManufacture != null">date_of_manufacture = #{dateOfManufacture},</if>
|
|
<if test="equipmentDept != null">equipment_dept = #{equipmentDept},</if>
|
|
<if test="manufacturerName != null">manufacturer_name = #{manufacturerName},</if>
|
|
<if test="dateOfUse != null">date_of_use = #{dateOfUse},</if>
|
|
<if test="depreciationYear != null">depreciation_year = #{depreciationYear},</if>
|
|
<if test="depreciationRate != null">depreciation_rate = #{depreciationRate},</if>
|
|
<if test="storageLocation != null">storage_location = #{storageLocation},</if>
|
|
<if test="completionOfProcess != null">completion_of_process = #{completionOfProcess},</if>
|
|
<if test="equipmentManager != null">equipment_manager = #{equipmentManager},</if>
|
|
<if test="equipmentRemark != null">equipment_remark = #{equipmentRemark},</if>
|
|
update_info_time = CONCAT_WS(',',NOW(),update_info_time),
|
|
</trim>
|
|
where equipment_id = #{equipmentId}
|
|
</update>
|
|
|
|
<delete id="deleteSysEquipmentById" parameterType="Long">
|
|
delete from sys_equipment where equipment_id = #{equipmentId}
|
|
</delete>
|
|
|
|
<delete id="deleteSysEquipmentByIds" parameterType="String">
|
|
delete from sys_equipment where equipment_id in
|
|
<foreach item="equipmentId" collection="array" open="(" separator="," close=")">
|
|
#{equipmentId}
|
|
</foreach>
|
|
</delete>
|
|
|
|
</mapper>
|