From 2c2837073e599812dc5a5f7d0605d7a61b6d270b Mon Sep 17 00:00:00 2001 From: 喻健 <喻健@Admin> Date: 星期四, 29 十一月 2018 17:29:29 +0800 Subject: [PATCH] 客服问题编辑 --- fanli/src/main/java/com/yeshi/fanli/mapping/customerservice/CustomerServiceCommonQuestionMapper.xml | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 51 insertions(+), 8 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/mapping/customerservice/CustomerServiceCommonQuestionMapper.xml b/fanli/src/main/java/com/yeshi/fanli/mapping/customerservice/CustomerServiceCommonQuestionMapper.xml index 45bdc48..db6c38a 100644 --- a/fanli/src/main/java/com/yeshi/fanli/mapping/customerservice/CustomerServiceCommonQuestionMapper.xml +++ b/fanli/src/main/java/com/yeshi/fanli/mapping/customerservice/CustomerServiceCommonQuestionMapper.xml @@ -10,12 +10,13 @@ <result column="cscq_content_type" property="contentType" jdbcType="VARCHAR" /> <result column="cscq_weight" property="weight" jdbcType="INTEGER" /> + <result column="cscq_state" property="state" jdbcType="VARCHAR"/> <result column="cscq_createtime" property="createTime" jdbcType="TIMESTAMP" /> <result column="cscq_updatetime" property="updateTime" jdbcType="TIMESTAMP" /> </resultMap> - <sql id="Base_Column_List">cscq_id,cscq_key,cscq_content,cscq_content_type,cscq_weight,cscq_createtime,cscq_updatetime + <sql id="Base_Column_List">cscq_id,cscq_key,cscq_content,cscq_content_type,cscq_weight,cscq_state,cscq_createtime,cscq_updatetime </sql> <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long"> @@ -51,10 +52,9 @@ </select> <select id="selectKeys" resultType="java.lang.String"> - select - cscq_key - from - yeshi_ec_customer_service_common_question order by cscq_weight desc + select cscq_key from yeshi_ec_customer_service_common_question + where cscq_state = 1 + order by cscq_weight desc </select> <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from @@ -65,9 +65,9 @@ parameterType="com.yeshi.fanli.entity.customerservice.CustomerServiceCommonQuestion" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_customer_service_common_question - (cscq_id,cscq_key,cscq_content,cscq_content_type,cscq_weight,cscq_createtime,cscq_updatetime) + (cscq_id,cscq_key,cscq_content,cscq_content_type,cscq_weight,cscq_state,cscq_createtime,cscq_updatetime) values - (#{id,jdbcType=BIGINT},#{key,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR},#{contentType,jdbcType=VARCHAR},#{weight,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP}) + (#{id,jdbcType=BIGINT},#{key,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR},#{contentType,jdbcType=VARCHAR},#{weight,jdbcType=INTEGER},#{state,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP}) </insert> <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.customerservice.CustomerServiceCommonQuestion" @@ -79,6 +79,7 @@ <if test="content != null">cscq_content,</if> <if test="contentType != null">cscq_content_type,</if> <if test="weight != null">cscq_weight,</if> + <if test="state != null">cscq_state,</if> <if test="createTime != null">cscq_createtime,</if> <if test="updateTime != null">cscq_updatetime,</if> </trim> @@ -89,6 +90,7 @@ <if test="content != null">#{content,jdbcType=VARCHAR},</if> <if test="contentType != null">#{contentType,jdbcType=VARCHAR},</if> <if test="weight != null">#{weight,jdbcType=INTEGER},</if> + <if test="state != null">#{state,jdbcType=VARCHAR},</if> <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> </trim> @@ -98,7 +100,8 @@ cscq_key = #{key,jdbcType=VARCHAR},cscq_content = #{content,jdbcType=VARCHAR},cscq_content_type = #{contentType,jdbcType=VARCHAR},cscq_weight = - #{weight,jdbcType=INTEGER},cscq_createtime = + #{weight,jdbcType=INTEGER}, + cscq_state =#{state,jdbcType=VARCHAR},cscq_createtime = #{createTime,jdbcType=TIMESTAMP},cscq_updatetime = #{updateTime,jdbcType=TIMESTAMP} where cscq_id = #{id,jdbcType=BIGINT} @@ -111,9 +114,49 @@ <if test="content != null">cscq_content=#{content,jdbcType=VARCHAR},</if> <if test="contentType != null">cscq_content_type=#{contentType,jdbcType=VARCHAR},</if> <if test="weight != null">cscq_weight=#{weight,jdbcType=INTEGER},</if> + <if test="state != null">cscq_state=#{state,jdbcType=VARCHAR},</if> <if test="createTime != null">cscq_createtime=#{createTime,jdbcType=TIMESTAMP},</if> <if test="updateTime != null">cscq_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if> </set> where cscq_id = #{id,jdbcType=BIGINT} </update> + + <select id="listQuery" resultMap="BaseResultMap"> + SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_customer_service_common_question + WHERE 1=1 + <if test='key != null and key != ""'> + AND (cscq_key like '%${key}%' or cscq_content like '%${key}%') + </if> + <if test='type != null and type != ""'> + AND cscq_content_type + </if> + ORDER BY + <if test="sort == 1"> + cscq_weight, + </if> + <if test="sort == 2"> + cscq_weight desc, + </if> + cscq_createtime desc + + LIMIT ${start},${count} + </select> + + <select id="countQuery" resultType="java.lang.Long"> + SELECT IFNULL(count(cscq_id),0) FROM yeshi_ec_customer_service_common_question + WHERE 1=1 + <if test='key != null and key != ""'> + AND (cscq_key like '%${key}%' or cscq_content like '%${key}%') + </if> + <if test='type != null and type != ""'> + AND cscq_content_type + </if> + </select> + + <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List"> + delete from yeshi_ec_customer_service_common_question WHERE cscq_id in + <foreach collection="list" item="item" open="(" close=")" + separator=",">#{item}</foreach> + </delete> + </mapper> -- Gitblit v1.8.0