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.

146 lines
10 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.os.ems.info.mapper.PowerEnergySparePartsRegistrationMapper">
<resultMap type="PowerEnergySparePartsRegistration" id="PowerEnergySparePartsRegistrationResult">
<result property="objid" column="objid" />
<result property="type" column="type" />
<result property="referenceLocation" column="reference_location" />
<result property="locationDescription" column="location_description" />
<result property="powerSource" column="power_source" />
<result property="batteryType" column="battery_type" />
<result property="remarks" column="remarks" />
<result property="imageLocation" column="image_location" />
<result property="firstInstance" column="first_instance" />
<result property="secondInstance" column="second_instance" />
<result property="thirdInstance" column="third_instance" />
<result property="fourthInstance" column="fourth_instance" />
<result property="fifthInstance" column="fifth_instance" />
<result property="sixthInstance" column="sixth_instance" />
<result property="seventhInstance" column="seventh_instance" />
<result property="eighthInstance" column="eighth_instance" />
<result property="ninthInstance" column="ninth_instance" />
<result property="tenthInstance" column="tenth_instance" />
<result property="eleventhInstance" column="eleventh_instance" />
<result property="twelfthInstance" column="twelfth_instance" />
</resultMap>
<sql id="selectPowerEnergySparePartsRegistrationVo">
select objid, type, reference_location, location_description, power_source, battery_type, remarks, image_location, first_instance, second_instance, third_instance, fourth_instance, fifth_instance, sixth_instance, seventh_instance, eighth_instance, ninth_instance, tenth_instance, eleventh_instance, twelfth_instance from power_energy_spare_parts_registration
</sql>
<select id="selectPowerEnergySparePartsRegistrationList" parameterType="PowerEnergySparePartsRegistration" resultMap="PowerEnergySparePartsRegistrationResult">
<include refid="selectPowerEnergySparePartsRegistrationVo"/>
<where>
<if test="type != null and type != ''"> and type like concat('%', #{type}, '%')</if>
<if test="referenceLocation != null and referenceLocation != ''"> and reference_location like concat('%', #{referenceLocation}, '%')</if>
<if test="locationDescription != null and locationDescription != ''"> and location_description like concat('%', #{locationDescription}, '%')</if>
<if test="powerSource != null and powerSource != ''"> and power_source like concat('%', #{powerSource}, '%')</if>
<if test="batteryType != null and batteryType != ''"> and battery_type like concat('%', #{batteryType}, '%')</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
<if test="imageLocation != null and imageLocation != ''"> and image_location = #{imageLocation}</if>
<if test="firstInstance != null and firstInstance != ''"> and first_instance = #{firstInstance}</if>
<if test="secondInstance != null and secondInstance != ''"> and second_instance = #{secondInstance}</if>
<if test="thirdInstance != null and thirdInstance != ''"> and third_instance = #{thirdInstance}</if>
<if test="fourthInstance != null and fourthInstance != ''"> and fourth_instance = #{fourthInstance}</if>
<if test="fifthInstance != null and fifthInstance != ''"> and fifth_instance = #{fifthInstance}</if>
<if test="sixthInstance != null and sixthInstance != ''"> and sixth_instance = #{sixthInstance}</if>
<if test="seventhInstance != null and seventhInstance != ''"> and seventh_instance = #{seventhInstance}</if>
<if test="eighthInstance != null and eighthInstance != ''"> and eighth_instance = #{eighthInstance}</if>
<if test="ninthInstance != null and ninthInstance != ''"> and ninth_instance = #{ninthInstance}</if>
<if test="tenthInstance != null and tenthInstance != ''"> and tenth_instance = #{tenthInstance}</if>
<if test="eleventhInstance != null and eleventhInstance != ''"> and eleventh_instance = #{eleventhInstance}</if>
<if test="twelfthInstance != null and twelfthInstance != ''"> and twelfth_instance = #{twelfthInstance}</if>
</where>
</select>
<select id="selectPowerEnergySparePartsRegistrationByObjid" parameterType="Long" resultMap="PowerEnergySparePartsRegistrationResult">
<include refid="selectPowerEnergySparePartsRegistrationVo"/>
where objid = #{objid}
</select>
<insert id="insertPowerEnergySparePartsRegistration" parameterType="PowerEnergySparePartsRegistration" useGeneratedKeys="true" keyProperty="objid">
insert into power_energy_spare_parts_registration
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="type != null">type,</if>
<if test="referenceLocation != null">reference_location,</if>
<if test="locationDescription != null">location_description,</if>
<if test="powerSource != null">power_source,</if>
<if test="batteryType != null">battery_type,</if>
<if test="remarks != null">remarks,</if>
<if test="imageLocation != null">image_location,</if>
<if test="firstInstance != null">first_instance,</if>
<if test="secondInstance != null">second_instance,</if>
<if test="thirdInstance != null">third_instance,</if>
<if test="fourthInstance != null">fourth_instance,</if>
<if test="fifthInstance != null">fifth_instance,</if>
<if test="sixthInstance != null">sixth_instance,</if>
<if test="seventhInstance != null">seventh_instance,</if>
<if test="eighthInstance != null">eighth_instance,</if>
<if test="ninthInstance != null">ninth_instance,</if>
<if test="tenthInstance != null">tenth_instance,</if>
<if test="eleventhInstance != null">eleventh_instance,</if>
<if test="twelfthInstance != null">twelfth_instance,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="type != null">#{type},</if>
<if test="referenceLocation != null">#{referenceLocation},</if>
<if test="locationDescription != null">#{locationDescription},</if>
<if test="powerSource != null">#{powerSource},</if>
<if test="batteryType != null">#{batteryType},</if>
<if test="remarks != null">#{remarks},</if>
<if test="imageLocation != null">#{imageLocation},</if>
<if test="firstInstance != null">#{firstInstance},</if>
<if test="secondInstance != null">#{secondInstance},</if>
<if test="thirdInstance != null">#{thirdInstance},</if>
<if test="fourthInstance != null">#{fourthInstance},</if>
<if test="fifthInstance != null">#{fifthInstance},</if>
<if test="sixthInstance != null">#{sixthInstance},</if>
<if test="seventhInstance != null">#{seventhInstance},</if>
<if test="eighthInstance != null">#{eighthInstance},</if>
<if test="ninthInstance != null">#{ninthInstance},</if>
<if test="tenthInstance != null">#{tenthInstance},</if>
<if test="eleventhInstance != null">#{eleventhInstance},</if>
<if test="twelfthInstance != null">#{twelfthInstance},</if>
</trim>
</insert>
<update id="updatePowerEnergySparePartsRegistration" parameterType="PowerEnergySparePartsRegistration">
update power_energy_spare_parts_registration
<trim prefix="SET" suffixOverrides=",">
<if test="type != null">type = #{type},</if>
<if test="referenceLocation != null">reference_location = #{referenceLocation},</if>
<if test="locationDescription != null">location_description = #{locationDescription},</if>
<if test="powerSource != null">power_source = #{powerSource},</if>
<if test="batteryType != null">battery_type = #{batteryType},</if>
<if test="remarks != null">remarks = #{remarks},</if>
<if test="imageLocation != null">image_location = #{imageLocation},</if>
<if test="firstInstance != null">first_instance = #{firstInstance},</if>
<if test="secondInstance != null">second_instance = #{secondInstance},</if>
<if test="thirdInstance != null">third_instance = #{thirdInstance},</if>
<if test="fourthInstance != null">fourth_instance = #{fourthInstance},</if>
<if test="fifthInstance != null">fifth_instance = #{fifthInstance},</if>
<if test="sixthInstance != null">sixth_instance = #{sixthInstance},</if>
<if test="seventhInstance != null">seventh_instance = #{seventhInstance},</if>
<if test="eighthInstance != null">eighth_instance = #{eighthInstance},</if>
<if test="ninthInstance != null">ninth_instance = #{ninthInstance},</if>
<if test="tenthInstance != null">tenth_instance = #{tenthInstance},</if>
<if test="eleventhInstance != null">eleventh_instance = #{eleventhInstance},</if>
<if test="twelfthInstance != null">twelfth_instance = #{twelfthInstance},</if>
</trim>
where objid = #{objid}
</update>
<delete id="deletePowerEnergySparePartsRegistrationByObjid" parameterType="Long">
delete from power_energy_spare_parts_registration where objid = #{objid}
</delete>
<delete id="deletePowerEnergySparePartsRegistrationByObjids" parameterType="String">
delete from power_energy_spare_parts_registration where objid in
<foreach item="objid" collection="array" open="(" separator="," close=")">
#{objid}
</foreach>
</delete>
</mapper>