|
|
@@ -1,440 +1,448 @@
|
|
|
-<?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.goafanti.common.dao.DemandPublishMapper">
|
|
|
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.DemandPublish">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
- -->
|
|
|
- <id column="id" jdbcType="VARCHAR" property="id" />
|
|
|
- <result column="demand_id" jdbcType="VARCHAR" property="demandId" />
|
|
|
- <result column="publish_platform" jdbcType="VARCHAR" property="publishPlatform" />
|
|
|
- <result column="publish_client" jdbcType="INTEGER" property="publishClient" />
|
|
|
- <result column="publish_page" jdbcType="VARCHAR" property="publishPage" />
|
|
|
- <result column="if_top" jdbcType="INTEGER" property="ifTop" />
|
|
|
- <result column="top_number" jdbcType="INTEGER" property="topNumber" />
|
|
|
- <result column="show_number" jdbcType="INTEGER" property="showNumber" />
|
|
|
- <result column="publisher" jdbcType="VARCHAR" property="publisher" />
|
|
|
- <result column="publish_time" jdbcType="TIMESTAMP" property="publishTime" />
|
|
|
- </resultMap>
|
|
|
- <sql id="Example_Where_Clause">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
- -->
|
|
|
- <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">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
- -->
|
|
|
- <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">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
- -->
|
|
|
- id, demand_id, publish_platform, publish_client, publish_page, if_top, top_number,
|
|
|
- show_number, publisher, publish_time
|
|
|
- </sql>
|
|
|
- <select id="selectByExample" parameterType="com.goafanti.common.model.DemandPublishExample" resultMap="BaseResultMap">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
- -->
|
|
|
- select
|
|
|
- <if test="distinct">
|
|
|
- distinct
|
|
|
- </if>
|
|
|
- <include refid="Base_Column_List" />
|
|
|
- from demand_publish
|
|
|
- <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">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
- -->
|
|
|
- select
|
|
|
- <include refid="Base_Column_List" />
|
|
|
- from demand_publish
|
|
|
- where id = #{id,jdbcType=VARCHAR}
|
|
|
- </select>
|
|
|
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
- -->
|
|
|
- delete from demand_publish
|
|
|
- where id = #{id,jdbcType=VARCHAR}
|
|
|
- </delete>
|
|
|
- <delete id="deleteByExample" parameterType="com.goafanti.common.model.DemandPublishExample">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
- -->
|
|
|
- delete from demand_publish
|
|
|
- <if test="_parameter != null">
|
|
|
- <include refid="Example_Where_Clause" />
|
|
|
- </if>
|
|
|
- </delete>
|
|
|
- <insert id="insert" parameterType="com.goafanti.common.model.DemandPublish">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
- -->
|
|
|
- insert into demand_publish (id, demand_id, publish_platform,
|
|
|
- publish_client, publish_page, if_top,
|
|
|
- top_number, show_number, publisher,
|
|
|
- publish_time)
|
|
|
- values (#{id,jdbcType=VARCHAR}, #{demandId,jdbcType=VARCHAR}, #{publishPlatform,jdbcType=VARCHAR},
|
|
|
- #{publishClient,jdbcType=INTEGER}, #{publishPage,jdbcType=VARCHAR}, #{ifTop,jdbcType=INTEGER},
|
|
|
- #{topNumber,jdbcType=INTEGER}, #{showNumber,jdbcType=INTEGER}, #{publisher,jdbcType=VARCHAR},
|
|
|
- #{publishTime,jdbcType=TIMESTAMP})
|
|
|
- </insert>
|
|
|
- <insert id="insertSelective" parameterType="com.goafanti.common.model.DemandPublish">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
- -->
|
|
|
- insert into demand_publish
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">
|
|
|
- id,
|
|
|
- </if>
|
|
|
- <if test="demandId != null">
|
|
|
- demand_id,
|
|
|
- </if>
|
|
|
- <if test="publishPlatform != null">
|
|
|
- publish_platform,
|
|
|
- </if>
|
|
|
- <if test="publishClient != null">
|
|
|
- publish_client,
|
|
|
- </if>
|
|
|
- <if test="publishPage != null">
|
|
|
- publish_page,
|
|
|
- </if>
|
|
|
- <if test="ifTop != null">
|
|
|
- if_top,
|
|
|
- </if>
|
|
|
- <if test="topNumber != null">
|
|
|
- top_number,
|
|
|
- </if>
|
|
|
- <if test="showNumber != null">
|
|
|
- show_number,
|
|
|
- </if>
|
|
|
- <if test="publisher != null">
|
|
|
- publisher,
|
|
|
- </if>
|
|
|
- <if test="publishTime != null">
|
|
|
- publish_time,
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">
|
|
|
- #{id,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="demandId != null">
|
|
|
- #{demandId,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="publishPlatform != null">
|
|
|
- #{publishPlatform,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="publishClient != null">
|
|
|
- #{publishClient,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="publishPage != null">
|
|
|
- #{publishPage,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ifTop != null">
|
|
|
- #{ifTop,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="topNumber != null">
|
|
|
- #{topNumber,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="showNumber != null">
|
|
|
- #{showNumber,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="publisher != null">
|
|
|
- #{publisher,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="publishTime != null">
|
|
|
- #{publishTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- </insert>
|
|
|
- <select id="countByExample" parameterType="com.goafanti.common.model.DemandPublishExample" resultType="java.lang.Long">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
- -->
|
|
|
- select count(*) from demand_publish
|
|
|
- <if test="_parameter != null">
|
|
|
- <include refid="Example_Where_Clause" />
|
|
|
- </if>
|
|
|
- </select>
|
|
|
- <update id="updateByExampleSelective" parameterType="map">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
- -->
|
|
|
- update demand_publish
|
|
|
- <set>
|
|
|
- <if test="record.id != null">
|
|
|
- id = #{record.id,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="record.demandId != null">
|
|
|
- demand_id = #{record.demandId,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="record.publishPlatform != null">
|
|
|
- publish_platform = #{record.publishPlatform,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="record.publishClient != null">
|
|
|
- publish_client = #{record.publishClient,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="record.publishPage != null">
|
|
|
- publish_page = #{record.publishPage,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="record.ifTop != null">
|
|
|
- if_top = #{record.ifTop,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="record.topNumber != null">
|
|
|
- top_number = #{record.topNumber,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="record.showNumber != null">
|
|
|
- show_number = #{record.showNumber,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="record.publisher != null">
|
|
|
- publisher = #{record.publisher,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="record.publishTime != null">
|
|
|
- publish_time = #{record.publishTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- </set>
|
|
|
- <if test="_parameter != null">
|
|
|
- <include refid="Update_By_Example_Where_Clause" />
|
|
|
- </if>
|
|
|
- </update>
|
|
|
- <update id="updateByExample" parameterType="map">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
- -->
|
|
|
- update demand_publish
|
|
|
- set id = #{record.id,jdbcType=VARCHAR},
|
|
|
- demand_id = #{record.demandId,jdbcType=VARCHAR},
|
|
|
- publish_platform = #{record.publishPlatform,jdbcType=VARCHAR},
|
|
|
- publish_client = #{record.publishClient,jdbcType=INTEGER},
|
|
|
- publish_page = #{record.publishPage,jdbcType=VARCHAR},
|
|
|
- if_top = #{record.ifTop,jdbcType=INTEGER},
|
|
|
- top_number = #{record.topNumber,jdbcType=INTEGER},
|
|
|
- show_number = #{record.showNumber,jdbcType=INTEGER},
|
|
|
- publisher = #{record.publisher,jdbcType=VARCHAR},
|
|
|
- publish_time = #{record.publishTime,jdbcType=TIMESTAMP}
|
|
|
- <if test="_parameter != null">
|
|
|
- <include refid="Update_By_Example_Where_Clause" />
|
|
|
- </if>
|
|
|
- </update>
|
|
|
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.DemandPublish">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
- -->
|
|
|
- update demand_publish
|
|
|
- <set>
|
|
|
- <if test="demandId != null">
|
|
|
- demand_id = #{demandId,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="publishPlatform != null">
|
|
|
- publish_platform = #{publishPlatform,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="publishClient != null">
|
|
|
- publish_client = #{publishClient,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="publishPage != null">
|
|
|
- publish_page = #{publishPage,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ifTop != null">
|
|
|
- if_top = #{ifTop,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="topNumber != null">
|
|
|
- top_number = #{topNumber,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="showNumber != null">
|
|
|
- show_number = #{showNumber,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="publisher != null">
|
|
|
- publisher = #{publisher,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="publishTime != null">
|
|
|
- publish_time = #{publishTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- </set>
|
|
|
- where id = #{id,jdbcType=VARCHAR}
|
|
|
- </update>
|
|
|
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.DemandPublish">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
- -->
|
|
|
- update demand_publish
|
|
|
- set demand_id = #{demandId,jdbcType=VARCHAR},
|
|
|
- publish_platform = #{publishPlatform,jdbcType=VARCHAR},
|
|
|
- publish_client = #{publishClient,jdbcType=INTEGER},
|
|
|
- publish_page = #{publishPage,jdbcType=VARCHAR},
|
|
|
- if_top = #{ifTop,jdbcType=INTEGER},
|
|
|
- top_number = #{topNumber,jdbcType=INTEGER},
|
|
|
- show_number = #{showNumber,jdbcType=INTEGER},
|
|
|
- publisher = #{publisher,jdbcType=VARCHAR},
|
|
|
- publish_time = #{publishTime,jdbcType=TIMESTAMP}
|
|
|
- where id = #{id,jdbcType=VARCHAR}
|
|
|
- </update>
|
|
|
- <select id="findDemandPublishByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandPublishBo">
|
|
|
-select dp.id,dp.demand_id as demandId, d.serial_number as serialNumber,d.name as name ,d.employer_name as userName,dp.publish_platform as publishPlatform,bi.platform_name as platformName,dp.publish_client as publishClient,
|
|
|
- dp.publish_page as publishPage,dp.if_top as ifTop,dp.show_number as showNumber,dp.top_number as topNumber,dp.publisher,ad.name as publisherName,dp.publish_time as publishTime
|
|
|
-from demand_publish dp
|
|
|
-left join demand d on dp.demand_id=d.id
|
|
|
-left join admin ad on dp.publisher=ad.id
|
|
|
-left join branch_information bi on dp.publish_platform=bi.id
|
|
|
-where 1=1
|
|
|
-<if test="name != null">
|
|
|
- and d.name like "%"#{name,jdbcType=VARCHAR}"%"
|
|
|
- </if>
|
|
|
- <if test="userName != null">
|
|
|
- and d.owner_name = = #{userName,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="publishPlatform != null">
|
|
|
- and dp.publish_platform = #{publishPlatform,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="publishClient != null">
|
|
|
- and dp.publish_client = #{publishClient,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
-
|
|
|
- <if test="publishPage != null">
|
|
|
- and dp.publish_page =#{publishPage,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="ifTop != null">
|
|
|
- and dp.if_top =#{ifTop,jdbcType=INTEGER}
|
|
|
-
|
|
|
- </if>
|
|
|
- <if test="employerName != null">
|
|
|
- and d.employer_name like #{employerName,jdbcType=INTEGER}'%'
|
|
|
- </if>
|
|
|
- order by dp.if_top, dp.top_number,dp.show_number asc
|
|
|
- <if test="page_sql!=null">
|
|
|
- ${page_sql}
|
|
|
- </if>
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="findDemandPublishCount" parameterType="String" resultType="java.lang.Integer">
|
|
|
- select count(1)
|
|
|
-from demand_publish dp
|
|
|
-left join demand d on dp.demand_id=d.id
|
|
|
-left join admin ad on dp.publisher=ad.id
|
|
|
-left join branch_information bi on dp.publish_platform=bi.id
|
|
|
-where 1=1
|
|
|
-<if test="name != null">
|
|
|
- and d.name like "%"#{name,jdbcType=VARCHAR}"%"
|
|
|
- </if>
|
|
|
- <if test="publishPage != null">
|
|
|
- and dp.publish_page =#{publishPage,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="userName != null">
|
|
|
- and d.owner_name = = #{userName,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="publishPlatform != null">
|
|
|
- and dp.publish_platform = #{publishPlatform,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="publishClient != null">
|
|
|
- and dp.publish_client = #{publishClient,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="ifTop != null">
|
|
|
- and dp.if_top=#{ifTop,jdbcType=INTEGER}
|
|
|
-
|
|
|
- </if>
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="checkExisting" resultType="java.lang.Integer">
|
|
|
- select count(1)
|
|
|
- from demand_publish
|
|
|
- where 1=1
|
|
|
- and demand_id= #{demandId,jdbcType=VARCHAR}
|
|
|
- and publish_platform= #{publishPlatform,jdbcType=VARCHAR}
|
|
|
- and publish_client= #{publishClient,jdbcType=INTEGER}
|
|
|
- and publish_page= #{publishPage,jdbcType=VARCHAR}
|
|
|
- </select>
|
|
|
+<?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.goafanti.common.dao.DemandPublishMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.goafanti.common.model.DemandPublish">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
+ -->
|
|
|
+ <id column="id" jdbcType="VARCHAR" property="id" />
|
|
|
+ <result column="demand_id" jdbcType="VARCHAR" property="demandId" />
|
|
|
+ <result column="publish_platform" jdbcType="VARCHAR" property="publishPlatform" />
|
|
|
+ <result column="publish_client" jdbcType="INTEGER" property="publishClient" />
|
|
|
+ <result column="publish_page" jdbcType="VARCHAR" property="publishPage" />
|
|
|
+ <result column="if_top" jdbcType="INTEGER" property="ifTop" />
|
|
|
+ <result column="top_number" jdbcType="INTEGER" property="topNumber" />
|
|
|
+ <result column="show_number" jdbcType="INTEGER" property="showNumber" />
|
|
|
+ <result column="publisher" jdbcType="VARCHAR" property="publisher" />
|
|
|
+ <result column="publish_time" jdbcType="TIMESTAMP" property="publishTime" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Example_Where_Clause">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
+ -->
|
|
|
+ <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">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
+ -->
|
|
|
+ <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">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
+ -->
|
|
|
+ id, demand_id, publish_platform, publish_client, publish_page, if_top, top_number,
|
|
|
+ show_number, publisher, publish_time
|
|
|
+ </sql>
|
|
|
+ <select id="selectByExample" parameterType="com.goafanti.common.model.DemandPublishExample" resultMap="BaseResultMap">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
+ -->
|
|
|
+ select
|
|
|
+ <if test="distinct">
|
|
|
+ distinct
|
|
|
+ </if>
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from demand_publish
|
|
|
+ <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">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
+ -->
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from demand_publish
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
+ -->
|
|
|
+ delete from demand_publish
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </delete>
|
|
|
+ <delete id="deleteByExample" parameterType="com.goafanti.common.model.DemandPublishExample">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
+ -->
|
|
|
+ delete from demand_publish
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Example_Where_Clause" />
|
|
|
+ </if>
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.goafanti.common.model.DemandPublish">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
+ -->
|
|
|
+ insert into demand_publish (id, demand_id, publish_platform,
|
|
|
+ publish_client, publish_page, if_top,
|
|
|
+ top_number, show_number, publisher,
|
|
|
+ publish_time)
|
|
|
+ values (#{id,jdbcType=VARCHAR}, #{demandId,jdbcType=VARCHAR}, #{publishPlatform,jdbcType=VARCHAR},
|
|
|
+ #{publishClient,jdbcType=INTEGER}, #{publishPage,jdbcType=VARCHAR}, #{ifTop,jdbcType=INTEGER},
|
|
|
+ #{topNumber,jdbcType=INTEGER}, #{showNumber,jdbcType=INTEGER}, #{publisher,jdbcType=VARCHAR},
|
|
|
+ #{publishTime,jdbcType=TIMESTAMP})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.goafanti.common.model.DemandPublish">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
+ -->
|
|
|
+ insert into demand_publish
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">
|
|
|
+ id,
|
|
|
+ </if>
|
|
|
+ <if test="demandId != null">
|
|
|
+ demand_id,
|
|
|
+ </if>
|
|
|
+ <if test="publishPlatform != null">
|
|
|
+ publish_platform,
|
|
|
+ </if>
|
|
|
+ <if test="publishClient != null">
|
|
|
+ publish_client,
|
|
|
+ </if>
|
|
|
+ <if test="publishPage != null">
|
|
|
+ publish_page,
|
|
|
+ </if>
|
|
|
+ <if test="ifTop != null">
|
|
|
+ if_top,
|
|
|
+ </if>
|
|
|
+ <if test="topNumber != null">
|
|
|
+ top_number,
|
|
|
+ </if>
|
|
|
+ <if test="showNumber != null">
|
|
|
+ show_number,
|
|
|
+ </if>
|
|
|
+ <if test="publisher != null">
|
|
|
+ publisher,
|
|
|
+ </if>
|
|
|
+ <if test="publishTime != null">
|
|
|
+ publish_time,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">
|
|
|
+ #{id,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="demandId != null">
|
|
|
+ #{demandId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="publishPlatform != null">
|
|
|
+ #{publishPlatform,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="publishClient != null">
|
|
|
+ #{publishClient,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="publishPage != null">
|
|
|
+ #{publishPage,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ifTop != null">
|
|
|
+ #{ifTop,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="topNumber != null">
|
|
|
+ #{topNumber,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="showNumber != null">
|
|
|
+ #{showNumber,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="publisher != null">
|
|
|
+ #{publisher,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="publishTime != null">
|
|
|
+ #{publishTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <select id="countByExample" parameterType="com.goafanti.common.model.DemandPublishExample" resultType="java.lang.Long">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
+ -->
|
|
|
+ select count(*) from demand_publish
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Example_Where_Clause" />
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <update id="updateByExampleSelective" parameterType="map">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
+ -->
|
|
|
+ update demand_publish
|
|
|
+ <set>
|
|
|
+ <if test="record.id != null">
|
|
|
+ id = #{record.id,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.demandId != null">
|
|
|
+ demand_id = #{record.demandId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.publishPlatform != null">
|
|
|
+ publish_platform = #{record.publishPlatform,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.publishClient != null">
|
|
|
+ publish_client = #{record.publishClient,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.publishPage != null">
|
|
|
+ publish_page = #{record.publishPage,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.ifTop != null">
|
|
|
+ if_top = #{record.ifTop,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.topNumber != null">
|
|
|
+ top_number = #{record.topNumber,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.showNumber != null">
|
|
|
+ show_number = #{record.showNumber,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.publisher != null">
|
|
|
+ publisher = #{record.publisher,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.publishTime != null">
|
|
|
+ publish_time = #{record.publishTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Update_By_Example_Where_Clause" />
|
|
|
+ </if>
|
|
|
+ </update>
|
|
|
+ <update id="updateByExample" parameterType="map">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
+ -->
|
|
|
+ update demand_publish
|
|
|
+ set id = #{record.id,jdbcType=VARCHAR},
|
|
|
+ demand_id = #{record.demandId,jdbcType=VARCHAR},
|
|
|
+ publish_platform = #{record.publishPlatform,jdbcType=VARCHAR},
|
|
|
+ publish_client = #{record.publishClient,jdbcType=INTEGER},
|
|
|
+ publish_page = #{record.publishPage,jdbcType=VARCHAR},
|
|
|
+ if_top = #{record.ifTop,jdbcType=INTEGER},
|
|
|
+ top_number = #{record.topNumber,jdbcType=INTEGER},
|
|
|
+ show_number = #{record.showNumber,jdbcType=INTEGER},
|
|
|
+ publisher = #{record.publisher,jdbcType=VARCHAR},
|
|
|
+ publish_time = #{record.publishTime,jdbcType=TIMESTAMP}
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Update_By_Example_Where_Clause" />
|
|
|
+ </if>
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.DemandPublish">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
+ -->
|
|
|
+ update demand_publish
|
|
|
+ <set>
|
|
|
+ <if test="demandId != null">
|
|
|
+ demand_id = #{demandId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="publishPlatform != null">
|
|
|
+ publish_platform = #{publishPlatform,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="publishClient != null">
|
|
|
+ publish_client = #{publishClient,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="publishPage != null">
|
|
|
+ publish_page = #{publishPage,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ifTop != null">
|
|
|
+ if_top = #{ifTop,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="topNumber != null">
|
|
|
+ top_number = #{topNumber,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="showNumber != null">
|
|
|
+ show_number = #{showNumber,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="publisher != null">
|
|
|
+ publisher = #{publisher,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="publishTime != null">
|
|
|
+ publish_time = #{publishTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.DemandPublish">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Wed Jan 31 09:34:27 CST 2018.
|
|
|
+ -->
|
|
|
+ update demand_publish
|
|
|
+ set demand_id = #{demandId,jdbcType=VARCHAR},
|
|
|
+ publish_platform = #{publishPlatform,jdbcType=VARCHAR},
|
|
|
+ publish_client = #{publishClient,jdbcType=INTEGER},
|
|
|
+ publish_page = #{publishPage,jdbcType=VARCHAR},
|
|
|
+ if_top = #{ifTop,jdbcType=INTEGER},
|
|
|
+ top_number = #{topNumber,jdbcType=INTEGER},
|
|
|
+ show_number = #{showNumber,jdbcType=INTEGER},
|
|
|
+ publisher = #{publisher,jdbcType=VARCHAR},
|
|
|
+ publish_time = #{publishTime,jdbcType=TIMESTAMP}
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </update>
|
|
|
+ <select id="findDemandPublishByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandPublishBo">
|
|
|
+select dp.id,dp.demand_id as demandId, d.serial_number as serialNumber,d.name as name ,d.employer_name as userName,dp.publish_platform as publishPlatform,bi.platform_name as platformName,dp.publish_client as publishClient,
|
|
|
+ dp.publish_page as publishPage,dp.if_top as ifTop,dp.show_number as showNumber,dp.top_number as topNumber,dp.publisher,ad.name as publisherName,dp.publish_time as publishTime
|
|
|
+from demand_publish dp
|
|
|
+left join demand d on dp.demand_id=d.id
|
|
|
+left join admin ad on dp.publisher=ad.id
|
|
|
+left join branch_information bi on dp.publish_platform=bi.id
|
|
|
+where 1=1
|
|
|
+<if test="name != null">
|
|
|
+ and d.name like "%"#{name,jdbcType=VARCHAR}"%"
|
|
|
+ </if>
|
|
|
+ <if test="userName != null">
|
|
|
+ and d.owner_name = = #{userName,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="publishPlatform != null">
|
|
|
+ and dp.publish_platform = #{publishPlatform,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="publishClient != null">
|
|
|
+ and dp.publish_client = #{publishClient,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="publishPage != null">
|
|
|
+ and dp.publish_page =#{publishPage,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="ifTop != null">
|
|
|
+ and dp.if_top =#{ifTop,jdbcType=INTEGER}
|
|
|
+
|
|
|
+ </if>
|
|
|
+ <if test="employerName != null">
|
|
|
+ and d.employer_name like #{employerName,jdbcType=INTEGER}'%'
|
|
|
+ </if>
|
|
|
+ order by dp.if_top, dp.top_number,dp.show_number asc
|
|
|
+ <if test="page_sql!=null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findDemandPublishCount" parameterType="String" resultType="java.lang.Integer">
|
|
|
+ select count(1)
|
|
|
+from demand_publish dp
|
|
|
+left join demand d on dp.demand_id=d.id
|
|
|
+left join admin ad on dp.publisher=ad.id
|
|
|
+left join branch_information bi on dp.publish_platform=bi.id
|
|
|
+where 1=1
|
|
|
+<if test="name != null">
|
|
|
+ and d.name like "%"#{name,jdbcType=VARCHAR}"%"
|
|
|
+ </if>
|
|
|
+ <if test="publishPage != null">
|
|
|
+ and dp.publish_page =#{publishPage,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="userName != null">
|
|
|
+ and d.owner_name = = #{userName,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="publishPlatform != null">
|
|
|
+ and dp.publish_platform = #{publishPlatform,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="publishClient != null">
|
|
|
+ and dp.publish_client = #{publishClient,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="ifTop != null">
|
|
|
+ and dp.if_top=#{ifTop,jdbcType=INTEGER}
|
|
|
+
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="checkExisting" resultType="java.lang.Integer">
|
|
|
+ select count(1)
|
|
|
+ from demand_publish
|
|
|
+ where 1=1
|
|
|
+ and demand_id= #{demandId,jdbcType=VARCHAR}
|
|
|
+ and publish_platform= #{publishPlatform,jdbcType=VARCHAR}
|
|
|
+ and publish_client= #{publishClient,jdbcType=INTEGER}
|
|
|
+ and publish_page= #{publishPage,jdbcType=VARCHAR}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectPublishPages" resultMap="BaseResultMap" parameterType="java.lang.String">
|
|
|
+ select id,publish_client,publish_page from demand_publish where demand_id = #{demandId,jdbcType=VARCHAR}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <delete id="batchDeleteByDemandId" parameterType="java.lang.String">
|
|
|
+ delete from demand_publish where demand_id = #{demandId,jdbcType=VARCHAR}
|
|
|
+ </delete>
|
|
|
</mapper>
|