From 554de444b87aab5f93cb1593a8095612cf9479a7 Mon Sep 17 00:00:00 2001 From: yujian <yujian@163.com> Date: 星期二, 09 六月 2020 17:34:30 +0800 Subject: [PATCH] 订单 --- fanli/src/main/java/com/yeshi/fanli/mapping/help/HelpCenterMapper.xml | 43 ++++++++++++++++++++++++++++++------------- 1 files changed, 30 insertions(+), 13 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/mapping/help/HelpCenterMapper.xml b/fanli/src/main/java/com/yeshi/fanli/mapping/help/HelpCenterMapper.xml index 0c861bc..3456f62 100644 --- a/fanli/src/main/java/com/yeshi/fanli/mapping/help/HelpCenterMapper.xml +++ b/fanli/src/main/java/com/yeshi/fanli/mapping/help/HelpCenterMapper.xml @@ -6,28 +6,33 @@ <id column="h_id" property="id" jdbcType="BIGINT"/> <result column="h_title" property="title" jdbcType="VARCHAR"/> <result column="h_weight" property="weight" jdbcType="INTEGER"/> + <result column="h_state" property="state" jdbcType="INTEGER"/> + <result column="h_start_time" property="startTime" jdbcType="TIMESTAMP"/> + <result column="h_end_time" property="endTime" jdbcType="TIMESTAMP"/> <result column="h_createtime" property="createtime" jdbcType="TIMESTAMP"/> <result column="h_updatetime" property="updatetime" jdbcType="TIMESTAMP"/> - <association property="helpClass" column="h_cid" javaType="com.yeshi.fanli.entity.bus.help.HelpClass"> <id column="h_cid" property="id" jdbcType="BIGINT" /> <id column="hc_name" property="name" jdbcType="VARCHAR" /> </association> - </resultMap> - <sql id="Base_Column_List">h_id,h_title,h_weight,h_cid,h_createtime,h_updatetime</sql> + + <sql id="Base_Column_List">h_id,h_title,h_weight,h_state,h_cid,h_start_time,h_end_time,h_createtime,h_updatetime</sql> <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select <include refid="Base_Column_List"/>from yeshi_ec_help_center where h_id = #{id,jdbcType=BIGINT} </select> <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_help_center where h_id = #{id,jdbcType=BIGINT}</delete> - <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.help.HelpCenter" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_help_center (h_id,h_title,h_weight,h_cid,h_createtime,h_updatetime) values (#{id,jdbcType=BIGINT},#{title,jdbcType=VARCHAR},#{weight,jdbcType=INTEGER},#{helpClass.id,jdbcType=BIGINT},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert> + <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.help.HelpCenter" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_help_center (h_id,h_title,h_weight,h_state,h_cid,h_start_time,h_end_time,h_createtime,h_updatetime) values (#{id,jdbcType=BIGINT},#{title,jdbcType=VARCHAR},#{weight,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{helpClass.id,jdbcType=BIGINT},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert> <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.help.HelpCenter" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_help_center <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null">h_id,</if> <if test="title != null">h_title,</if> <if test="weight != null">h_weight,</if> + <if test="state != null">h_state,</if> <if test="helpClass != null">h_cid,</if> + <if test="startTime != null">h_start_time,</if> + <if test="endTime != null">h_end_time,</if> <if test="createtime != null">h_createtime,</if> <if test="updatetime != null">h_updatetime,</if> </trim>values @@ -35,17 +40,23 @@ <if test="id != null">#{id,jdbcType=BIGINT},</if> <if test="title != null">#{title,jdbcType=VARCHAR},</if> <if test="weight != null">#{weight,jdbcType=INTEGER},</if> + <if test="state != null">#{state,jdbcType=INTEGER},</if> <if test="helpClass != null">#{helpClass.id,jdbcType=BIGINT},</if> + <if test="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if> + <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if> <if test="createtime != null">#{createtime,jdbcType=TIMESTAMP},</if> <if test="updatetime != null">#{updatetime,jdbcType=TIMESTAMP},</if> </trim> </insert> - <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.help.HelpCenter">update yeshi_ec_help_center set h_title = #{title,jdbcType=VARCHAR},h_weight = #{weight,jdbcType=INTEGER},h_cid = #{helpClass.id,jdbcType=BIGINT},h_createtime = #{createtime,jdbcType=TIMESTAMP},h_updatetime = #{updatetime,jdbcType=TIMESTAMP} where h_id = #{id,jdbcType=BIGINT}</update> + <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.help.HelpCenter">update yeshi_ec_help_center set h_title = #{title,jdbcType=VARCHAR},h_weight = #{weight,jdbcType=INTEGER},h_state = #{state,jdbcType=INTEGER},h_cid = #{helpClass.id,jdbcType=BIGINT},h_start_time = #{startTime,jdbcType=TIMESTAMP},h_end_time = #{endTime,jdbcType=TIMESTAMP},h_createtime = #{createtime,jdbcType=TIMESTAMP},h_updatetime = #{updatetime,jdbcType=TIMESTAMP} where h_id = #{id,jdbcType=BIGINT}</update> <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.help.HelpCenter">update yeshi_ec_help_center <set> <if test="title != null">h_title=#{title,jdbcType=VARCHAR},</if> <if test="weight != null">h_weight=#{weight,jdbcType=INTEGER},</if> + <if test="state != null">h_state=#{state,jdbcType=INTEGER},</if> <if test="helpClass != null">h_cid=#{helpClass.id,jdbcType=BIGINT},</if> + <if test="startTime != null">h_start_time=#{startTime,jdbcType=TIMESTAMP},</if> + <if test="endTime != null">h_end_time=#{endTime,jdbcType=TIMESTAMP},</if> <if test="createtime != null">h_createtime=#{createtime,jdbcType=TIMESTAMP},</if> <if test="updatetime != null">h_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if> </set> where h_id = #{id,jdbcType=BIGINT} @@ -62,6 +73,9 @@ AND ht.h_cid = #{cid} </if> + <if test='state != null'> + AND ht.h_state = #{state} + </if> <if test='orderMode == 1'> ORDER BY ht.h_weight DESC </if> @@ -96,21 +110,24 @@ <if test='cid != null'> AND h_cid = #{cid} </if> + <if test='state != null'> + AND ht.h_state = #{state} + </if> </select> - <select id="queryIdAndTitle" resultMap="BaseResultMap"> - <!-- 鏍规嵁鏉′欢鏌ヨ鎵�鏈夋爣绛� --> - SELECT h_id, h_title FROM yeshi_ec_help_center - WHERE 1=1 - <if test='key != null and key != ""'> + <select id="listValid" resultMap="BaseResultMap"> + SELECT h_id, h_title FROM yeshi_ec_help_center + WHERE h_id > #{pageId} AND h_state = 1 + AND IF(h_start_time IS NULL,TRUE, h_start_time<![CDATA[<=]]>NOW()) + AND IF(h_end_time IS NULL,TRUE, h_end_time >=NOW()) + <if test='key != null and key != ""'> AND h_title like '%${key}%' </if> <if test='cid != null'> AND h_cid = #{cid} </if> - ORDER BY h_weight DESC, h_createtime - - LIMIT ${start},${count} + ORDER BY h_weight DESC + LIMIT ${count} </select> <delete id="deleteBatchById" parameterType="int"> -- Gitblit v1.8.0