Newer
Older
huludao / src / main / resources / mapper / EventsManage / SystemFileDao.xml
<?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.newfiber.api.pc.dao.EventsManage.SystemFileDao" >
  <resultMap id="BaseResultMap" type="com.newfiber.api.pc.model.EventsManage.SystemFile" >
    <id column="Serial" property="serial" jdbcType="BIGINT" />
    <result column="File_No" property="fileNo" jdbcType="VARCHAR" />
    <result column="File_Name" property="fileName" jdbcType="NVARCHAR" />
    <result column="File_Address" property="fileAddress" jdbcType="NVARCHAR" />
    <result column="File_Type" property="fileType" jdbcType="INTEGER" />
    <result column="File_Type_Name" property="fileTypeName" jdbcType="NVARCHAR" />
    <result column="Create_User_No" property="createUserNo" jdbcType="VARCHAR" />
    <result column="Create_Time" property="createTime" jdbcType="TIMESTAMP" />
    <result column="Data_State" property="dataState" jdbcType="INTEGER" />
    <result column="Data_State_ZN" property="dataStateZn" jdbcType="NVARCHAR" />
    <result column="Remark" property="remark" jdbcType="NVARCHAR" />
  </resultMap>
  <sql id="Example_Where_Clause" >
    <where >
      <foreach collection="oredCriteria" item="criteria" separator="or" >
        <if test="criteria.valid" >
          <trim prefix="(" suffix=")" prefixOverrides="and" >
            <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 collection="criterion.value" item="listItem" open="(" close=")" 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="(" suffix=")" prefixOverrides="and" >
            <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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List" >
    <if test="fields == null" >
      Serial, File_No, File_Name, File_Address, File_Type, File_Type_Name, Create_User_No, 
      Create_Time, Data_State, Data_State_ZN, Remark
    </if>
    <if test="fields != null" >
      ${fields}
    </if>
  </sql>
  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.newfiber.api.pc.model.EventsManage.SystemFileQuery" >
    select
    <if test="distinct" >
      distinct
    </if>
    <include refid="Base_Column_List" />
    from system_file
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null" >
      order by ${orderByClause}
    </if>
    <if test="startRow != null" >
      limit #{startRow} , #{pageSize}
    </if>
  </select>




  <delete id="deleteByExample" parameterType="com.newfiber.api.pc.model.EventsManage.SystemFileQuery" >
    delete from system_file
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </delete>

  <insert id="insertSelective" parameterType="com.newfiber.api.pc.model.EventsManage.SystemFile" >
    insert into system_file
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="serial != null" >
        Serial,
      </if>
      <if test="fileNo != null" >
        File_No,
      </if>
      <if test="fileName != null" >
        File_Name,
      </if>
      <if test="fileAddress != null" >
        File_Address,
      </if>
      <if test="fileType != null" >
        File_Type,
      </if>
      <if test="fileTypeName != null" >
        File_Type_Name,
      </if>
      <if test="createUserNo != null" >
        Create_User_No,
      </if>
      <if test="createTime != null" >
        Create_Time,
      </if>
      <if test="dataState != null" >
        Data_State,
      </if>
      <if test="dataStateZn != null" >
        Data_State_ZN,
      </if>
      <if test="remark != null" >
        Remark,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="serial != null" >
        #{serial,jdbcType=BIGINT},
      </if>
      <if test="fileNo != null" >
        #{fileNo,jdbcType=VARCHAR},
      </if>
      <if test="fileName != null" >
        #{fileName,jdbcType=NVARCHAR},
      </if>
      <if test="fileAddress != null" >
        #{fileAddress,jdbcType=NVARCHAR},
      </if>
      <if test="fileType != null" >
        #{fileType,jdbcType=INTEGER},
      </if>
      <if test="fileTypeName != null" >
        #{fileTypeName,jdbcType=NVARCHAR},
      </if>
      <if test="createUserNo != null" >
        #{createUserNo,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null" >
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="dataState != null" >
        #{dataState,jdbcType=INTEGER},
      </if>
      <if test="dataStateZn != null" >
        #{dataStateZn,jdbcType=NVARCHAR},
      </if>
      <if test="remark != null" >
        #{remark,jdbcType=NVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.newfiber.api.pc.model.EventsManage.SystemFileQuery" resultType="java.lang.Integer" >
    select count(*) from system_file
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map" >
    update system_file
    <set >
      <if test="record.serial != null" >
        Serial = #{record.serial,jdbcType=BIGINT},
      </if>
      <if test="record.fileNo != null" >
        File_No = #{record.fileNo,jdbcType=VARCHAR},
      </if>
      <if test="record.fileName != null" >
        File_Name = #{record.fileName,jdbcType=NVARCHAR},
      </if>
      <if test="record.fileAddress != null" >
        File_Address = #{record.fileAddress,jdbcType=NVARCHAR},
      </if>
      <if test="record.fileType != null" >
        File_Type = #{record.fileType,jdbcType=INTEGER},
      </if>
      <if test="record.fileTypeName != null" >
        File_Type_Name = #{record.fileTypeName,jdbcType=NVARCHAR},
      </if>
      <if test="record.createUserNo != null" >
        Create_User_No = #{record.createUserNo,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null" >
        Create_Time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.dataState != null" >
        Data_State = #{record.dataState,jdbcType=INTEGER},
      </if>
      <if test="record.dataStateZn != null" >
        Data_State_ZN = #{record.dataStateZn,jdbcType=NVARCHAR},
      </if>
      <if test="record.remark != null" >
        Remark = #{record.remark,jdbcType=NVARCHAR},
      </if>
    </set>
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>

</mapper>