AsraOpMapper.xml 15 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.oa.report.mapper.AsraOpMapper">
  <resultMap id="BaseResultMap" type="com.zteits.oa.report.domain.AsraOp">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="login_code" jdbcType="VARCHAR" property="loginCode" />
    <result column="login_password" jdbcType="VARCHAR" property="loginPassword" />
    <result column="op_name" jdbcType="VARCHAR" property="opName" />
    <result column="email" jdbcType="VARCHAR" property="email" />
    <result column="role_id" jdbcType="BIGINT" property="roleId" />
    <result column="city_id" jdbcType="BIGINT" property="cityId" />
    <result column="city_name" jdbcType="VARCHAR" property="cityName" />
    <result column="is_remind_email" jdbcType="INTEGER" property="isRemindEmail" />
    <result column="data_state" jdbcType="INTEGER" property="dataState" />
    <result column="create_empid" jdbcType="VARCHAR" property="createEmpid" />
    <result column="create_emp_name" jdbcType="VARCHAR" property="createEmpName" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
    <result column="modfiy_empid" jdbcType="VARCHAR" property="modfiyEmpid" />
    <result column="modfiy_emp_name" jdbcType="VARCHAR" property="modfiyEmpName" />
    <result column="modfiy_date" jdbcType="TIMESTAMP" property="modfiyDate" />
    <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, login_code, login_password, op_name, email, role_id, city_id, city_name, is_remind_email, 
    data_state, create_empid, create_emp_name, create_date, modfiy_empid, modfiy_emp_name, 
    modfiy_date, remark
  </sql>
  <select id="selectByExample" parameterType="com.zteits.oa.report.domain.AsraOpExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from asra_op
    <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 asra_op
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from asra_op
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.oa.report.domain.AsraOpExample">
    delete from asra_op
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.oa.report.domain.AsraOp">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into asra_op (login_code, login_password, op_name, 
      email, role_id, city_id, 
      city_name, is_remind_email, data_state, 
      create_empid, create_emp_name, create_date, 
      modfiy_empid, modfiy_emp_name, modfiy_date, 
      remark)
    values (#{loginCode,jdbcType=VARCHAR}, #{loginPassword,jdbcType=VARCHAR}, #{opName,jdbcType=VARCHAR}, 
      #{email,jdbcType=VARCHAR}, #{roleId,jdbcType=BIGINT}, #{cityId,jdbcType=BIGINT}, 
      #{cityName,jdbcType=VARCHAR}, #{isRemindEmail,jdbcType=INTEGER}, #{dataState,jdbcType=INTEGER}, 
      #{createEmpid,jdbcType=VARCHAR}, #{createEmpName,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, 
      #{modfiyEmpid,jdbcType=VARCHAR}, #{modfiyEmpName,jdbcType=VARCHAR}, #{modfiyDate,jdbcType=TIMESTAMP}, 
      #{remark,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.oa.report.domain.AsraOp">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into asra_op
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="loginCode != null">
        login_code,
      </if>
      <if test="loginPassword != null">
        login_password,
      </if>
      <if test="opName != null">
        op_name,
      </if>
      <if test="email != null">
        email,
      </if>
      <if test="roleId != null">
        role_id,
      </if>
      <if test="cityId != null">
        city_id,
      </if>
      <if test="cityName != null">
        city_name,
      </if>
      <if test="isRemindEmail != null">
        is_remind_email,
      </if>
      <if test="dataState != null">
        data_state,
      </if>
      <if test="createEmpid != null">
        create_empid,
      </if>
      <if test="createEmpName != null">
        create_emp_name,
      </if>
      <if test="createDate != null">
        create_date,
      </if>
      <if test="modfiyEmpid != null">
        modfiy_empid,
      </if>
      <if test="modfiyEmpName != null">
        modfiy_emp_name,
      </if>
      <if test="modfiyDate != null">
        modfiy_date,
      </if>
      <if test="remark != null">
        remark,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="loginCode != null">
        #{loginCode,jdbcType=VARCHAR},
      </if>
      <if test="loginPassword != null">
        #{loginPassword,jdbcType=VARCHAR},
      </if>
      <if test="opName != null">
        #{opName,jdbcType=VARCHAR},
      </if>
      <if test="email != null">
        #{email,jdbcType=VARCHAR},
      </if>
      <if test="roleId != null">
        #{roleId,jdbcType=BIGINT},
      </if>
      <if test="cityId != null">
        #{cityId,jdbcType=BIGINT},
      </if>
      <if test="cityName != null">
        #{cityName,jdbcType=VARCHAR},
      </if>
      <if test="isRemindEmail != null">
        #{isRemindEmail,jdbcType=INTEGER},
      </if>
      <if test="dataState != null">
        #{dataState,jdbcType=INTEGER},
      </if>
      <if test="createEmpid != null">
        #{createEmpid,jdbcType=VARCHAR},
      </if>
      <if test="createEmpName != null">
        #{createEmpName,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="modfiyEmpid != null">
        #{modfiyEmpid,jdbcType=VARCHAR},
      </if>
      <if test="modfiyEmpName != null">
        #{modfiyEmpName,jdbcType=VARCHAR},
      </if>
      <if test="modfiyDate != null">
        #{modfiyDate,jdbcType=TIMESTAMP},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.oa.report.domain.AsraOpExample" resultType="java.lang.Long">
    select count(*) from asra_op
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update asra_op
    <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.loginPassword != null">
        login_password = #{record.loginPassword,jdbcType=VARCHAR},
      </if>
      <if test="record.opName != null">
        op_name = #{record.opName,jdbcType=VARCHAR},
      </if>
      <if test="record.email != null">
        email = #{record.email,jdbcType=VARCHAR},
      </if>
      <if test="record.roleId != null">
        role_id = #{record.roleId,jdbcType=BIGINT},
      </if>
      <if test="record.cityId != null">
        city_id = #{record.cityId,jdbcType=BIGINT},
      </if>
      <if test="record.cityName != null">
        city_name = #{record.cityName,jdbcType=VARCHAR},
      </if>
      <if test="record.isRemindEmail != null">
        is_remind_email = #{record.isRemindEmail,jdbcType=INTEGER},
      </if>
      <if test="record.dataState != null">
        data_state = #{record.dataState,jdbcType=INTEGER},
      </if>
      <if test="record.createEmpid != null">
        create_empid = #{record.createEmpid,jdbcType=VARCHAR},
      </if>
      <if test="record.createEmpName != null">
        create_emp_name = #{record.createEmpName,jdbcType=VARCHAR},
      </if>
      <if test="record.createDate != null">
        create_date = #{record.createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.modfiyEmpid != null">
        modfiy_empid = #{record.modfiyEmpid,jdbcType=VARCHAR},
      </if>
      <if test="record.modfiyEmpName != null">
        modfiy_emp_name = #{record.modfiyEmpName,jdbcType=VARCHAR},
      </if>
      <if test="record.modfiyDate != null">
        modfiy_date = #{record.modfiyDate,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 asra_op
    set id = #{record.id,jdbcType=BIGINT},
      login_code = #{record.loginCode,jdbcType=VARCHAR},
      login_password = #{record.loginPassword,jdbcType=VARCHAR},
      op_name = #{record.opName,jdbcType=VARCHAR},
      email = #{record.email,jdbcType=VARCHAR},
      role_id = #{record.roleId,jdbcType=BIGINT},
      city_id = #{record.cityId,jdbcType=BIGINT},
      city_name = #{record.cityName,jdbcType=VARCHAR},
      is_remind_email = #{record.isRemindEmail,jdbcType=INTEGER},
      data_state = #{record.dataState,jdbcType=INTEGER},
      create_empid = #{record.createEmpid,jdbcType=VARCHAR},
      create_emp_name = #{record.createEmpName,jdbcType=VARCHAR},
      create_date = #{record.createDate,jdbcType=TIMESTAMP},
      modfiy_empid = #{record.modfiyEmpid,jdbcType=VARCHAR},
      modfiy_emp_name = #{record.modfiyEmpName,jdbcType=VARCHAR},
      modfiy_date = #{record.modfiyDate,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.oa.report.domain.AsraOp">
    update asra_op
    <set>
      <if test="loginCode != null">
        login_code = #{loginCode,jdbcType=VARCHAR},
      </if>
      <if test="loginPassword != null">
        login_password = #{loginPassword,jdbcType=VARCHAR},
      </if>
      <if test="opName != null">
        op_name = #{opName,jdbcType=VARCHAR},
      </if>
      <if test="email != null">
        email = #{email,jdbcType=VARCHAR},
      </if>
      <if test="roleId != null">
        role_id = #{roleId,jdbcType=BIGINT},
      </if>
      <if test="cityId != null">
        city_id = #{cityId,jdbcType=BIGINT},
      </if>
      <if test="cityName != null">
        city_name = #{cityName,jdbcType=VARCHAR},
      </if>
      <if test="isRemindEmail != null">
        is_remind_email = #{isRemindEmail,jdbcType=INTEGER},
      </if>
      <if test="dataState != null">
        data_state = #{dataState,jdbcType=INTEGER},
      </if>
      <if test="createEmpid != null">
        create_empid = #{createEmpid,jdbcType=VARCHAR},
      </if>
      <if test="createEmpName != null">
        create_emp_name = #{createEmpName,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        create_date = #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="modfiyEmpid != null">
        modfiy_empid = #{modfiyEmpid,jdbcType=VARCHAR},
      </if>
      <if test="modfiyEmpName != null">
        modfiy_emp_name = #{modfiyEmpName,jdbcType=VARCHAR},
      </if>
      <if test="modfiyDate != null">
        modfiy_date = #{modfiyDate,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.oa.report.domain.AsraOp">
    update asra_op
    set login_code = #{loginCode,jdbcType=VARCHAR},
      login_password = #{loginPassword,jdbcType=VARCHAR},
      op_name = #{opName,jdbcType=VARCHAR},
      email = #{email,jdbcType=VARCHAR},
      role_id = #{roleId,jdbcType=BIGINT},
      city_id = #{cityId,jdbcType=BIGINT},
      city_name = #{cityName,jdbcType=VARCHAR},
      is_remind_email = #{isRemindEmail,jdbcType=INTEGER},
      data_state = #{dataState,jdbcType=INTEGER},
      create_empid = #{createEmpid,jdbcType=VARCHAR},
      create_emp_name = #{createEmpName,jdbcType=VARCHAR},
      create_date = #{createDate,jdbcType=TIMESTAMP},
      modfiy_empid = #{modfiyEmpid,jdbcType=VARCHAR},
      modfiy_emp_name = #{modfiyEmpName,jdbcType=VARCHAR},
      modfiy_date = #{modfiyDate,jdbcType=TIMESTAMP},
      remark = #{remark,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>