<?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.ruoyi.system.mapper.zb.ZbWeekReportMapper">
  <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.zb.ZbWeekReport">
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="title" jdbcType="VARCHAR" property="title" />
    <result column="start_date" jdbcType="DATE" property="startDate" />
    <result column="end_date" jdbcType="DATE" property="endDate" />
    <result column="week" jdbcType="VARCHAR" property="week" />
    <result column="year" jdbcType="VARCHAR" property="year" />
    <result column="leader_fill_flag" jdbcType="TINYINT" property="leaderFillFlag" />
    <result column="show_flag" jdbcType="TINYINT" property="showFlag" />
    <result column="type" jdbcType="VARCHAR" property="type" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="create_user" jdbcType="VARCHAR" property="createUser" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="update_user" jdbcType="VARCHAR" property="updateUser" />
    <result column="fill_count" jdbcType="INTEGER" property="fillCount" />
    <result column="valid" jdbcType="TINYINT" property="valid" />
    <result column="status" jdbcType="INTEGER" property="status" />
    <result column="dict_id" jdbcType="VARCHAR" property="dictId" />
  </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, title, start_date, end_date, week, year, leader_fill_flag, show_flag, type, create_time, 
    create_user, update_time, update_user, fill_count, valid, status, dict_id
  </sql>
  <select id="selectByExample" parameterType="com.ruoyi.system.domain.zb.ZbWeekReportExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from zb_week_report
    <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.String" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from zb_week_report
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from zb_week_report
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.ruoyi.system.domain.zb.ZbWeekReportExample">
    delete from zb_week_report
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.ruoyi.system.domain.zb.ZbWeekReport">
    insert into zb_week_report (id, title, start_date, 
      end_date, week, year, leader_fill_flag, 
      show_flag, type, create_time, 
      create_user, update_time, update_user, 
      fill_count, valid, status, 
      dict_id)
    values (#{id,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{startDate,jdbcType=DATE}, 
      #{endDate,jdbcType=DATE}, #{week,jdbcType=VARCHAR}, #{year,jdbcType=VARCHAR}, #{leaderFillFlag,jdbcType=TINYINT}, 
      #{showFlag,jdbcType=TINYINT}, #{type,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
      #{createUser,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=VARCHAR}, 
      #{fillCount,jdbcType=INTEGER}, #{valid,jdbcType=TINYINT}, #{status,jdbcType=INTEGER}, 
      #{dictId,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.ruoyi.system.domain.zb.ZbWeekReport">
    insert into zb_week_report
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="title != null">
        title,
      </if>
      <if test="startDate != null">
        start_date,
      </if>
      <if test="endDate != null">
        end_date,
      </if>
      <if test="week != null">
        week,
      </if>
      <if test="year != null">
        year,
      </if>
      <if test="leaderFillFlag != null">
        leader_fill_flag,
      </if>
      <if test="showFlag != null">
        show_flag,
      </if>
      <if test="type != null">
        type,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="createUser != null">
        create_user,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="updateUser != null">
        update_user,
      </if>
      <if test="fillCount != null">
        fill_count,
      </if>
      <if test="valid != null">
        valid,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="dictId != null">
        dict_id,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="title != null">
        #{title,jdbcType=VARCHAR},
      </if>
      <if test="startDate != null">
        #{startDate,jdbcType=DATE},
      </if>
      <if test="endDate != null">
        #{endDate,jdbcType=DATE},
      </if>
      <if test="week != null">
        #{week,jdbcType=VARCHAR},
      </if>
      <if test="year != null">
        #{year,jdbcType=VARCHAR},
      </if>
      <if test="leaderFillFlag != null">
        #{leaderFillFlag,jdbcType=TINYINT},
      </if>
      <if test="showFlag != null">
        #{showFlag,jdbcType=TINYINT},
      </if>
      <if test="type != null">
        #{type,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createUser != null">
        #{createUser,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUser != null">
        #{updateUser,jdbcType=VARCHAR},
      </if>
      <if test="fillCount != null">
        #{fillCount,jdbcType=INTEGER},
      </if>
      <if test="valid != null">
        #{valid,jdbcType=TINYINT},
      </if>
      <if test="status != null">
        #{status,jdbcType=INTEGER},
      </if>
      <if test="dictId != null">
        #{dictId,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.ruoyi.system.domain.zb.ZbWeekReportExample" resultType="java.lang.Long">
    select count(*) from zb_week_report
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update zb_week_report
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.title != null">
        title = #{record.title,jdbcType=VARCHAR},
      </if>
      <if test="record.startDate != null">
        start_date = #{record.startDate,jdbcType=DATE},
      </if>
      <if test="record.endDate != null">
        end_date = #{record.endDate,jdbcType=DATE},
      </if>
      <if test="record.week != null">
        week = #{record.week,jdbcType=VARCHAR},
      </if>
      <if test="record.year != null">
        year = #{record.year,jdbcType=VARCHAR},
      </if>
      <if test="record.leaderFillFlag != null">
        leader_fill_flag = #{record.leaderFillFlag,jdbcType=TINYINT},
      </if>
      <if test="record.showFlag != null">
        show_flag = #{record.showFlag,jdbcType=TINYINT},
      </if>
      <if test="record.type != null">
        type = #{record.type,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createUser != null">
        create_user = #{record.createUser,jdbcType=VARCHAR},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateUser != null">
        update_user = #{record.updateUser,jdbcType=VARCHAR},
      </if>
      <if test="record.fillCount != null">
        fill_count = #{record.fillCount,jdbcType=INTEGER},
      </if>
      <if test="record.valid != null">
        valid = #{record.valid,jdbcType=TINYINT},
      </if>
      <if test="record.status != null">
        status = #{record.status,jdbcType=INTEGER},
      </if>
      <if test="record.dictId != null">
        dict_id = #{record.dictId,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update zb_week_report
    set id = #{record.id,jdbcType=VARCHAR},
      title = #{record.title,jdbcType=VARCHAR},
      start_date = #{record.startDate,jdbcType=DATE},
      end_date = #{record.endDate,jdbcType=DATE},
      week = #{record.week,jdbcType=VARCHAR},
      year = #{record.year,jdbcType=VARCHAR},
      leader_fill_flag = #{record.leaderFillFlag,jdbcType=TINYINT},
      show_flag = #{record.showFlag,jdbcType=TINYINT},
      type = #{record.type,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      create_user = #{record.createUser,jdbcType=VARCHAR},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      update_user = #{record.updateUser,jdbcType=VARCHAR},
      fill_count = #{record.fillCount,jdbcType=INTEGER},
      valid = #{record.valid,jdbcType=TINYINT},
      status = #{record.status,jdbcType=INTEGER},
      dict_id = #{record.dictId,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.system.domain.zb.ZbWeekReport">
    update zb_week_report
    <set>
      <if test="title != null">
        title = #{title,jdbcType=VARCHAR},
      </if>
      <if test="startDate != null">
        start_date = #{startDate,jdbcType=DATE},
      </if>
      <if test="endDate != null">
        end_date = #{endDate,jdbcType=DATE},
      </if>
      <if test="week != null">
        week = #{week,jdbcType=VARCHAR},
      </if>
      <if test="year != null">
        year = #{year,jdbcType=VARCHAR},
      </if>
      <if test="leaderFillFlag != null">
        leader_fill_flag = #{leaderFillFlag,jdbcType=TINYINT},
      </if>
      <if test="showFlag != null">
        show_flag = #{showFlag,jdbcType=TINYINT},
      </if>
      <if test="type != null">
        type = #{type,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createUser != null">
        create_user = #{createUser,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUser != null">
        update_user = #{updateUser,jdbcType=VARCHAR},
      </if>
      <if test="fillCount != null">
        fill_count = #{fillCount,jdbcType=INTEGER},
      </if>
      <if test="valid != null">
        valid = #{valid,jdbcType=TINYINT},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=INTEGER},
      </if>
      <if test="dictId != null">
        dict_id = #{dictId,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.ruoyi.system.domain.zb.ZbWeekReport">
    update zb_week_report
    set title = #{title,jdbcType=VARCHAR},
      start_date = #{startDate,jdbcType=DATE},
      end_date = #{endDate,jdbcType=DATE},
      week = #{week,jdbcType=VARCHAR},
      year = #{year,jdbcType=VARCHAR},
      leader_fill_flag = #{leaderFillFlag,jdbcType=TINYINT},
      show_flag = #{showFlag,jdbcType=TINYINT},
      type = #{type,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      create_user = #{createUser,jdbcType=VARCHAR},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      update_user = #{updateUser,jdbcType=VARCHAR},
      fill_count = #{fillCount,jdbcType=INTEGER},
      valid = #{valid,jdbcType=TINYINT},
      status = #{status,jdbcType=INTEGER},
      dict_id = #{dictId,jdbcType=VARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>