<?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.jcdm.main.em.equipmentType.mapper.EmEquipmentTypeMapper">
|
|
<resultMap type="EmEquipmentType" id="EmEquipmentTypeResult">
|
<result property="id" column="id" />
|
<result property="equipmentTypeCode" column="equipment_type_code" />
|
<result property="equipmentTypeName" column="equipment_type_name" />
|
<result property="parentTypeId" column="parent_type_id" />
|
<result property="ancestors" column="ancestors" />
|
<result property="status" column="status" />
|
<result property="remark" column="remark" />
|
<result property="createUser" column="create_user" />
|
<result property="createTime" column="create_time" />
|
<result property="updateUser" column="update_user" />
|
<result property="updateTime" column="update_time" />
|
<result property="spareField1" column="spare_field_1" />
|
<result property="spareField2" column="spare_field_2" />
|
<result property="spareField3" column="spare_field_3" />
|
<result property="spareField4" column="spare_field_4" />
|
</resultMap>
|
|
<sql id="selectEmEquipmentTypeVo">
|
select id, equipment_type_code, equipment_type_name, parent_type_id, ancestors, status, remark, create_user, create_time, update_user, update_time, spare_field_1, spare_field_2, spare_field_3, spare_field_4 from em_equipment_type
|
</sql>
|
|
<select id="selectEmEquipmentTypeList" parameterType="EmEquipmentType" resultMap="EmEquipmentTypeResult">
|
<include refid="selectEmEquipmentTypeVo"/>
|
<where>
|
<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>
|
</where>
|
</select>
|
|
<select id="selectEmEquipmentTypeById" parameterType="Long" resultMap="EmEquipmentTypeResult">
|
<include refid="selectEmEquipmentTypeVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertEmEquipmentType" parameterType="EmEquipmentType">
|
insert into em_equipment_type
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,</if>
|
<if test="equipmentTypeCode != null and equipmentTypeCode != ''">equipment_type_code,</if>
|
<if test="equipmentTypeName != null and equipmentTypeName != ''">equipment_type_name,</if>
|
<if test="parentTypeId != null">parent_type_id,</if>
|
<if test="ancestors != null and ancestors != ''">ancestors,</if>
|
<if test="status != null and status != ''">status,</if>
|
<if test="remark != null">remark,</if>
|
<if test="createUser != null">create_user,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="updateUser != null">update_user,</if>
|
<if test="updateTime != null">update_time,</if>
|
<if test="spareField1 != null">spare_field_1,</if>
|
<if test="spareField2 != null">spare_field_2,</if>
|
<if test="spareField3 != null">spare_field_3,</if>
|
<if test="spareField4 != null">spare_field_4,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id},</if>
|
<if test="equipmentTypeCode != null and equipmentTypeCode != ''">#{equipmentTypeCode},</if>
|
<if test="equipmentTypeName != null and equipmentTypeName != ''">#{equipmentTypeName},</if>
|
<if test="parentTypeId != null">#{parentTypeId},</if>
|
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
|
<if test="status != null and status != ''">#{status},</if>
|
<if test="remark != null">#{remark},</if>
|
<if test="createUser != null">#{createUser},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="updateUser != null">#{updateUser},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
<if test="spareField1 != null">#{spareField1},</if>
|
<if test="spareField2 != null">#{spareField2},</if>
|
<if test="spareField3 != null">#{spareField3},</if>
|
<if test="spareField4 != null">#{spareField4},</if>
|
</trim>
|
</insert>
|
|
<update id="updateEmEquipmentType" parameterType="EmEquipmentType">
|
update em_equipment_type
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="equipmentTypeCode != null and equipmentTypeCode != ''">equipment_type_code = #{equipmentTypeCode},</if>
|
<if test="equipmentTypeName != null and equipmentTypeName != ''">equipment_type_name = #{equipmentTypeName},</if>
|
<if test="parentTypeId != null">parent_type_id = #{parentTypeId},</if>
|
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
|
<if test="status != null and status != ''">status = #{status},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
<if test="createUser != null">create_user = #{createUser},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="updateUser != null">update_user = #{updateUser},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
|
<if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
|
<if test="spareField3 != null">spare_field_3 = #{spareField3},</if>
|
<if test="spareField4 != null">spare_field_4 = #{spareField4},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteEmEquipmentTypeById" parameterType="Long">
|
delete from em_equipment_type where id = #{id}
|
</delete>
|
|
<delete id="deleteEmEquipmentTypeByIds" parameterType="String">
|
delete from em_equipment_type where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|