KeyInfoMapper.xml 5.88 KB
<?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.mapper.key.info.KeyInfoMapper">
    <resultMap id="BaseResultMap" type="com.ruoyi.domain.key.info.KeyInfo">
        <id column="id" jdbcType="INTEGER" property="id"/>
        <result column="name" jdbcType="VARCHAR" property="name"/>
        <result column="status" jdbcType="INTEGER" property="status"/>
        <result column="del_flag" jdbcType="BIT" property="delFlag"/>
        <result column="create_By" jdbcType="INTEGER" property="createBy"/>
        <result column="create_Time" jdbcType="TIMESTAMP" property="createTime"/>
        <result column="updateBy" jdbcType="INTEGER" property="updateby"/>
        <result column="update_Time" jdbcType="TIMESTAMP" property="updateTime"/>
        <result column="yard_Id" jdbcType="INTEGER" property="yardId"/>
        <result column="device_id" jdbcType="INTEGER" property="deviceId"/>
        <result column="cabinetNo" jdbcType="INTEGER" property="cabinetno"/>
        <result column="plate_Num" jdbcType="VARCHAR" property="plateNum"/>
    </resultMap>

    <insert id="insertSelective" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
            parameterType="com.ruoyi.domain.key.info.KeyInfo">
        INSERT INTO key_info <include refid="insertSelectiveColumn"></include>
        <include refid="insertSelectiveValue"></include>
    </insert>

    <sql id="columns">
        id
        ,  name   ,  status   ,  del_flag   ,  create_By   ,  create_Time   ,  updateBy   ,  update_Time   ,  yard_Id   ,  device_id   ,  cabinetNo   ,  plate_Num
    </sql>

    <sql id="insert_columns">
        id
        ,  name  ,  status  ,  del_flag  ,  create_By  ,  create_Time  ,  updateBy  ,  update_Time  ,  yard_Id  ,  device_id  ,  cabinetNo  ,  plate_Num
    </sql>

    <sql id="insert_values">
        #{id}
        ,
        #{name},
        #{status},
        #{delFlag},
        #{createBy},
        #{createTime},
        #{updateby},
        #{updateTime},
        #{yardId},
        #{deviceId},
        #{cabinetno},
        #{plateNum}
    </sql>

    <sql id="insertSelectiveColumn">
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="null!=id">id,</if>
            <if test="null!=name">name,</if>
            <if test="null!=status">status,</if>
            <if test="null!=delFlag">del_flag,</if>
            <if test="null!=createBy">create_By,</if>
            <if test="null!=createTime">create_Time,</if>
            <if test="null!=updateby">updateBy,</if>
            <if test="null!=updateTime">update_Time,</if>
            <if test="null!=yardId">yard_Id,</if>
            <if test="null!=deviceId">device_id,</if>
            <if test="null!=cabinetno">cabinetNo,</if>
            <if test="null!=plateNum">plate_Num,</if>
        </trim>
    </sql>

    <sql id="insertSelectiveValue">
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="null!=id">#{id,jdbcType=INTEGER},</if>
            <if test="null!=name">#{name,jdbcType=VARCHAR},</if>
            <if test="null!=status">#{status,jdbcType=INTEGER},</if>
            <if test="null!=delFlag">#{delFlag,jdbcType=BIT},</if>
            <if test="null!=createBy">#{createBy,jdbcType=INTEGER},</if>
            <if test="null!=createTime">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="null!=updateby">#{updateby,jdbcType=INTEGER},</if>
            <if test="null!=updateTime">#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="null!=yardId">#{yardId,jdbcType=INTEGER},</if>
            <if test="null!=deviceId">#{deviceId,jdbcType=INTEGER},</if>
            <if test="null!=cabinetno">#{cabinetno,jdbcType=INTEGER},</if>
            <if test="null!=plateNum">#{plateNum,jdbcType=VARCHAR},</if>
        </trim>
    </sql>

    <sql id="updateByPrimaryKeySelectiveSql">
        <set>
            <if test="null!=id">id = #{id,jdbcType=INTEGER},</if>
            <if test="null!=name">name = #{name,jdbcType=VARCHAR},</if>
            <if test="null!=status">status = #{status,jdbcType=INTEGER},</if>
            <if test="null!=delFlag">del_flag = #{delFlag,jdbcType=BIT},</if>
            <if test="null!=createBy">create_By = #{createBy,jdbcType=INTEGER},</if>
            <if test="null!=createTime">create_Time = #{createTime,jdbcType=TIMESTAMP},</if>
            <if test="null!=updateby">updateBy = #{updateby,jdbcType=INTEGER},</if>
            <if test="null!=updateTime">update_Time = #{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="null!=yardId">yard_Id = #{yardId,jdbcType=INTEGER},</if>
            <if test="null!=deviceId">device_id = #{deviceId,jdbcType=INTEGER},</if>
            <if test="null!=cabinetno">cabinetNo = #{cabinetno,jdbcType=INTEGER},</if>
            <if test="null!=plateNum">plate_Num = #{plateNum,jdbcType=VARCHAR},</if>
        </set>
    </sql>

    <sql id="where">
        <if test="null!=id">AND id = #{id,jdbcType=INTEGER},</if>
        <if test="null!=name">AND name = #{name,jdbcType=VARCHAR},</if>
        <if test="null!=status">AND status = #{status,jdbcType=INTEGER},</if>
        <if test="null!=delFlag">AND del_flag = #{delFlag,jdbcType=BIT},</if>
        <if test="null!=createBy">AND create_By = #{createBy,jdbcType=INTEGER},</if>
        <if test="null!=createTime">AND create_Time = #{createTime,jdbcType=TIMESTAMP},</if>
        <if test="null!=updateby">AND updateBy = #{updateby,jdbcType=INTEGER},</if>
        <if test="null!=updateTime">AND update_Time = #{updateTime,jdbcType=TIMESTAMP},</if>
        <if test="null!=yardId">AND yard_Id = #{yardId,jdbcType=INTEGER},</if>
        <if test="null!=deviceId">AND device_id = #{deviceId,jdbcType=INTEGER},</if>
        <if test="null!=cabinetno">AND cabinetNo = #{cabinetno,jdbcType=INTEGER},</if>
        <if test="null!=plateNum">AND plate_Num = #{plateNum,jdbcType=VARCHAR},</if>
    </sql>
</mapper>