Newer
Older
huludao / src / main / resources / mapper / EventsManage / EventsPicDao.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.ComplainPicDao" >
  <resultMap id="BaseResultMap" type="com.newfiber.api.pc.model.EventsManage.ComplainPic" >
    <id column="Serial" property="serial" jdbcType="BIGINT" />
    <result column="Events_No" property="eventsNo" jdbcType="VARCHAR" />
    <result column="Pic_Type" property="picType" jdbcType="INTEGER" />
    <result column="Pic_Type_Name" property="picTypeName" jdbcType="NVARCHAR" />
    <result column="Pic_Name" property="picName" jdbcType="NVARCHAR" />
    <result column="Pic_Path" property="picPath" jdbcType="NVARCHAR" />
    <result column="Create_Time" property="createTime" jdbcType="TIMESTAMP" />
  </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, Events_No, Pic_Type, Pic_Type_Name, Pic_Name, Pic_Path, Create_Time
    </if>
    <if test="fields != null" >
      ${fields}
    </if>
  </sql>
  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.newfiber.api.pc.model.EventsManage.EventsPicQuery" >
    select
    <if test="distinct" >
      distinct
    </if>
    <include refid="Base_Column_List" />
    from complain_pic
    <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.EventsPicQuery" >
    delete from complain_pic
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </delete>



  <insert id="insertSelective" parameterType="com.newfiber.api.pc.model.EventsManage.ComplainPic" >
    insert into complain_pic
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="serial != null" >
        Serial,
      </if>
      <if test="eventsNo != null" >
        Events_No,
      </if>
      <if test="picType != null" >
        Pic_Type,
      </if>
      <if test="picTypeName != null" >
        Pic_Type_Name,
      </if>
      <if test="picName != null" >
        Pic_Name,
      </if>
      <if test="picPath != null" >
        Pic_Path,
      </if>
      <if test="createTime != null" >
        Create_Time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="serial != null" >
        #{serial,jdbcType=BIGINT},
      </if>
      <if test="eventsNo != null" >
        #{eventsNo,jdbcType=VARCHAR},
      </if>
      <if test="picType != null" >
        #{picType,jdbcType=INTEGER},
      </if>
      <if test="picTypeName != null" >
        #{picTypeName,jdbcType=NVARCHAR},
      </if>
      <if test="picName != null" >
        #{picName,jdbcType=NVARCHAR},
      </if>
      <if test="picPath != null" >
        #{picPath,jdbcType=NVARCHAR},
      </if>
      <if test="createTime != null" >
        #{createTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>


  <select id="countByExample" parameterType="com.newfiber.api.pc.model.EventsManage.EventsPicQuery" resultType="java.lang.Integer" >
    select count(*) from complain_pic
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </select>


  <update id="updateByExampleSelective" parameterType="map" >
    update complain_pic
    <set >
      <if test="record.serial != null" >
        Serial = #{record.serial,jdbcType=BIGINT},
      </if>
      <if test="record.eventsNo != null" >
        Events_No = #{record.eventsNo,jdbcType=VARCHAR},
      </if>
      <if test="record.picType != null" >
        Pic_Type = #{record.picType,jdbcType=INTEGER},
      </if>
      <if test="record.picTypeName != null" >
        Pic_Type_Name = #{record.picTypeName,jdbcType=NVARCHAR},
      </if>
      <if test="record.picName != null" >
        Pic_Name = #{record.picName,jdbcType=NVARCHAR},
      </if>
      <if test="record.picPath != null" >
        Pic_Path = #{record.picPath,jdbcType=NVARCHAR},
      </if>
      <if test="record.createTime != null" >
        Create_Time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>

  <insert id="insertBatch">
    insert into complain_pic (Events_No,Pic_Type,Pic_Type_Name,Pic_Name,Pic_Path) values
    <foreach collection="list" item="item" separator=",">
      (#{item.eventsNo},#{item.picType},#{item.picTypeName},#{item.picName},#{item.picPath})
    </foreach>
  </insert>

</mapper>