| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.activity.RecommendActivityMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.activity.RecommendActivity"> |
| | | <id column="ar_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="ar_title" property="title" jdbcType="VARCHAR"/> |
| | | <result column="ar_type" property="type" jdbcType="INTEGER"/> |
| | | <result column="ar_order_by" property="orderBy" jdbcType="INTEGER"/> |
| | | <result column="ar_share_count" property="shareCount" jdbcType="INTEGER"/> |
| | | <result column="ar_total_getmoney" property="totalGetMoney" jdbcType="VARCHAR"/> |
| | | <result column="ar_video_post_picture" property="videoPostPictire" jdbcType="VARCHAR"/> |
| | | <result column="ar_video_url" property="videoUrl" jdbcType="VARCHAR"/> |
| | | <result column="ar_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="ar_top" property="top" jdbcType="BOOLEAN"/> |
| | | <result column="ar_start_time" property="startTime" jdbcType="TIMESTAMP"/> |
| | | <result column="ar_end_time" property="endTime" jdbcType="TIMESTAMP"/> |
| | | <result column="ar_state" property="state" jdbcType="INTEGER"/> |
| | | |
| | | <association property="activityUser" column="ar_activity_uid" |
| | | resultMap="com.yeshi.fanli.dao.mybatis.activity.ActivityUserMapper.BaseResultMap" /> |
| | | <resultMap id="BaseResultMap" |
| | | type="com.yeshi.fanli.entity.bus.activity.RecommendActivity"> |
| | | <id column="ar_id" property="id" jdbcType="BIGINT" /> |
| | | <result column="ar_title" property="title" jdbcType="VARCHAR" /> |
| | | <result column="ar_type" property="type" jdbcType="INTEGER" /> |
| | | <result column="ar_order_by" property="orderBy" jdbcType="INTEGER" /> |
| | | <result column="ar_share_count" property="shareCount" jdbcType="INTEGER" /> |
| | | <result column="ar_total_getmoney" property="totalGetMoney" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="ar_video_post_picture" property="videoPostPictire" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="ar_video_url" property="videoUrl" jdbcType="VARCHAR" /> |
| | | <result column="ar_create_time" property="createTime" jdbcType="TIMESTAMP" /> |
| | | <result column="ar_top" property="top" jdbcType="BOOLEAN" /> |
| | | <result column="ar_start_time" property="startTime" jdbcType="TIMESTAMP" /> |
| | | <result column="ar_end_time" property="endTime" jdbcType="TIMESTAMP" /> |
| | | <result column="ar_state" property="state" jdbcType="INTEGER" /> |
| | | |
| | | <association property="goodsList" column="ar_id" |
| | | select="com.yeshi.fanli.dao.mybatis.activity.RecommendActivityTaoBaoGoodsMapper.selectByActivityId"> |
| | | </association> |
| | | <association property="imageList" column="ar_id" |
| | | select="com.yeshi.fanli.dao.mybatis.activity.RecommendActivityImgMapper.getImgByActivityId"> |
| | | </association> |
| | | <association property="activityUser" column="ar_activity_uid" |
| | | resultMap="com.yeshi.fanli.dao.mybatis.activity.ActivityUserMapper.BaseResultMap" /> |
| | | |
| | | <association property="widthAndHeight" column="ar_id" |
| | | select="com.yeshi.fanli.dao.mybatis.activity.RecommendActivityImgMapper.getImgWithAndHeightByActivityId"> |
| | | </association> |
| | | |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List">ar_id,ar_title,ar_type,ar_order_by,ar_activity_uid,ar_share_count,ar_total_getmoney,ar_video_post_picture,ar_video_url,ar_create_time,ar_top,ar_start_time,ar_end_time,ar_state</sql> |
| | | |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long"> |
| | | select *,ar_activity_uid AS au_id from yeshi_ec_activity_recommend |
| | | where ar_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <association property="goodsList" column="ar_id" |
| | | select="com.yeshi.fanli.dao.mybatis.activity.RecommendActivityTaoBaoGoodsMapper.selectByActivityId"> |
| | | </association> |
| | | <association property="imageList" column="ar_id" |
| | | select="com.yeshi.fanli.dao.mybatis.activity.RecommendActivityImgMapper.getImgByActivityId"> |
| | | </association> |
| | | |
| | | <association property="widthAndHeight" column="ar_id" |
| | | select="com.yeshi.fanli.dao.mybatis.activity.RecommendActivityImgMapper.getImgWithAndHeightByActivityId"> |
| | | </association> |
| | | |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List">ar_id,ar_title,ar_type,ar_order_by,ar_activity_uid,ar_share_count,ar_total_getmoney,ar_video_post_picture,ar_video_url,ar_create_time,ar_top,ar_start_time,ar_end_time,ar_state |
| | | </sql> |
| | | |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select *,ar_activity_uid AS au_id from yeshi_ec_activity_recommend |
| | | where ar_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <select id="getRecommendActivityList" resultMap="BaseResultMap"> |
| | | SELECT *,IF(ar_start_time IS NULL,ar_create_time,ar_start_time) AS orderbyTime FROM yeshi_ec_activity_recommend |
| | | LEFT JOIN yeshi_ec_activity_user ON ar_activity_uid=au_id |
| | | WHERE IF(ar_start_time IS NULL,TRUE, ar_start_time<![CDATA[<=]]> NOW()) |
| | | AND IF(ar_end_time IS NULL,TRUE, ar_end_time <![CDATA[>=]]> NOW()) |
| | | ORDER BY ar_top DESC,ar_order_by ASC,orderbyTime DESC |
| | | SELECT *,IF(ar_start_time IS NULL,ar_create_time,ar_start_time) AS |
| | | orderbyTime FROM yeshi_ec_activity_recommend |
| | | LEFT JOIN yeshi_ec_activity_user ON ar_activity_uid=au_id |
| | | WHERE IF(ar_start_time IS NULL,TRUE, ar_start_time<![CDATA[<=]]> |
| | | NOW()) |
| | | AND IF(ar_end_time IS NULL,TRUE, ar_end_time <![CDATA[>=]]> |
| | | NOW()) |
| | | ORDER BY ar_top DESC,ar_order_by ASC,orderbyTime DESC |
| | | LIMIT #{start},#{count} |
| | | </select> |
| | | |
| | | <select id="getRecommendActivityEffectiveCount" resultType="java.lang.Long"> |
| | | SELECT count(ar_id) FROM yeshi_ec_activity_recommend |
| | | WHERE IF(ar_start_time IS NULL,TRUE, ar_start_time<![CDATA[<=]]> NOW()) |
| | | AND IF(ar_end_time IS NULL,TRUE, ar_end_time <![CDATA[>=]]> NOW()) |
| | | SELECT count(ar_id) FROM yeshi_ec_activity_recommend |
| | | WHERE IF(ar_start_time IS NULL,TRUE, ar_start_time<![CDATA[<=]]> |
| | | NOW()) |
| | | AND IF(ar_end_time IS NULL,TRUE, ar_end_time <![CDATA[>=]]> |
| | | NOW()) |
| | | </select> |
| | | |
| | | |
| | | <select id="queryRecommendActivityList" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_activity_recommend t |
| | | LEFT JOIN yeshi_ec_activity_user u ON t.ar_activity_uid=u.au_id |
| | | LEFT JOIN |
| | | yeshi_ec_activity_user u ON t.ar_activity_uid=u.au_id |
| | | WHERE 1=1 |
| | | <if test="title != null and title != '' "> |
| | | AND t.ar_title LIKE '%${title}%' |
| | | </if> |
| | | ORDER BY t.ar_top DESC,t.ar_order_by ASC,t.ar_create_time DESC |
| | | LIMIT ${start},${count} |
| | | <if test="title != null and title != '' "> |
| | | AND t.ar_title LIKE '%${title}%' |
| | | </if> |
| | | ORDER BY t.ar_top DESC,t.ar_order_by ASC,t.ar_create_time DESC |
| | | LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | <select id="getRecommendActivityCount" resultType="java.lang.Long"> |
| | | SELECT IFNULL(COUNT(t.ar_id),0) FROM yeshi_ec_activity_recommend t |
| | | WHERE 1=1 |
| | | <if test="title != null and title != '' "> |
| | | AND t.ar_title LIKE '%${title}%' |
| | | </if> |
| | | WHERE 1=1 |
| | | <if test="title != null and title != '' "> |
| | | AND t.ar_title LIKE '%${title}%' |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | |
| | | #{arids} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | |
| | | <select id="getNeedPublish" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_activity_recommend |
| | | LEFT JOIN yeshi_ec_activity_user ON ar_activity_uid= au_id |
| | | WHERE ar_state = 0 AND IF(ar_start_time IS NULL,TRUE, ar_start_time<![CDATA[<=]]> NOW()) |
| | | AND IF(ar_end_time IS NULL,TRUE, ar_end_time <![CDATA[>=]]> NOW()) |
| | | |
| | | |
| | | <select id="getNeedPublish" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_activity_recommend |
| | | LEFT JOIN yeshi_ec_activity_user ON ar_activity_uid= au_id |
| | | WHERE ar_state = 0 AND IF(ar_start_time IS NULL,TRUE, ar_start_time<![CDATA[<=]]> |
| | | NOW()) |
| | | AND IF(ar_end_time IS NULL,TRUE, ar_end_time <![CDATA[>=]]> |
| | | NOW()) |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_activity_recommend where ar_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.activity.RecommendActivity" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_activity_recommend (ar_id,ar_title,ar_type,ar_order_by,ar_activity_uid,ar_share_count,ar_total_getmoney,ar_video_post_picture,ar_video_url,ar_create_time,ar_top,ar_start_time,ar_end_time,ar_state) values (#{id,jdbcType=BIGINT},#{title,jdbcType=VARCHAR},#{type,jdbcType=INTEGER},#{orderBy,jdbcType=INTEGER},#{activityUser.id,jdbcType=BIGINT},#{shareCount,jdbcType=INTEGER},#{totalGetMoney,jdbcType=VARCHAR},#{videoPostPictire,jdbcType=VARCHAR},#{videoUrl,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{top,jdbcType=BOOLEAN},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.activity.RecommendActivity" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_activity_recommend |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">ar_id,</if> |
| | | <if test="title != null">ar_title,</if> |
| | | <if test="type != null">ar_type,</if> |
| | | <if test="orderBy != null">ar_order_by,</if> |
| | | <if test="activityUser != null">ar_activity_uid,</if> |
| | | <if test="shareCount != null">ar_share_count,</if> |
| | | <if test="totalGetMoney != null">ar_total_getmoney,</if> |
| | | <if test="videoPostPictire != null">ar_video_post_picture,</if> |
| | | <if test="videoUrl != null">ar_video_url,</if> |
| | | <if test="createTime != null">ar_create_time,</if> |
| | | <if test="top != null">ar_top,</if> |
| | | <if test="startTime != null">ar_start_time,</if> |
| | | <if test="endTime != null">ar_end_time,</if> |
| | | <if test="state != null">ar_state,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="title != null">#{title,jdbcType=VARCHAR},</if> |
| | | <if test="type != null">#{type,jdbcType=INTEGER},</if> |
| | | <if test="orderBy != null">#{orderBy,jdbcType=INTEGER},</if> |
| | | <if test="activityUser != null">#{activityUser.id,jdbcType=BIGINT},</if> |
| | | <if test="shareCount != null">#{shareCount,jdbcType=INTEGER},</if> |
| | | <if test="totalGetMoney != null">#{totalGetMoney,jdbcType=VARCHAR},</if> |
| | | <if test="videoPostPictire != null">#{videoPostPictire,jdbcType=VARCHAR},</if> |
| | | <if test="videoUrl != null">#{videoUrl,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="top != null">#{top,jdbcType=BOOLEAN},</if> |
| | | <if test="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.activity.RecommendActivity">update yeshi_ec_activity_recommend set ar_title = #{title,jdbcType=VARCHAR},ar_type = #{type,jdbcType=INTEGER},ar_order_by = #{orderBy,jdbcType=INTEGER},ar_activity_uid = #{activityUser.id,jdbcType=BIGINT},ar_share_count = #{shareCount,jdbcType=INTEGER},ar_total_getmoney = #{totalGetMoney,jdbcType=VARCHAR},ar_video_post_picture = #{videoPostPictire,jdbcType=VARCHAR},ar_video_url = #{videoUrl,jdbcType=VARCHAR},ar_create_time = #{createTime,jdbcType=TIMESTAMP},ar_top = #{top,jdbcType=BOOLEAN},ar_start_time = #{startTime,jdbcType=TIMESTAMP},ar_end_time = #{endTime,jdbcType=TIMESTAMP},ar_state = #{state,jdbcType=INTEGER} where ar_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.activity.RecommendActivity">update yeshi_ec_activity_recommend |
| | | <set> |
| | | <if test="title != null">ar_title=#{title,jdbcType=VARCHAR},</if> |
| | | <if test="type != null">ar_type=#{type,jdbcType=INTEGER},</if> |
| | | <if test="orderBy != null">ar_order_by=#{orderBy,jdbcType=INTEGER},</if> |
| | | <if test="activityUser != null">ar_activity_uid=#{activityUser.id,jdbcType=BIGINT},</if> |
| | | <if test="shareCount != null">ar_share_count=#{shareCount,jdbcType=INTEGER},</if> |
| | | <if test="totalGetMoney != null">ar_total_getmoney=#{totalGetMoney,jdbcType=VARCHAR},</if> |
| | | <if test="videoPostPictire != null">ar_video_post_picture=#{videoPostPictire,jdbcType=VARCHAR},</if> |
| | | <if test="videoUrl != null">ar_video_url=#{videoUrl,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">ar_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="top != null">ar_top=#{top,jdbcType=BOOLEAN},</if> |
| | | <if test="startTime != null">ar_start_time=#{startTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="state != null">ar_state=#{state,jdbcType=INTEGER},</if> |
| | | </set> where ar_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <update id="addShareCount"> |
| | | update yeshi_ec_activity_recommend r set |
| | | r.ar_share_count=ar_share_count+#{count} where ar_id=#{id} |
| | | </update> |
| | | |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_activity_recommend where ar_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" |
| | | parameterType="com.yeshi.fanli.entity.bus.activity.RecommendActivity" |
| | | useGeneratedKeys="true" keyProperty="id">insert into |
| | | yeshi_ec_activity_recommend |
| | | (ar_id,ar_title,ar_type,ar_order_by,ar_activity_uid,ar_share_count,ar_total_getmoney,ar_video_post_picture,ar_video_url,ar_create_time,ar_top,ar_start_time,ar_end_time,ar_state) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{title,jdbcType=VARCHAR},#{type,jdbcType=INTEGER},#{orderBy,jdbcType=INTEGER},#{activityUser.id,jdbcType=BIGINT},#{shareCount,jdbcType=INTEGER},#{totalGetMoney,jdbcType=VARCHAR},#{videoPostPictire,jdbcType=VARCHAR},#{videoUrl,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{top,jdbcType=BOOLEAN},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER}) |
| | | </insert> |
| | | <insert id="insertSelective" |
| | | parameterType="com.yeshi.fanli.entity.bus.activity.RecommendActivity" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into yeshi_ec_activity_recommend |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">ar_id,</if> |
| | | <if test="title != null">ar_title,</if> |
| | | <if test="type != null">ar_type,</if> |
| | | <if test="orderBy != null">ar_order_by,</if> |
| | | <if test="activityUser != null">ar_activity_uid,</if> |
| | | <if test="shareCount != null">ar_share_count,</if> |
| | | <if test="totalGetMoney != null">ar_total_getmoney,</if> |
| | | <if test="videoPostPictire != null">ar_video_post_picture,</if> |
| | | <if test="videoUrl != null">ar_video_url,</if> |
| | | <if test="createTime != null">ar_create_time,</if> |
| | | <if test="top != null">ar_top,</if> |
| | | <if test="startTime != null">ar_start_time,</if> |
| | | <if test="endTime != null">ar_end_time,</if> |
| | | <if test="state != null">ar_state,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="title != null">#{title,jdbcType=VARCHAR},</if> |
| | | <if test="type != null">#{type,jdbcType=INTEGER},</if> |
| | | <if test="orderBy != null">#{orderBy,jdbcType=INTEGER},</if> |
| | | <if test="activityUser != null">#{activityUser.id,jdbcType=BIGINT},</if> |
| | | <if test="shareCount != null">#{shareCount,jdbcType=INTEGER},</if> |
| | | <if test="totalGetMoney != null">#{totalGetMoney,jdbcType=VARCHAR},</if> |
| | | <if test="videoPostPictire != null">#{videoPostPictire,jdbcType=VARCHAR},</if> |
| | | <if test="videoUrl != null">#{videoUrl,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="top != null">#{top,jdbcType=BOOLEAN},</if> |
| | | <if test="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" |
| | | parameterType="com.yeshi.fanli.entity.bus.activity.RecommendActivity">update yeshi_ec_activity_recommend set ar_title = |
| | | #{title,jdbcType=VARCHAR},ar_type = |
| | | #{type,jdbcType=INTEGER},ar_order_by = |
| | | #{orderBy,jdbcType=INTEGER},ar_activity_uid = |
| | | #{activityUser.id,jdbcType=BIGINT},ar_share_count = |
| | | #{shareCount,jdbcType=INTEGER},ar_total_getmoney = |
| | | #{totalGetMoney,jdbcType=VARCHAR},ar_video_post_picture = |
| | | #{videoPostPictire,jdbcType=VARCHAR},ar_video_url = |
| | | #{videoUrl,jdbcType=VARCHAR},ar_create_time = |
| | | #{createTime,jdbcType=TIMESTAMP},ar_top = |
| | | #{top,jdbcType=BOOLEAN},ar_start_time = |
| | | #{startTime,jdbcType=TIMESTAMP},ar_end_time = |
| | | #{endTime,jdbcType=TIMESTAMP},ar_state = #{state,jdbcType=INTEGER} |
| | | where ar_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" |
| | | parameterType="com.yeshi.fanli.entity.bus.activity.RecommendActivity"> |
| | | update yeshi_ec_activity_recommend |
| | | <set> |
| | | <if test="title != null">ar_title=#{title,jdbcType=VARCHAR},</if> |
| | | <if test="type != null">ar_type=#{type,jdbcType=INTEGER},</if> |
| | | <if test="orderBy != null">ar_order_by=#{orderBy,jdbcType=INTEGER},</if> |
| | | <if test="activityUser != null">ar_activity_uid=#{activityUser.id,jdbcType=BIGINT},</if> |
| | | <if test="shareCount != null">ar_share_count=#{shareCount,jdbcType=INTEGER},</if> |
| | | <if test="totalGetMoney != null">ar_total_getmoney=#{totalGetMoney,jdbcType=VARCHAR},</if> |
| | | <if test="videoPostPictire != null">ar_video_post_picture=#{videoPostPictire,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="videoUrl != null">ar_video_url=#{videoUrl,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">ar_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="top != null">ar_top=#{top,jdbcType=BOOLEAN},</if> |
| | | <if test="startTime != null">ar_start_time=#{startTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="state != null">ar_state=#{state,jdbcType=INTEGER},</if> |
| | | </set> |
| | | where ar_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |