123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- <?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.kmall.admin.dao.FeedbackDao">
- <resultMap type="com.kmall.admin.entity.FeedbackEntity" id="feedbackMap">
- <result property="msgId" column="msg_id"/>
- <result property="userId" column="user_id"/>
- <result property="userName" column="user_name"/>
- <result property="mobile" column="mobile"/>
- <result property="feedType" column="feed_Type"/>
- <result property="content" column="content"/>
- <result property="status" column="status"/>
- <result property="addTime" column="add_time"/>
- <result property="merchSn" column="merch_sn"/>
- <result property="storeId" column="store_id"/>
- <result property="storeName" column="store_name"/>
- </resultMap>
- <select id="queryObject" resultType="com.kmall.admin.entity.FeedbackEntity">
- select
- `msg_id`,
- `user_id`,
- `merch_sn`,
- `store_id`,
- `user_name`,
- `mobile`,
- `feed_Type`,
- `content`,
- `status`,
- `add_time`
- from mall_feedback
- where msg_id = #{id}
- </select>
- <select id="queryList" resultType="com.kmall.admin.entity.FeedbackEntity">
- select
- msg_id,
- user_id,
- f.merch_sn,
- f.store_id,
- user_name,
- `mobile`,
- `feed_Type`,
- `content`,
- `status`,
- `add_time`,
- s.store_name
- from mall_feedback f left join mall_store s on f.store_id = s.id
- WHERE 1=1
- <if test="userName != null and userName.trim() != ''">
- AND user_name LIKE concat('%',#{userName},'%')
- </if>
- <if test="storeId != null and storeId != '' ">
- AND f.store_id = #{storeId}
- </if>
- <if test="merchSn != null and merchSn.trim() != '' ">
- AND f.merch_sn = #{merchSn}
- </if>
- <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
- AND s.third_party_merch_code = #{thirdPartyMerchCode}
- </if>
- <choose>
- <when test="sidx != null and sidx.trim() != ''">
- order by ${sidx} ${order}
- </when>
- <otherwise>
- order by msg_id desc
- </otherwise>
- </choose>
- <if test="offset != null and limit != null">
- limit #{offset}, #{limit}
- </if>
- </select>
- <select id="queryTotal" resultType="int">
- select count(*) from mall_feedback f left join mall_store s on f.store_id = s.id
- WHERE 1=1
- <if test="userName != null and userName.trim() != ''">
- AND f.user_name LIKE concat('%',#{userName},'%')
- </if>
- <if test="storeId != null and storeId != '' ">
- AND f.store_id = #{storeId}
- </if>
- <if test="merchSn != null and merchSn.trim() != '' ">
- AND f.merch_sn = #{merchSn}
- </if>
- <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
- AND s.third_party_merch_code = #{thirdPartyMerchCode}
- </if>
- </select>
- <insert id="save" parameterType="com.kmall.admin.entity.FeedbackEntity" useGeneratedKeys="true" keyProperty="msgId">
- insert into mall_feedback(
- `user_id`,
- `user_name`,
- `mobile`,
- `feed_Type`,
- `content`,
- `status`,
- `add_time`)
- values(
- #{userId},
- #{userName},
- #{mobile},
- #{feedType},
- #{content},
- #{status},
- #{addTime})
- </insert>
- <update id="update" parameterType="com.kmall.admin.entity.FeedbackEntity">
- update mall_feedback
- <set>
- <if test="userId != null">`user_id` = #{userId}, </if>
- <if test="userName != null">`user_name` = #{userName}, </if>
- <if test="mobile != null">`mobile` = #{mobile}, </if>
- <if test="feedType != null">`feed_Type` = #{feedType}, </if>
- <if test="content != null">`content` = #{content}, </if>
- <if test="status != null">`status` = #{status}, </if>
- <if test="addTime != null">`add_time` = #{addTime}</if>
- </set>
- where msg_id = #{msgId}
- </update>
- <delete id="delete">
- delete from mall_feedback where msg_id = #{value}
- </delete>
- <delete id="deleteBatch">
- delete from mall_feedback where msg_id in
- <foreach item="msgId" collection="array" open="(" separator="," close=")">
- #{msgId}
- </foreach>
- </delete>
- </mapper>
|