| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454 |
- <?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.AchievementPublishMapper">
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.AchievementPublish">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jan 30 11:16:40 CST 2018.
- -->
- <id column="id" jdbcType="VARCHAR" property="id" />
- <result column="achievement_id" jdbcType="VARCHAR" property="achievementId" />
- <result column="publish_platform" jdbcType="INTEGER" 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 Tue Jan 30 11:16:40 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 Tue Jan 30 11:16:40 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 Tue Jan 30 11:16:40 CST 2018.
- -->
- id, achievement_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.AchievementPublishExample" resultMap="BaseResultMap">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jan 30 11:16:40 CST 2018.
- -->
- select
- <if test="distinct">
- distinct
- </if>
- <include refid="Base_Column_List" />
- from achievement_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 Tue Jan 30 11:16:40 CST 2018.
- -->
- select
- <include refid="Base_Column_List" />
- from achievement_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 Tue Jan 30 11:16:40 CST 2018.
- -->
- delete from achievement_publish
- where id = #{id,jdbcType=VARCHAR}
- </delete>
- <delete id="deleteByExample" parameterType="com.goafanti.common.model.AchievementPublishExample">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jan 30 11:16:40 CST 2018.
- -->
- delete from achievement_publish
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.AchievementPublish">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jan 30 11:16:40 CST 2018.
- -->
- insert into achievement_publish (id, achievement_id, publish_platform,
- publish_client, publish_page, if_top,
- top_number, show_number, publisher,
- publish_time)
- values (#{id,jdbcType=VARCHAR}, #{achievementId,jdbcType=VARCHAR}, #{publishPlatform,jdbcType=INTEGER},
- #{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.AchievementPublish">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jan 30 11:16:40 CST 2018.
- -->
- insert into achievement_publish
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="achievementId != null">
- achievement_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="achievementId != null">
- #{achievementId,jdbcType=VARCHAR},
- </if>
- <if test="publishPlatform != null">
- #{publishPlatform,jdbcType=INTEGER},
- </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.AchievementPublishExample" resultType="java.lang.Long">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jan 30 11:16:40 CST 2018.
- -->
- select count(*) from achievement_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 Tue Jan 30 11:16:40 CST 2018.
- -->
- update achievement_publish
- <set>
- <if test="record.id != null">
- id = #{record.id,jdbcType=VARCHAR},
- </if>
- <if test="record.achievementId != null">
- achievement_id = #{record.achievementId,jdbcType=VARCHAR},
- </if>
- <if test="record.publishPlatform != null">
- publish_platform = #{record.publishPlatform,jdbcType=INTEGER},
- </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 Tue Jan 30 11:16:40 CST 2018.
- -->
- update achievement_publish
- set id = #{record.id,jdbcType=VARCHAR},
- achievement_id = #{record.achievementId,jdbcType=VARCHAR},
- publish_platform = #{record.publishPlatform,jdbcType=INTEGER},
- 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.AchievementPublish">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jan 30 11:16:40 CST 2018.
- -->
- update achievement_publish
- <set>
- <if test="achievementId != null">
- achievement_id = #{achievementId,jdbcType=VARCHAR},
- </if>
- <if test="publishPlatform != null">
- publish_platform = #{publishPlatform,jdbcType=INTEGER},
- </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.AchievementPublish">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jan 30 11:16:40 CST 2018.
- -->
- update achievement_publish
- set achievement_id = #{achievementId,jdbcType=VARCHAR},
- publish_platform = #{publishPlatform,jdbcType=INTEGER},
- 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="findAchievementPublishByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementPublishBo">
- select ap.id,ap.achievement_id as achievementId, a.serial_number as serialNumber,a.name as name ,a.owner_name as userName,ap.publish_platform as publishPlatform,bi.platform_name as platformName,ap.publish_client as publishClient,
- ap.publish_page as publishPage,ap.if_top as ifTop,ap.show_number as showNumber,ap.top_number as topNumber,ap.publisher,ad.name as publisherName,ap.publish_time as publishTime
- from achievement_publish ap
- left join achievement a on ap.achievement_id=a.id
- left join admin ad on ap.publisher=ad.id
- left join branch_information bi on ap.publish_platform=bi.id
- where 1=1
- <if test="name != null">
- and a.name like "%"#{name,jdbcType=VARCHAR}"%"
- </if>
- <if test="userName != null">
- and a.owner_name = #{userName,jdbcType=VARCHAR}
- </if>
- <if test="publishPage != null">
- and ap.publish_page = #{publishPage,jdbcType=VARCHAR}
- </if>
- <if test="publishPlatform != null">
- and ap.publish_platform = #{publishPlatform,jdbcType=VARCHAR}
- </if>
- <if test="publishClient != null">
- and ap.publish_client = #{publishClient,jdbcType=INTEGER}
- </if>
- <if test="ifTop != null">
- and ap.if_top =#{ifTop,jdbcType=INTEGER}
- </if>
- <if test="ownerName != null">
- and a.owner_name like #{ownerName,jdbcType=INTEGER}"%"
- </if>
-
- order by ap.if_top, ap.top_number,ap.show_number asc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="findAchievementPublishCount" parameterType="String" resultType="java.lang.Integer">
- select count(1)
- from achievement_publish ap
- left join achievement a on ap.achievement_id=a.id
- left join admin ad on ap.publisher=ad.id
- left join branch_information bi on ap.publish_platform=bi.id
- where 1=1
- <if test="name != null">
- and a.name like "%"#{name,jdbcType=VARCHAR}"%"
- </if>
- <if test="userName != null">
- and a.owner_name = = #{userName,jdbcType=VARCHAR}
- </if>
- <if test="publishPage != null">
- and ap.publish_page = #{publishPage,jdbcType=VARCHAR}
- </if>
- <if test="publishPlatform != null">
- and ap.publish_platform = #{publishPlatform,jdbcType=VARCHAR}
- </if>
- <if test="publishClient != null">
- and ap.publish_client = #{publishClient,jdbcType=INTEGER}
- </if>
- <if test="ifTop != null">
- and ap.if_top=#{ifTop,jdbcType=INTEGER}
- </if>
- </select>
- <select id="checkExisting" resultType="java.lang.Integer">
- select count(1)
- from achievement_publish
- where 1=1
- and achievement_id= #{achievementId,jdbcType=VARCHAR}
- and publish_platform= #{publishPlatform,jdbcType=VARCHAR}
- and publish_client= #{publishClient,jdbcType=INTEGER}
- and publish_page= #{publishPage,jdbcType=VARCHAR}
- </select>
-
- <delete id="deleteByAchievementId" parameterType="java.lang.String">
- delete from achievement_publish where achievement_id = #{id,jdbcType=VARCHAR}
- </delete>
-
- <delete id="batchDeleteByAchievementIds" parameterType="java.util.List">
- delete from achievement_publish where achievement_id in
- <foreach item="item" collection="list" open="(" separator="," close=")">
- #{item}
- </foreach>
- </delete>
-
- <select id="getPublishPagesById" resultType="java.lang.String">
- select publish_page from achievement_publish ap
- where ap.achievement_id = #{id}
- </select>
- </mapper>
|