|
|
@@ -0,0 +1,105 @@
|
|
|
+<?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.ktg.iscs.mapper.IsLockTypeMapper">
|
|
|
+
|
|
|
+ <resultMap type="IsLockType" id="IsLockTypeResult">
|
|
|
+ <result property="lockTypeId" column="lock_type_id" />
|
|
|
+ <result property="lockTypeCode" column="lock_type_code" />
|
|
|
+ <result property="lockTypeName" column="lock_type_name" />
|
|
|
+ <result property="lockTypeDescription" column="lock_type_description" />
|
|
|
+ <result property="lockTypeIcon" column="lock_type_icon" />
|
|
|
+ <result property="lockTypeImg" column="lock_type_img" />
|
|
|
+ <result property="hardwareTypeId" column="hardware_type_id" />
|
|
|
+ <result property="remark" column="remark" />
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectIsLockTypeVo">
|
|
|
+ select lock_type_id, lock_type_code, lock_type_name, lock_type_description, lock_type_icon, lock_type_img, hardware_type_id, remark, del_flag, create_by, create_time, update_time, update_by from is_lock_type
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectIsLockTypeList" parameterType="IsLockType" resultMap="IsLockTypeResult">
|
|
|
+ <include refid="selectIsLockTypeVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="lockTypeCode != null and lockTypeCode != ''"> and lock_type_code = #{lockTypeCode}</if>
|
|
|
+ <if test="lockTypeName != null and lockTypeName != ''"> and lock_type_name like concat('%', #{lockTypeName}, '%')</if>
|
|
|
+ <if test="lockTypeDescription != null and lockTypeDescription != ''"> and lock_type_description = #{lockTypeDescription}</if>
|
|
|
+ <if test="lockTypeIcon != null and lockTypeIcon != ''"> and lock_type_icon = #{lockTypeIcon}</if>
|
|
|
+ <if test="lockTypeImg != null and lockTypeImg != ''"> and lock_type_img = #{lockTypeImg}</if>
|
|
|
+ <if test="hardwareTypeId != null "> and hardware_type_id = #{hardwareTypeId}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectIsLockTypeByLockTypeId" parameterType="Long" resultMap="IsLockTypeResult">
|
|
|
+ <include refid="selectIsLockTypeVo"/>
|
|
|
+ where lock_type_id = #{lockTypeId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertIsLockType" parameterType="IsLockType" useGeneratedKeys="true" keyProperty="lockTypeId">
|
|
|
+ insert into is_lock_type
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="lockTypeCode != null and lockTypeCode != ''">lock_type_code,</if>
|
|
|
+ <if test="lockTypeName != null and lockTypeName != ''">lock_type_name,</if>
|
|
|
+ <if test="lockTypeDescription != null">lock_type_description,</if>
|
|
|
+ <if test="lockTypeIcon != null">lock_type_icon,</if>
|
|
|
+ <if test="lockTypeImg != null">lock_type_img,</if>
|
|
|
+ <if test="hardwareTypeId != null">hardware_type_id,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ <if test="delFlag != null">del_flag,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="lockTypeCode != null and lockTypeCode != ''">#{lockTypeCode},</if>
|
|
|
+ <if test="lockTypeName != null and lockTypeName != ''">#{lockTypeName},</if>
|
|
|
+ <if test="lockTypeDescription != null">#{lockTypeDescription},</if>
|
|
|
+ <if test="lockTypeIcon != null">#{lockTypeIcon},</if>
|
|
|
+ <if test="lockTypeImg != null">#{lockTypeImg},</if>
|
|
|
+ <if test="hardwareTypeId != null">#{hardwareTypeId},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ <if test="delFlag != null">#{delFlag},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateIsLockType" parameterType="IsLockType">
|
|
|
+ update is_lock_type
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="lockTypeCode != null and lockTypeCode != ''">lock_type_code = #{lockTypeCode},</if>
|
|
|
+ <if test="lockTypeName != null and lockTypeName != ''">lock_type_name = #{lockTypeName},</if>
|
|
|
+ <if test="lockTypeDescription != null">lock_type_description = #{lockTypeDescription},</if>
|
|
|
+ <if test="lockTypeIcon != null">lock_type_icon = #{lockTypeIcon},</if>
|
|
|
+ <if test="lockTypeImg != null">lock_type_img = #{lockTypeImg},</if>
|
|
|
+ <if test="hardwareTypeId != null">hardware_type_id = #{hardwareTypeId},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ <if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ </trim>
|
|
|
+ where lock_type_id = #{lockTypeId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteIsLockTypeByLockTypeId" parameterType="Long">
|
|
|
+ delete from is_lock_type where lock_type_id = #{lockTypeId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteIsLockTypeByLockTypeIds" parameterType="String">
|
|
|
+ delete from is_lock_type where lock_type_id in
|
|
|
+ <foreach item="lockTypeId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{lockTypeId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|