<?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.News.AffichePublicDao" > <resultMap id="BaseResultMap" type="com.newfiber.api.pc.model.EventsManage.AffichePublic" > <id column="Serial" property="serial" jdbcType="BIGINT" /> <result column="Affiche_NO" property="afficheNo" jdbcType="VARCHAR" /> <result column="Title" property="title" jdbcType="NVARCHAR" /> <result column="Title_Img" property="titleImg" jdbcType="NVARCHAR" /> <result column="Publisher_UserID" property="publisherUserid" jdbcType="VARCHAR" /> <result column="Publisher_UserName" property="publisherUsername" jdbcType="NVARCHAR" /> <result column="Publish_Time" property="publishTime" jdbcType="TIMESTAMP" /> <result column="Areas" property="areas" jdbcType="NVARCHAR" /> <result column="Abstracts" property="abstracts" jdbcType="NVARCHAR" /> </resultMap> <resultMap id="ResultMapWithBLOBs" type="com.newfiber.api.pc.model.EventsManage.AffichePublic" extends="BaseResultMap" > <result column="Content" property="content" jdbcType="LONGVARCHAR" /> </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, Affiche_NO, Title, Title_Img, Publisher_UserID, Publisher_UserName, Publish_Time, Areas, Abstracts </if> <if test="fields != null" > ${fields} </if> </sql> <sql id="Blob_Column_List" > Content </sql> <sql id="op"> <choose> <when test="sort!=null and sort != ''"> ${sort} </when> <otherwise> Serial </otherwise> </choose> </sql> <sql id="oc"> <choose> <when test="order !=null and order != ''"> ${order} </when> <otherwise> DESC </otherwise> </choose> </sql> <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.newfiber.api.pc.model.EventsManage.AffichePublicQuery" > select <if test="distinct" > distinct </if> p.Serial,p.content, p.Affiche_NO, p.Title, p.Title_Img, p.Publisher_UserID, p.Publisher_UserName, DATE_FORMAT(p.Publish_Time,'%Y-%m-%d %T') formatTime, p.Areas, p.Abstracts,D.Division_Name AS divisionName,p.Publish_Time from affiche_public p INNER JOIN administrative_division D ON p.Areas = D.Division_No <if test="_parameter != null" > <include refid="Example_Where_Clause" /> </if> <if test="_parameter == null" > WHERE 1=1 </if> <if test="str != null and str !=''"> AND concat(Title,Areas) LIKE '${str}' </if> ORDER by <choose> <when test="sort!=null and sort!=''"> ${sort} </when> <otherwise> p.Publish_Time </otherwise> </choose> <include refid="oc"/> <if test="startRow != null" > limit #{startRow},#{pageSize} </if> </select> <delete id="deleteByExample" parameterType="com.newfiber.api.pc.model.EventsManage.AffichePublicQuery" > delete from affiche_public <if test="_parameter != null" > <include refid="Example_Where_Clause" /> </if> </delete> <insert id="insertSelective" parameterType="com.newfiber.api.pc.model.EventsManage.AffichePublic" > insert into affiche_public <trim prefix="(" suffix=")" suffixOverrides="," > <if test="serial != null" > Serial, </if> <if test="afficheNo != null" > Affiche_NO, </if> <if test="title != null" > Title, </if> <if test="titleImg != null" > Title_Img, </if> <if test="publisherUserid != null" > Publisher_UserID, </if> <if test="publisherUsername != null" > Publisher_UserName, </if> <if test="publishTime != null" > Publish_Time, </if> <if test="areas != null" > Areas, </if> <if test="abstracts != null" > Abstracts, </if> <if test="content != null" > Content, </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides="," > <if test="serial != null" > #{serial,jdbcType=BIGINT}, </if> <if test="afficheNo != null" > #{afficheNo,jdbcType=VARCHAR}, </if> <if test="title != null" > #{title,jdbcType=NVARCHAR}, </if> <if test="titleImg != null" > #{titleImg,jdbcType=NVARCHAR}, </if> <if test="publisherUserid != null" > #{publisherUserid,jdbcType=VARCHAR}, </if> <if test="publisherUsername != null" > #{publisherUsername,jdbcType=NVARCHAR}, </if> <if test="publishTime != null" > #{publishTime,jdbcType=TIMESTAMP}, </if> <if test="areas != null" > #{areas,jdbcType=NVARCHAR}, </if> <if test="abstracts != null" > #{abstracts,jdbcType=NVARCHAR}, </if> <if test="content != null" > #{content,jdbcType=LONGVARCHAR}, </if> </trim> </insert> <select id="countByExample" parameterType="com.newfiber.api.pc.model.EventsManage.AffichePublicQuery" resultType="java.lang.Integer" > select count(*) from (select <if test="distinct" > distinct </if> p.Serial,p.content, p.Affiche_NO, p.Title, p.Title_Img, p.Publisher_UserID, p.Publisher_UserName, DATE_FORMAT(p.Publish_Time,'%Y-%m-%d %T') formatTime, p.Areas, p.Abstracts,D.Division_Name AS divisionName from affiche_public p INNER JOIN administrative_division D ON p.Areas = D.Division_No <if test="_parameter != null" > <include refid="Example_Where_Clause" /> </if> <if test="_parameter == null" > WHERE 1=1 </if> <if test="str != null and str !=''"> AND concat(Title,Areas) LIKE '${str}' </if>) t </select> <update id="updateByExampleSelective" parameterType="map" > update affiche_public <set > <if test="record.serial != null" > Serial = #{record.serial,jdbcType=BIGINT}, </if> <if test="record.afficheNo != null" > Affiche_NO = #{record.afficheNo,jdbcType=VARCHAR}, </if> <if test="record.title != null" > Title = #{record.title,jdbcType=NVARCHAR}, </if> <if test="record.titleImg != null" > Title_Img = #{record.titleImg,jdbcType=NVARCHAR}, </if> <if test="record.publisherUserid != null" > Publisher_UserID = #{record.publisherUserid,jdbcType=VARCHAR}, </if> <if test="record.publisherUsername != null" > Publisher_UserName = #{record.publisherUsername,jdbcType=NVARCHAR}, </if> <if test="record.publishTime != null" > Publish_Time = #{record.publishTime,jdbcType=TIMESTAMP}, </if> <if test="record.areas != null" > Areas = #{record.areas,jdbcType=NVARCHAR}, </if> <if test="record.abstracts != null" > Abstracts = #{record.abstracts,jdbcType=NVARCHAR}, </if> <if test="record.content != null" > Content = #{record.content,jdbcType=LONGVARCHAR}, </if> </set> <if test="_parameter != null" > <include refid="Update_By_Example_Where_Clause" /> </if> </update> </mapper>