| | |
| | | <result column="pre_start_time" property="preStartTime" jdbcType="TIMESTAMP"/> |
| | | <result column="actual_start_time" property="actualStartTime" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">id, app_id, sponsor_id, `name`, material_poster, material_tag_image, material_, `desc`, max_person_count,current_person_count, state, state_remarks, pre_finish_time,actual_finish_time, pre_open_time,actual_open_time, create_time, update_time,`state`,pre_start_time,actual_start_time</sql> |
| | | <sql id="Base_Column_List">id, app_id, sponsor_id, `name`, material_poster, material_tag_image, material_, `desc`, max_person_count,current_person_count, state, state_remarks, pre_finish_time,actual_finish_time, pre_open_time,actual_open_time, create_time, update_time,pre_start_time,actual_start_time</sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">select |
| | | <include refid="Base_Column_List"/> |
| | | from lucky_activity where id = #{id,jdbcType=BIGINT} |
| | |
| | | <delete id="deleteByPrimaryKey" |
| | | parameterType="java.lang.Long">delete from lucky_activity where id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" useGeneratedKeys="true" keyProperty="id" |
| | | parameterType="com.ks.lucky.pojo.DO.LuckyActivity">insert into lucky_activity (id, app_id, sponsor_id, `name`, material_poster, material_tag_image, material_, `desc`, max_person_count, current_person_count, state, state_remarks, pre_finish_time,actual_finish_time, pre_open_time, actual_open_time,create_time, update_time,id,`state`,pre_start_time,actual_start_time) values (#{id,jdbcType=BIGINT}, #{appId,jdbcType=BIGINT}, #{sponsorId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{materialPoster,jdbcType=VARCHAR}, #{materialTagImage,jdbcType=VARCHAR}, #{material,jdbcType=VARCHAR}, #{desc,jdbcType=VARCHAR}, #{maxPersonCount,jdbcType=INTEGER}, #{currentPersonCount,jdbcType=INTEGER}, #{state,jdbcType=INTEGER}, #{stateRemarks,jdbcType=VARCHAR}, #{preFinishTime,jdbcType=TIMESTAMP}, #{actualFinishTime,jdbcType=TIMESTAMP}, #{preOpenTime,jdbcType=TIMESTAMP}, #{actualOpenTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},#{id,jdbcType=BIGINT},#{state,jdbcType=INTEGER},#{preStartTime,jdbcType=TIMESTAMP},#{actualStartTime,jdbcType=TIMESTAMP})</insert> |
| | | parameterType="com.ks.lucky.pojo.DO.LuckyActivity">insert into lucky_activity (id, app_id, sponsor_id, `name`, material_poster, material_tag_image, material_, `desc`, max_person_count, current_person_count, state, state_remarks, pre_finish_time,actual_finish_time, pre_open_time, actual_open_time,create_time, update_time,id,pre_start_time,actual_start_time) values (#{id,jdbcType=BIGINT}, #{appId,jdbcType=BIGINT}, #{sponsorId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{materialPoster,jdbcType=VARCHAR}, #{materialTagImage,jdbcType=VARCHAR}, #{material,jdbcType=VARCHAR}, #{desc,jdbcType=VARCHAR}, #{maxPersonCount,jdbcType=INTEGER}, #{currentPersonCount,jdbcType=INTEGER}, #{state,jdbcType=INTEGER}, #{stateRemarks,jdbcType=VARCHAR}, #{preFinishTime,jdbcType=TIMESTAMP}, #{actualFinishTime,jdbcType=TIMESTAMP}, #{preOpenTime,jdbcType=TIMESTAMP}, #{actualOpenTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},#{id,jdbcType=BIGINT},#{preStartTime,jdbcType=TIMESTAMP},#{actualStartTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" |
| | | parameterType="com.ks.lucky.pojo.DO.LuckyActivity">insert into lucky_activity |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="actualOpenTime != null">actual_open_time,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | <if test="state != null">`state`,</if> |
| | | <if test="preStartTime != null">pre_start_time,</if> |
| | | <if test="actualStartTime != null">actual_start_time,</if> |
| | | </trim> |
| | |
| | | <if test="actualOpenTime != null">#{actualOpenTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="state != null">#{state,jdbcType=INTEGER}</if> |
| | | <if test="preStartTime != null">#{preStartTime,jdbcType=TIMESTAMP}</if> |
| | | <if test="actualStartTime != null">#{actualStartTime,jdbcType=TIMESTAMP}</if> |
| | | <if test="preStartTime != null">#{preStartTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="actualStartTime != null">#{actualStartTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.ks.lucky.pojo.DO.LuckyActivity">update lucky_activity |
| | |
| | | <if test="actualOpenTime != null">actual_open_time = #{actualOpenTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="createTime != null">create_time = #{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="state !=null">`state` =#{state,jdbcType=INTEGER},</if> |
| | | <if test="preStartTime !=null">pre_start_time =#{preStartTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="actualStartTime !=null">actual_start_time =#{actualStartTime,jdbcType=TIMESTAMP},</if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.ks.lucky.pojo.DO.LuckyActivity"> |
| | | update lucky_activity set app_id = #{appId,jdbcType=BIGINT}, sponsor_id = #{sponsorId,jdbcType=BIGINT}, `name` = #{name,jdbcType=VARCHAR}, material_poster = #{materialPoster,jdbcType=VARCHAR}, material_tag_image = #{materialTagImage,jdbcType=VARCHAR}, material_ = #{material,jdbcType=VARCHAR}, `desc` = #{desc,jdbcType=VARCHAR}, max_person_count = #{maxPersonCount,jdbcType=INTEGER}, current_person_count = #{currentPersonCount,jdbcType=INTEGER}, state = #{state,jdbcType=INTEGER}, state_remarks = #{stateRemarks,jdbcType=VARCHAR}, pre_finish_time = #{preFinishTime,jdbcType=TIMESTAMP}, actual_finish_time = #{actualFinishTime,jdbcType=TIMESTAMP}, pre_open_time = #{preOpenTime,jdbcType=TIMESTAMP}, actual_open_time = #{actualOpenTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP} ,`state` =#{state,jdbcType=INTEGER} ,pre_start_time =#{preStartTime,jdbcType=TIMESTAMP} ,actual_start_time =#{actualStartTime,jdbcType=TIMESTAMP} where id = #{id,jdbcType=BIGINT}</update> |
| | | update lucky_activity set app_id = #{appId,jdbcType=BIGINT}, sponsor_id = #{sponsorId,jdbcType=BIGINT}, `name` = #{name,jdbcType=VARCHAR}, material_poster = #{materialPoster,jdbcType=VARCHAR}, material_tag_image = #{materialTagImage,jdbcType=VARCHAR}, material_ = #{material,jdbcType=VARCHAR}, `desc` = #{desc,jdbcType=VARCHAR}, max_person_count = #{maxPersonCount,jdbcType=INTEGER}, current_person_count = #{currentPersonCount,jdbcType=INTEGER}, state = #{state,jdbcType=INTEGER}, state_remarks = #{stateRemarks,jdbcType=VARCHAR}, pre_finish_time = #{preFinishTime,jdbcType=TIMESTAMP}, actual_finish_time = #{actualFinishTime,jdbcType=TIMESTAMP}, pre_open_time = #{preOpenTime,jdbcType=TIMESTAMP}, actual_open_time = #{actualOpenTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP} ,pre_start_time =#{preStartTime,jdbcType=TIMESTAMP} ,actual_start_time =#{actualStartTime,jdbcType=TIMESTAMP} where id = #{id,jdbcType=BIGINT}</update> |
| | | <sql id="queryWhere"> |
| | | <if test="query.key!=null">and `name` like '${query.key}%'</if> |
| | | <if test="query.appId!=null">and app_id=#{query.appId}</if> |
| | |
| | | <foreach collection="query.stateList" item="state" open=" and (" close=")" separator=" or ">state=#{state} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="query.excludeActivityIds!=null"> |
| | | <foreach collection="query.excludeActivityIds" item="activityId" open=" and (" close=")" separator=" and ">id!=#{activityId} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="query.minCreateTime!=null">and create_time>=#{query.minCreateTime}</if> |
| | | <if test="query.maxCreateTime!=null">and #{query.maxCreateTime}>create_time</if> |
| | | <if test="query.minStartTime!=null">and pre_start_time>=#{query.minStartTime}</if> |
| | |
| | | <include refid="Base_Column_List"/> |
| | | from lucky_activity where 1=1 |
| | | <include refid="queryWhere"/> |
| | | <if test="query.sort!=null">order by #{query.sort}</if> |
| | | <if test="query.sortList!=null"> |
| | | <foreach collection="query.sortList" item="item" separator="," open=" order by "> |
| | | ${item} |
| | | </foreach> |
| | | </if> |
| | | limit #{query.start},#{query.count} |
| | | </select> |
| | | <select id="count" resultType="java.lang.Long">select count(*) from lucky_activity where 1=1 |