SysLoginLogMapper.xml 10.6 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.sys.mapper.SysLoginLogMapper">
  <resultMap id="BaseResultMap" type="com.zteits.sys.domain.SysLoginLog">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="login_code" jdbcType="VARCHAR" property="loginCode" />
    <result column="op_code" jdbcType="VARCHAR" property="opCode" />
    <result column="op_name" jdbcType="VARCHAR" property="opName" />
    <result column="org_id" jdbcType="BIGINT" property="orgId" />
    <result column="login_type" jdbcType="VARCHAR" property="loginType" />
    <result column="login_ip" jdbcType="VARCHAR" property="loginIp" />
    <result column="result_desc" jdbcType="VARCHAR" property="resultDesc" />
    <result column="data_state" jdbcType="INTEGER" property="dataState" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  </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, login_code, op_code, op_name, org_id, login_type, login_ip, result_desc, data_state, 
    create_date
  </sql>
  <select id="selectByExample" parameterType="com.zteits.sys.domain.SysLoginLogExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from sys_login_log
    <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 sys_login_log
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from sys_login_log
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.sys.domain.SysLoginLogExample">
    delete from sys_login_log
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.sys.domain.SysLoginLog">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into sys_login_log (login_code, op_code, op_name, 
      org_id, login_type, login_ip, 
      result_desc, data_state, create_date
      )
    values (#{loginCode,jdbcType=VARCHAR}, #{opCode,jdbcType=VARCHAR}, #{opName,jdbcType=VARCHAR}, 
      #{orgId,jdbcType=BIGINT}, #{loginType,jdbcType=VARCHAR}, #{loginIp,jdbcType=VARCHAR}, 
      #{resultDesc,jdbcType=VARCHAR}, #{dataState,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.sys.domain.SysLoginLog">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into sys_login_log
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="loginCode != null">
        login_code,
      </if>
      <if test="opCode != null">
        op_code,
      </if>
      <if test="opName != null">
        op_name,
      </if>
      <if test="orgId != null">
        org_id,
      </if>
      <if test="loginType != null">
        login_type,
      </if>
      <if test="loginIp != null">
        login_ip,
      </if>
      <if test="resultDesc != null">
        result_desc,
      </if>
      <if test="dataState != null">
        data_state,
      </if>
      <if test="createDate != null">
        create_date,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="loginCode != null">
        #{loginCode,jdbcType=VARCHAR},
      </if>
      <if test="opCode != null">
        #{opCode,jdbcType=VARCHAR},
      </if>
      <if test="opName != null">
        #{opName,jdbcType=VARCHAR},
      </if>
      <if test="orgId != null">
        #{orgId,jdbcType=BIGINT},
      </if>
      <if test="loginType != null">
        #{loginType,jdbcType=VARCHAR},
      </if>
      <if test="loginIp != null">
        #{loginIp,jdbcType=VARCHAR},
      </if>
      <if test="resultDesc != null">
        #{resultDesc,jdbcType=VARCHAR},
      </if>
      <if test="dataState != null">
        #{dataState,jdbcType=INTEGER},
      </if>
      <if test="createDate != null">
        #{createDate,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.sys.domain.SysLoginLogExample" resultType="java.lang.Long">
    select count(*) from sys_login_log
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update sys_login_log
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.loginCode != null">
        login_code = #{record.loginCode,jdbcType=VARCHAR},
      </if>
      <if test="record.opCode != null">
        op_code = #{record.opCode,jdbcType=VARCHAR},
      </if>
      <if test="record.opName != null">
        op_name = #{record.opName,jdbcType=VARCHAR},
      </if>
      <if test="record.orgId != null">
        org_id = #{record.orgId,jdbcType=BIGINT},
      </if>
      <if test="record.loginType != null">
        login_type = #{record.loginType,jdbcType=VARCHAR},
      </if>
      <if test="record.loginIp != null">
        login_ip = #{record.loginIp,jdbcType=VARCHAR},
      </if>
      <if test="record.resultDesc != null">
        result_desc = #{record.resultDesc,jdbcType=VARCHAR},
      </if>
      <if test="record.dataState != null">
        data_state = #{record.dataState,jdbcType=INTEGER},
      </if>
      <if test="record.createDate != null">
        create_date = #{record.createDate,jdbcType=TIMESTAMP},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update sys_login_log
    set id = #{record.id,jdbcType=BIGINT},
      login_code = #{record.loginCode,jdbcType=VARCHAR},
      op_code = #{record.opCode,jdbcType=VARCHAR},
      op_name = #{record.opName,jdbcType=VARCHAR},
      org_id = #{record.orgId,jdbcType=BIGINT},
      login_type = #{record.loginType,jdbcType=VARCHAR},
      login_ip = #{record.loginIp,jdbcType=VARCHAR},
      result_desc = #{record.resultDesc,jdbcType=VARCHAR},
      data_state = #{record.dataState,jdbcType=INTEGER},
      create_date = #{record.createDate,jdbcType=TIMESTAMP}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.sys.domain.SysLoginLog">
    update sys_login_log
    <set>
      <if test="loginCode != null">
        login_code = #{loginCode,jdbcType=VARCHAR},
      </if>
      <if test="opCode != null">
        op_code = #{opCode,jdbcType=VARCHAR},
      </if>
      <if test="opName != null">
        op_name = #{opName,jdbcType=VARCHAR},
      </if>
      <if test="orgId != null">
        org_id = #{orgId,jdbcType=BIGINT},
      </if>
      <if test="loginType != null">
        login_type = #{loginType,jdbcType=VARCHAR},
      </if>
      <if test="loginIp != null">
        login_ip = #{loginIp,jdbcType=VARCHAR},
      </if>
      <if test="resultDesc != null">
        result_desc = #{resultDesc,jdbcType=VARCHAR},
      </if>
      <if test="dataState != null">
        data_state = #{dataState,jdbcType=INTEGER},
      </if>
      <if test="createDate != null">
        create_date = #{createDate,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.sys.domain.SysLoginLog">
    update sys_login_log
    set login_code = #{loginCode,jdbcType=VARCHAR},
      op_code = #{opCode,jdbcType=VARCHAR},
      op_name = #{opName,jdbcType=VARCHAR},
      org_id = #{orgId,jdbcType=BIGINT},
      login_type = #{loginType,jdbcType=VARCHAR},
      login_ip = #{loginIp,jdbcType=VARCHAR},
      result_desc = #{resultDesc,jdbcType=VARCHAR},
      data_state = #{dataState,jdbcType=INTEGER},
      create_date = #{createDate,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>