EmployeeAbnormalStatisticMonthMapper.xml 15.8 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.zteits.park.mapper.EmployeeAbnormalStatisticMonthMapper">
  <resultMap id="BaseResultMap" type="com.zteits.park.domain.EmployeeAbnormalStatisticMonth">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="static_date" jdbcType="DATE" property="staticDate" />
    <result column="static_date_str" jdbcType="VARCHAR" property="staticDateStr" />
    <result column="org_id" jdbcType="INTEGER" property="orgId" />
    <result column="charger_code" jdbcType="VARCHAR" property="chargerCode" />
    <result column="charger_name" jdbcType="VARCHAR" property="chargerName" />
    <result column="earliest_time" jdbcType="TIMESTAMP" property="earliestTime" />
    <result column="thelatest_time" jdbcType="TIMESTAMP" property="thelatestTime" />
    <result column="total_points" jdbcType="INTEGER" property="totalPoints" />
    <result column="abnormal_times" jdbcType="INTEGER" property="abnormalTimes" />
    <result column="employee_abnormal_rate" jdbcType="DOUBLE" property="employeeAbnormalRate" />
    <result column="data_state" jdbcType="INTEGER" property="dataState" />
    <result column="create_op" jdbcType="VARCHAR" property="createOp" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="modify_op" jdbcType="VARCHAR" property="modifyOp" />
    <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
  </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, static_date, static_date_str, org_id, charger_code, charger_name, earliest_time, 
    thelatest_time, total_points, abnormal_times, employee_abnormal_rate, data_state, 
    create_op, create_time, modify_op, modify_time, remark
  </sql>
  <select id="selectByExample" parameterType="com.zteits.park.domain.EmployeeAbnormalStatisticMonthExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from employee_abnormal_statistic_month
    <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.Long" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from employee_abnormal_statistic_month
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from employee_abnormal_statistic_month
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.park.domain.EmployeeAbnormalStatisticMonthExample">
    delete from employee_abnormal_statistic_month
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.park.domain.EmployeeAbnormalStatisticMonth">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into employee_abnormal_statistic_month (static_date, static_date_str, org_id, 
      charger_code, charger_name, earliest_time, 
      thelatest_time, total_points, abnormal_times, 
      employee_abnormal_rate, data_state, create_op, 
      create_time, modify_op, modify_time, 
      remark)
    values (#{staticDate,jdbcType=DATE}, #{staticDateStr,jdbcType=VARCHAR}, #{orgId,jdbcType=INTEGER}, 
      #{chargerCode,jdbcType=VARCHAR}, #{chargerName,jdbcType=VARCHAR}, #{earliestTime,jdbcType=TIMESTAMP}, 
      #{thelatestTime,jdbcType=TIMESTAMP}, #{totalPoints,jdbcType=INTEGER}, #{abnormalTimes,jdbcType=INTEGER}, 
      #{employeeAbnormalRate,jdbcType=DOUBLE}, #{dataState,jdbcType=INTEGER}, #{createOp,jdbcType=VARCHAR}, 
      #{createTime,jdbcType=TIMESTAMP}, #{modifyOp,jdbcType=VARCHAR}, #{modifyTime,jdbcType=TIMESTAMP}, 
      #{remark,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.park.domain.EmployeeAbnormalStatisticMonth">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into employee_abnormal_statistic_month
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="staticDate != null">
        static_date,
      </if>
      <if test="staticDateStr != null">
        static_date_str,
      </if>
      <if test="orgId != null">
        org_id,
      </if>
      <if test="chargerCode != null">
        charger_code,
      </if>
      <if test="chargerName != null">
        charger_name,
      </if>
      <if test="earliestTime != null">
        earliest_time,
      </if>
      <if test="thelatestTime != null">
        thelatest_time,
      </if>
      <if test="totalPoints != null">
        total_points,
      </if>
      <if test="abnormalTimes != null">
        abnormal_times,
      </if>
      <if test="employeeAbnormalRate != null">
        employee_abnormal_rate,
      </if>
      <if test="dataState != null">
        data_state,
      </if>
      <if test="createOp != null">
        create_op,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="modifyOp != null">
        modify_op,
      </if>
      <if test="modifyTime != null">
        modify_time,
      </if>
      <if test="remark != null">
        remark,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="staticDate != null">
        #{staticDate,jdbcType=DATE},
      </if>
      <if test="staticDateStr != null">
        #{staticDateStr,jdbcType=VARCHAR},
      </if>
      <if test="orgId != null">
        #{orgId,jdbcType=INTEGER},
      </if>
      <if test="chargerCode != null">
        #{chargerCode,jdbcType=VARCHAR},
      </if>
      <if test="chargerName != null">
        #{chargerName,jdbcType=VARCHAR},
      </if>
      <if test="earliestTime != null">
        #{earliestTime,jdbcType=TIMESTAMP},
      </if>
      <if test="thelatestTime != null">
        #{thelatestTime,jdbcType=TIMESTAMP},
      </if>
      <if test="totalPoints != null">
        #{totalPoints,jdbcType=INTEGER},
      </if>
      <if test="abnormalTimes != null">
        #{abnormalTimes,jdbcType=INTEGER},
      </if>
      <if test="employeeAbnormalRate != null">
        #{employeeAbnormalRate,jdbcType=DOUBLE},
      </if>
      <if test="dataState != null">
        #{dataState,jdbcType=INTEGER},
      </if>
      <if test="createOp != null">
        #{createOp,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="modifyOp != null">
        #{modifyOp,jdbcType=VARCHAR},
      </if>
      <if test="modifyTime != null">
        #{modifyTime,jdbcType=TIMESTAMP},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.park.domain.EmployeeAbnormalStatisticMonthExample" resultType="java.lang.Long">
    select count(*) from employee_abnormal_statistic_month
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update employee_abnormal_statistic_month
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.staticDate != null">
        static_date = #{record.staticDate,jdbcType=DATE},
      </if>
      <if test="record.staticDateStr != null">
        static_date_str = #{record.staticDateStr,jdbcType=VARCHAR},
      </if>
      <if test="record.orgId != null">
        org_id = #{record.orgId,jdbcType=INTEGER},
      </if>
      <if test="record.chargerCode != null">
        charger_code = #{record.chargerCode,jdbcType=VARCHAR},
      </if>
      <if test="record.chargerName != null">
        charger_name = #{record.chargerName,jdbcType=VARCHAR},
      </if>
      <if test="record.earliestTime != null">
        earliest_time = #{record.earliestTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.thelatestTime != null">
        thelatest_time = #{record.thelatestTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.totalPoints != null">
        total_points = #{record.totalPoints,jdbcType=INTEGER},
      </if>
      <if test="record.abnormalTimes != null">
        abnormal_times = #{record.abnormalTimes,jdbcType=INTEGER},
      </if>
      <if test="record.employeeAbnormalRate != null">
        employee_abnormal_rate = #{record.employeeAbnormalRate,jdbcType=DOUBLE},
      </if>
      <if test="record.dataState != null">
        data_state = #{record.dataState,jdbcType=INTEGER},
      </if>
      <if test="record.createOp != null">
        create_op = #{record.createOp,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.modifyOp != null">
        modify_op = #{record.modifyOp,jdbcType=VARCHAR},
      </if>
      <if test="record.modifyTime != null">
        modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.remark != null">
        remark = #{record.remark,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update employee_abnormal_statistic_month
    set id = #{record.id,jdbcType=BIGINT},
      static_date = #{record.staticDate,jdbcType=DATE},
      static_date_str = #{record.staticDateStr,jdbcType=VARCHAR},
      org_id = #{record.orgId,jdbcType=INTEGER},
      charger_code = #{record.chargerCode,jdbcType=VARCHAR},
      charger_name = #{record.chargerName,jdbcType=VARCHAR},
      earliest_time = #{record.earliestTime,jdbcType=TIMESTAMP},
      thelatest_time = #{record.thelatestTime,jdbcType=TIMESTAMP},
      total_points = #{record.totalPoints,jdbcType=INTEGER},
      abnormal_times = #{record.abnormalTimes,jdbcType=INTEGER},
      employee_abnormal_rate = #{record.employeeAbnormalRate,jdbcType=DOUBLE},
      data_state = #{record.dataState,jdbcType=INTEGER},
      create_op = #{record.createOp,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      modify_op = #{record.modifyOp,jdbcType=VARCHAR},
      modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
      remark = #{record.remark,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.park.domain.EmployeeAbnormalStatisticMonth">
    update employee_abnormal_statistic_month
    <set>
      <if test="staticDate != null">
        static_date = #{staticDate,jdbcType=DATE},
      </if>
      <if test="staticDateStr != null">
        static_date_str = #{staticDateStr,jdbcType=VARCHAR},
      </if>
      <if test="orgId != null">
        org_id = #{orgId,jdbcType=INTEGER},
      </if>
      <if test="chargerCode != null">
        charger_code = #{chargerCode,jdbcType=VARCHAR},
      </if>
      <if test="chargerName != null">
        charger_name = #{chargerName,jdbcType=VARCHAR},
      </if>
      <if test="earliestTime != null">
        earliest_time = #{earliestTime,jdbcType=TIMESTAMP},
      </if>
      <if test="thelatestTime != null">
        thelatest_time = #{thelatestTime,jdbcType=TIMESTAMP},
      </if>
      <if test="totalPoints != null">
        total_points = #{totalPoints,jdbcType=INTEGER},
      </if>
      <if test="abnormalTimes != null">
        abnormal_times = #{abnormalTimes,jdbcType=INTEGER},
      </if>
      <if test="employeeAbnormalRate != null">
        employee_abnormal_rate = #{employeeAbnormalRate,jdbcType=DOUBLE},
      </if>
      <if test="dataState != null">
        data_state = #{dataState,jdbcType=INTEGER},
      </if>
      <if test="createOp != null">
        create_op = #{createOp,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="modifyOp != null">
        modify_op = #{modifyOp,jdbcType=VARCHAR},
      </if>
      <if test="modifyTime != null">
        modify_time = #{modifyTime,jdbcType=TIMESTAMP},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.park.domain.EmployeeAbnormalStatisticMonth">
    update employee_abnormal_statistic_month
    set static_date = #{staticDate,jdbcType=DATE},
      static_date_str = #{staticDateStr,jdbcType=VARCHAR},
      org_id = #{orgId,jdbcType=INTEGER},
      charger_code = #{chargerCode,jdbcType=VARCHAR},
      charger_name = #{chargerName,jdbcType=VARCHAR},
      earliest_time = #{earliestTime,jdbcType=TIMESTAMP},
      thelatest_time = #{thelatestTime,jdbcType=TIMESTAMP},
      total_points = #{totalPoints,jdbcType=INTEGER},
      abnormal_times = #{abnormalTimes,jdbcType=INTEGER},
      employee_abnormal_rate = #{employeeAbnormalRate,jdbcType=DOUBLE},
      data_state = #{dataState,jdbcType=INTEGER},
      create_op = #{createOp,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      modify_op = #{modifyOp,jdbcType=VARCHAR},
      modify_time = #{modifyTime,jdbcType=TIMESTAMP},
      remark = #{remark,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>