123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354 |
- <?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.mvc.dao.BatteryAccMapper">
- <resultMap id="BaseResultMap" type="com.mvc.entity.BatteryAcc">
- <id column="ID" jdbcType="INTEGER" property="id" />
- <result column="BAT_CODE" jdbcType="VARCHAR" property="batCode" />
- <result column="DELIVERY_TIME" jdbcType="TIMESTAMP" property="deliveryTime" />
- <result column="FIRST_USE_TIME" jdbcType="TIMESTAMP" property="firstUseTime" />
- <result column="BAT_MODEL" jdbcType="VARCHAR" property="batModel" />
- <result column="MANUFACTURER" jdbcType="VARCHAR" property="manufacturer" />
- <result column="BAT_CAPACITY" jdbcType="INTEGER" property="batCapacity" />
- <result column="LAST_WORKING_VOLTAGE" jdbcType="DECIMAL" property="lastWorkingVoltage" />
- <result column="BAT_RUM_TIME" jdbcType="INTEGER" property="batRumTime" />
- <result column="BAT_RUN_NUM" jdbcType="INTEGER" property="batRunNum" />
- <result column="BAT_STATUS" jdbcType="CHAR" property="batStatus" />
- <result column="STATUS_UPDATE_TIME" jdbcType="TIMESTAMP" property="statusUpdateTime" />
- <result column="CREATE_MAN" jdbcType="VARCHAR" property="createMan" />
- <result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
- </resultMap>
- <sql id="Example_Where_Clause">
- <where>
- <foreach collection="oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Update_By_Example_Where_Clause">
- <where>
- <foreach collection="example.oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Base_Column_List">
- ID, BAT_CODE, DELIVERY_TIME, FIRST_USE_TIME, BAT_MODEL, MANUFACTURER, BAT_CAPACITY,
- LAST_WORKING_VOLTAGE, BAT_RUM_TIME, BAT_RUN_NUM, BAT_STATUS, STATUS_UPDATE_TIME,
- CREATE_MAN, CREATE_TIME
- </sql>
- <select id="selectByExample" parameterType="com.mvc.entity.BatteryAccExample" resultMap="BaseResultMap">
- select
- <if test="distinct">
- distinct
- </if>
- <include refid="Base_Column_List" />
- from battery_acc
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- <if test="orderByClause != null">
- order by ${orderByClause}
- </if>
- </select>
- <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from battery_acc
- where ID = #{id,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
- delete from battery_acc
- where ID = #{id,jdbcType=INTEGER}
- </delete>
- <delete id="deleteByExample" parameterType="com.mvc.entity.BatteryAccExample">
- delete from battery_acc
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </delete>
- <insert id="insert" parameterType="com.mvc.entity.BatteryAcc">
- insert into battery_acc (ID, BAT_CODE, DELIVERY_TIME,
- FIRST_USE_TIME, BAT_MODEL, MANUFACTURER,
- BAT_CAPACITY, LAST_WORKING_VOLTAGE, BAT_RUM_TIME,
- BAT_RUN_NUM, BAT_STATUS, STATUS_UPDATE_TIME,
- CREATE_MAN, CREATE_TIME)
- values (#{id,jdbcType=INTEGER}, #{batCode,jdbcType=VARCHAR}, #{deliveryTime,jdbcType=TIMESTAMP},
- #{firstUseTime,jdbcType=TIMESTAMP}, #{batModel,jdbcType=VARCHAR}, #{manufacturer,jdbcType=VARCHAR},
- #{batCapacity,jdbcType=INTEGER}, #{lastWorkingVoltage,jdbcType=DECIMAL}, #{batRumTime,jdbcType=INTEGER},
- #{batRunNum,jdbcType=INTEGER}, #{batStatus,jdbcType=CHAR}, #{statusUpdateTime,jdbcType=TIMESTAMP},
- #{createMan,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})
- </insert>
- <insert id="insertSelective" parameterType="com.mvc.entity.BatteryAcc">
- insert into battery_acc
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- ID,
- </if>
- <if test="batCode != null">
- BAT_CODE,
- </if>
- <if test="deliveryTime != null">
- DELIVERY_TIME,
- </if>
- <if test="firstUseTime != null">
- FIRST_USE_TIME,
- </if>
- <if test="batModel != null">
- BAT_MODEL,
- </if>
- <if test="manufacturer != null">
- MANUFACTURER,
- </if>
- <if test="batCapacity != null">
- BAT_CAPACITY,
- </if>
- <if test="lastWorkingVoltage != null">
- LAST_WORKING_VOLTAGE,
- </if>
- <if test="batRumTime != null">
- BAT_RUM_TIME,
- </if>
- <if test="batRunNum != null">
- BAT_RUN_NUM,
- </if>
- <if test="batStatus != null">
- BAT_STATUS,
- </if>
- <if test="statusUpdateTime != null">
- STATUS_UPDATE_TIME,
- </if>
- <if test="createMan != null">
- CREATE_MAN,
- </if>
- <if test="createTime != null">
- CREATE_TIME,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=INTEGER},
- </if>
- <if test="batCode != null">
- #{batCode,jdbcType=VARCHAR},
- </if>
- <if test="deliveryTime != null">
- #{deliveryTime,jdbcType=TIMESTAMP},
- </if>
- <if test="firstUseTime != null">
- #{firstUseTime,jdbcType=TIMESTAMP},
- </if>
- <if test="batModel != null">
- #{batModel,jdbcType=VARCHAR},
- </if>
- <if test="manufacturer != null">
- #{manufacturer,jdbcType=VARCHAR},
- </if>
- <if test="batCapacity != null">
- #{batCapacity,jdbcType=INTEGER},
- </if>
- <if test="lastWorkingVoltage != null">
- #{lastWorkingVoltage,jdbcType=DECIMAL},
- </if>
- <if test="batRumTime != null">
- #{batRumTime,jdbcType=INTEGER},
- </if>
- <if test="batRunNum != null">
- #{batRunNum,jdbcType=INTEGER},
- </if>
- <if test="batStatus != null">
- #{batStatus,jdbcType=CHAR},
- </if>
- <if test="statusUpdateTime != null">
- #{statusUpdateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="createMan != null">
- #{createMan,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <select id="countByExample" parameterType="com.mvc.entity.BatteryAccExample" resultType="java.lang.Long">
- select count(*) from battery_acc
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </select>
- <update id="updateByExampleSelective" parameterType="map">
- update battery_acc
- <set>
- <if test="record.id != null">
- ID = #{record.id,jdbcType=INTEGER},
- </if>
- <if test="record.batCode != null">
- BAT_CODE = #{record.batCode,jdbcType=VARCHAR},
- </if>
- <if test="record.deliveryTime != null">
- DELIVERY_TIME = #{record.deliveryTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.firstUseTime != null">
- FIRST_USE_TIME = #{record.firstUseTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.batModel != null">
- BAT_MODEL = #{record.batModel,jdbcType=VARCHAR},
- </if>
- <if test="record.manufacturer != null">
- MANUFACTURER = #{record.manufacturer,jdbcType=VARCHAR},
- </if>
- <if test="record.batCapacity != null">
- BAT_CAPACITY = #{record.batCapacity,jdbcType=INTEGER},
- </if>
- <if test="record.lastWorkingVoltage != null">
- LAST_WORKING_VOLTAGE = #{record.lastWorkingVoltage,jdbcType=DECIMAL},
- </if>
- <if test="record.batRumTime != null">
- BAT_RUM_TIME = #{record.batRumTime,jdbcType=INTEGER},
- </if>
- <if test="record.batRunNum != null">
- BAT_RUN_NUM = #{record.batRunNum,jdbcType=INTEGER},
- </if>
- <if test="record.batStatus != null">
- BAT_STATUS = #{record.batStatus,jdbcType=CHAR},
- </if>
- <if test="record.statusUpdateTime != null">
- STATUS_UPDATE_TIME = #{record.statusUpdateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.createMan != null">
- CREATE_MAN = #{record.createMan,jdbcType=VARCHAR},
- </if>
- <if test="record.createTime != null">
- CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP},
- </if>
- </set>
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByExample" parameterType="map">
- update battery_acc
- set ID = #{record.id,jdbcType=INTEGER},
- BAT_CODE = #{record.batCode,jdbcType=VARCHAR},
- DELIVERY_TIME = #{record.deliveryTime,jdbcType=TIMESTAMP},
- FIRST_USE_TIME = #{record.firstUseTime,jdbcType=TIMESTAMP},
- BAT_MODEL = #{record.batModel,jdbcType=VARCHAR},
- MANUFACTURER = #{record.manufacturer,jdbcType=VARCHAR},
- BAT_CAPACITY = #{record.batCapacity,jdbcType=INTEGER},
- LAST_WORKING_VOLTAGE = #{record.lastWorkingVoltage,jdbcType=DECIMAL},
- BAT_RUM_TIME = #{record.batRumTime,jdbcType=INTEGER},
- BAT_RUN_NUM = #{record.batRunNum,jdbcType=INTEGER},
- BAT_STATUS = #{record.batStatus,jdbcType=CHAR},
- STATUS_UPDATE_TIME = #{record.statusUpdateTime,jdbcType=TIMESTAMP},
- CREATE_MAN = #{record.createMan,jdbcType=VARCHAR},
- CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP}
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.mvc.entity.BatteryAcc">
- update battery_acc
- <set>
- <if test="batCode != null">
- BAT_CODE = #{batCode,jdbcType=VARCHAR},
- </if>
- <if test="deliveryTime != null">
- DELIVERY_TIME = #{deliveryTime,jdbcType=TIMESTAMP},
- </if>
- <if test="firstUseTime != null">
- FIRST_USE_TIME = #{firstUseTime,jdbcType=TIMESTAMP},
- </if>
- <if test="batModel != null">
- BAT_MODEL = #{batModel,jdbcType=VARCHAR},
- </if>
- <if test="manufacturer != null">
- MANUFACTURER = #{manufacturer,jdbcType=VARCHAR},
- </if>
- <if test="batCapacity != null">
- BAT_CAPACITY = #{batCapacity,jdbcType=INTEGER},
- </if>
- <if test="lastWorkingVoltage != null">
- LAST_WORKING_VOLTAGE = #{lastWorkingVoltage,jdbcType=DECIMAL},
- </if>
- <if test="batRumTime != null">
- BAT_RUM_TIME = #{batRumTime,jdbcType=INTEGER},
- </if>
- <if test="batRunNum != null">
- BAT_RUN_NUM = #{batRunNum,jdbcType=INTEGER},
- </if>
- <if test="batStatus != null">
- BAT_STATUS = #{batStatus,jdbcType=CHAR},
- </if>
- <if test="statusUpdateTime != null">
- STATUS_UPDATE_TIME = #{statusUpdateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="createMan != null">
- CREATE_MAN = #{createMan,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
- </if>
- </set>
- where ID = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.mvc.entity.BatteryAcc">
- update battery_acc
- set BAT_CODE = #{batCode,jdbcType=VARCHAR},
- DELIVERY_TIME = #{deliveryTime,jdbcType=TIMESTAMP},
- FIRST_USE_TIME = #{firstUseTime,jdbcType=TIMESTAMP},
- BAT_MODEL = #{batModel,jdbcType=VARCHAR},
- MANUFACTURER = #{manufacturer,jdbcType=VARCHAR},
- BAT_CAPACITY = #{batCapacity,jdbcType=INTEGER},
- LAST_WORKING_VOLTAGE = #{lastWorkingVoltage,jdbcType=DECIMAL},
- BAT_RUM_TIME = #{batRumTime,jdbcType=INTEGER},
- BAT_RUN_NUM = #{batRunNum,jdbcType=INTEGER},
- BAT_STATUS = #{batStatus,jdbcType=CHAR},
- STATUS_UPDATE_TIME = #{statusUpdateTime,jdbcType=TIMESTAMP},
- CREATE_MAN = #{createMan,jdbcType=VARCHAR},
- CREATE_TIME = #{createTime,jdbcType=TIMESTAMP}
- where ID = #{id,jdbcType=INTEGER}
- </update>
- </mapper>
|