DutyRosterGroupMapper.xml 12.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.park.mapper.DutyRosterGroupMapper">
  <resultMap id="BaseResultMap" type="com.zteits.park.domain.DutyRosterGroup">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="org_id" jdbcType="BIGINT" property="orgId" />
    <result column="plan_id" jdbcType="BIGINT" property="planId" />
    <result column="duty_type" jdbcType="INTEGER" property="dutyType" />
    <result column="group_id" jdbcType="BIGINT" property="groupId" />
    <result column="group_name" jdbcType="VARCHAR" property="groupName" />
    <result column="group_start_time" jdbcType="TIME" property="groupStartTime" />
    <result column="group_end_time" jdbcType="TIME" property="groupEndTime" />
    <result column="data_status" jdbcType="INTEGER" property="dataStatus" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="create_op" jdbcType="BIGINT" property="createOp" />
    <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime" />
    <result column="modify_op" jdbcType="BIGINT" property="modifyOp" />
  </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, org_id, plan_id, duty_type, group_id, group_name, group_start_time, group_end_time, 
    data_status, create_time, create_op, modify_time, modify_op
  </sql>
  <select id="selectByExample" parameterType="com.zteits.park.domain.DutyRosterGroupExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from duty_roster_group
    <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 duty_roster_group
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from duty_roster_group
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.park.domain.DutyRosterGroupExample">
    delete from duty_roster_group
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.park.domain.DutyRosterGroup">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into duty_roster_group (org_id, plan_id, duty_type, 
      group_id, group_name, group_start_time, 
      group_end_time, data_status, create_time, 
      create_op, modify_time, modify_op
      )
    values (#{orgId,jdbcType=BIGINT}, #{planId,jdbcType=BIGINT}, #{dutyType,jdbcType=INTEGER}, 
      #{groupId,jdbcType=BIGINT}, #{groupName,jdbcType=VARCHAR}, #{groupStartTime,jdbcType=TIME}, 
      #{groupEndTime,jdbcType=TIME}, #{dataStatus,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
      #{createOp,jdbcType=BIGINT}, #{modifyTime,jdbcType=TIMESTAMP}, #{modifyOp,jdbcType=BIGINT}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.park.domain.DutyRosterGroup">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into duty_roster_group
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="orgId != null">
        org_id,
      </if>
      <if test="planId != null">
        plan_id,
      </if>
      <if test="dutyType != null">
        duty_type,
      </if>
      <if test="groupId != null">
        group_id,
      </if>
      <if test="groupName != null">
        group_name,
      </if>
      <if test="groupStartTime != null">
        group_start_time,
      </if>
      <if test="groupEndTime != null">
        group_end_time,
      </if>
      <if test="dataStatus != null">
        data_status,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="createOp != null">
        create_op,
      </if>
      <if test="modifyTime != null">
        modify_time,
      </if>
      <if test="modifyOp != null">
        modify_op,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="orgId != null">
        #{orgId,jdbcType=BIGINT},
      </if>
      <if test="planId != null">
        #{planId,jdbcType=BIGINT},
      </if>
      <if test="dutyType != null">
        #{dutyType,jdbcType=INTEGER},
      </if>
      <if test="groupId != null">
        #{groupId,jdbcType=BIGINT},
      </if>
      <if test="groupName != null">
        #{groupName,jdbcType=VARCHAR},
      </if>
      <if test="groupStartTime != null">
        #{groupStartTime,jdbcType=TIME},
      </if>
      <if test="groupEndTime != null">
        #{groupEndTime,jdbcType=TIME},
      </if>
      <if test="dataStatus != null">
        #{dataStatus,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createOp != null">
        #{createOp,jdbcType=BIGINT},
      </if>
      <if test="modifyTime != null">
        #{modifyTime,jdbcType=TIMESTAMP},
      </if>
      <if test="modifyOp != null">
        #{modifyOp,jdbcType=BIGINT},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.park.domain.DutyRosterGroupExample" resultType="java.lang.Long">
    select count(*) from duty_roster_group
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update duty_roster_group
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.orgId != null">
        org_id = #{record.orgId,jdbcType=BIGINT},
      </if>
      <if test="record.planId != null">
        plan_id = #{record.planId,jdbcType=BIGINT},
      </if>
      <if test="record.dutyType != null">
        duty_type = #{record.dutyType,jdbcType=INTEGER},
      </if>
      <if test="record.groupId != null">
        group_id = #{record.groupId,jdbcType=BIGINT},
      </if>
      <if test="record.groupName != null">
        group_name = #{record.groupName,jdbcType=VARCHAR},
      </if>
      <if test="record.groupStartTime != null">
        group_start_time = #{record.groupStartTime,jdbcType=TIME},
      </if>
      <if test="record.groupEndTime != null">
        group_end_time = #{record.groupEndTime,jdbcType=TIME},
      </if>
      <if test="record.dataStatus != null">
        data_status = #{record.dataStatus,jdbcType=INTEGER},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createOp != null">
        create_op = #{record.createOp,jdbcType=BIGINT},
      </if>
      <if test="record.modifyTime != null">
        modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.modifyOp != null">
        modify_op = #{record.modifyOp,jdbcType=BIGINT},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update duty_roster_group
    set id = #{record.id,jdbcType=BIGINT},
      org_id = #{record.orgId,jdbcType=BIGINT},
      plan_id = #{record.planId,jdbcType=BIGINT},
      duty_type = #{record.dutyType,jdbcType=INTEGER},
      group_id = #{record.groupId,jdbcType=BIGINT},
      group_name = #{record.groupName,jdbcType=VARCHAR},
      group_start_time = #{record.groupStartTime,jdbcType=TIME},
      group_end_time = #{record.groupEndTime,jdbcType=TIME},
      data_status = #{record.dataStatus,jdbcType=INTEGER},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      create_op = #{record.createOp,jdbcType=BIGINT},
      modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
      modify_op = #{record.modifyOp,jdbcType=BIGINT}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.park.domain.DutyRosterGroup">
    update duty_roster_group
    <set>
      <if test="orgId != null">
        org_id = #{orgId,jdbcType=BIGINT},
      </if>
      <if test="planId != null">
        plan_id = #{planId,jdbcType=BIGINT},
      </if>
      <if test="dutyType != null">
        duty_type = #{dutyType,jdbcType=INTEGER},
      </if>
      <if test="groupId != null">
        group_id = #{groupId,jdbcType=BIGINT},
      </if>
      <if test="groupName != null">
        group_name = #{groupName,jdbcType=VARCHAR},
      </if>
      <if test="groupStartTime != null">
        group_start_time = #{groupStartTime,jdbcType=TIME},
      </if>
      <if test="groupEndTime != null">
        group_end_time = #{groupEndTime,jdbcType=TIME},
      </if>
      <if test="dataStatus != null">
        data_status = #{dataStatus,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createOp != null">
        create_op = #{createOp,jdbcType=BIGINT},
      </if>
      <if test="modifyTime != null">
        modify_time = #{modifyTime,jdbcType=TIMESTAMP},
      </if>
      <if test="modifyOp != null">
        modify_op = #{modifyOp,jdbcType=BIGINT},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.park.domain.DutyRosterGroup">
    update duty_roster_group
    set org_id = #{orgId,jdbcType=BIGINT},
      plan_id = #{planId,jdbcType=BIGINT},
      duty_type = #{dutyType,jdbcType=INTEGER},
      group_id = #{groupId,jdbcType=BIGINT},
      group_name = #{groupName,jdbcType=VARCHAR},
      group_start_time = #{groupStartTime,jdbcType=TIME},
      group_end_time = #{groupEndTime,jdbcType=TIME},
      data_status = #{dataStatus,jdbcType=INTEGER},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      create_op = #{createOp,jdbcType=BIGINT},
      modify_time = #{modifyTime,jdbcType=TIMESTAMP},
      modify_op = #{modifyOp,jdbcType=BIGINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>