Newer
Older
huludao / src / main / resources / mapper / EventsManage / EventsProcessDao.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.EventsProcessDao" >
  <resultMap id="BaseResultMap" type="com.newfiber.api.pc.model.EventsManage.EventsProcess" >
    <id column="Serial" property="serial" jdbcType="BIGINT" />
    <result column="Process_Content" property="processContent" jdbcType="NVARCHAR" />
    <result column="Event_No" property="eventNo" jdbcType="VARCHAR" />
    <result column="Dispose_User_No" property="disposeUserNo" jdbcType="VARCHAR" />
    <result column="Event_Flow_Id" property="eventFlowId" jdbcType="INTEGER" />
    <result column="Next_Dispose_User_No" property="nextDisposeUserNo" jdbcType="VARCHAR" />
    <result column="Event_Flow_Name" property="eventFlowName" jdbcType="NVARCHAR" />
    <result column="Event_Time" property="eventTime" jdbcType="DECIMAL" />
  </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, Process_Content, Event_No, Dispose_User_No, Event_Flow_Id, Next_Dispose_User_No, 
      Event_Flow_Name, Event_Time
    </if>
    <if test="fields != null" >
      ${fields}
    </if>
  </sql>


  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.newfiber.api.pc.model.EventsManage.EventsProcessQuery" >
    select
    p.Serial,
    p.Process_Content,
    p.Event_No,
    p.Dispose_User_No,
    p.Event_Flow_Id,
    p.Next_Dispose_User_No,
    p.Event_Flow_Name,
    DATE_FORMAT(p.Event_Time,'%Y-%m-%d %T') formatTime,
    u.user_name disposeUserName
    from complain_process p INNER JOIN huludao_main.sys_user_info u
    ON u.User_No=p.Dispose_User_No
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
    ORDER BY p.Event_Time ASC
    <if test="startRow != null" >
      limit #{startRow},#{pageSize}
    </if>
  </select>


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

  <insert id="insertSelective" parameterType="com.newfiber.api.pc.model.EventsManage.EventsProcess" >
    insert into complain_process
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="serial != null" >
        Serial,
      </if>
      <if test="processContent != null" >
        Process_Content,
      </if>
      <if test="eventNo != null" >
        Event_No,
      </if>
      <if test="disposeUserNo != null" >
        Dispose_User_No,
      </if>
      <if test="eventFlowId != null" >
        Event_Flow_Id,
      </if>
      <if test="nextDisposeUserNo != null" >
        Next_Dispose_User_No,
      </if>
      <if test="eventFlowName != null" >
        Event_Flow_Name,
      </if>
      <if test="eventTime != null" >
        Event_Time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="serial != null" >
        #{serial,jdbcType=BIGINT},
      </if>
      <if test="processContent != null" >
        #{processContent,jdbcType=NVARCHAR},
      </if>
      <if test="eventNo != null" >
        #{eventNo,jdbcType=VARCHAR},
      </if>
      <if test="disposeUserNo != null" >
        #{disposeUserNo,jdbcType=VARCHAR},
      </if>
      <if test="eventFlowId != null" >
        #{eventFlowId,jdbcType=INTEGER},
      </if>
      <if test="nextDisposeUserNo != null" >
        #{nextDisposeUserNo,jdbcType=VARCHAR},
      </if>
      <if test="eventFlowName != null" >
        #{eventFlowName,jdbcType=NVARCHAR},
      </if>
      <if test="eventTime != null" >
        #{eventTime,jdbcType=DECIMAL},
      </if>
    </trim>
  </insert>


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


  <update id="updateByExampleSelective" parameterType="map" >
    update complain_process
    <set >
      <if test="record.serial != null" >
        Serial = #{record.serial,jdbcType=BIGINT},
      </if>
      <if test="record.processContent != null" >
        Process_Content = #{record.processContent,jdbcType=NVARCHAR},
      </if>
      <if test="record.eventNo != null" >
        Event_No = #{record.eventNo,jdbcType=VARCHAR},
      </if>
      <if test="record.disposeUserNo != null" >
        Dispose_User_No = #{record.disposeUserNo,jdbcType=VARCHAR},
      </if>
      <if test="record.eventFlowId != null" >
        Event_Flow_Id = #{record.eventFlowId,jdbcType=INTEGER},
      </if>
      <if test="record.nextDisposeUserNo != null" >
        Next_Dispose_User_No = #{record.nextDisposeUserNo,jdbcType=VARCHAR},
      </if>
      <if test="record.eventFlowName != null" >
        Event_Flow_Name = #{record.eventFlowName,jdbcType=NVARCHAR},
      </if>
      <if test="record.eventTime != null" >
        Event_Time = #{record.eventTime,jdbcType=DECIMAL},
      </if>
    </set>
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>



</mapper>