From 51a4ff5d777028d52a19c314a99f796334cb7b51 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期六, 23 十一月 2019 18:30:01 +0800 Subject: [PATCH] 配置文件修改 --- fanli/src/main/java/com/yeshi/fanli/mapping/msg/UserSystemMsgMapper.xml | 68 +++++++++++++++++++++++++++++---- 1 files changed, 59 insertions(+), 9 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/mapping/msg/UserSystemMsgMapper.xml b/fanli/src/main/java/com/yeshi/fanli/mapping/msg/UserSystemMsgMapper.xml index 87d9e06..4da0aa1 100644 --- a/fanli/src/main/java/com/yeshi/fanli/mapping/msg/UserSystemMsgMapper.xml +++ b/fanli/src/main/java/com/yeshi/fanli/mapping/msg/UserSystemMsgMapper.xml @@ -13,12 +13,13 @@ <result column="ms_time_tag" property="timeTag" jdbcType="INTEGER" /> <result column="ms_create_time" property="createTime" jdbcType="TIMESTAMP" /> <result column="ms_update_time" property="updateTime" jdbcType="TIMESTAMP" /> - <association property="user" column="ms_uid"> + <association property="user" column="ms_uid" + javaType="com.yeshi.fanli.entity.bus.user.UserInfo"> <id column="ms_uid" property="id" jdbcType="BIGINT" /> </association> - <association property="systemZNX" column="ms_system_znx_id"> - <id column="ms_system_znx_id" property="id" jdbcType="BIGINT" /> + <association property="systemZNX" column="ms_system_znx_id" + select="com.yeshi.fanli.dao.mybatis.msg.SystemZnxMapper.selectByPrimaryKey"> </association> </resultMap> @@ -28,20 +29,62 @@ parameterType="java.lang.Long"> select <include refid="Base_Column_List" /> - from yeshi_ec_msg_system where ms_id = #{id,jdbcType=BIGINT} + from yeshi_ec_user_msg_system where ms_id = #{id,jdbcType=BIGINT} </select> + + + <select id="listByUid" resultMap="BaseResultMap"> + select + <include refid="Base_Column_List" /> + from yeshi_ec_user_msg_system where ms_uid = #{uid,jdbcType=BIGINT} + order by ms_create_time desc limit #{start},#{count} + </select> + + <select id="countByUid" resultType="java.lang.Long" + parameterType="java.lang.Long"> + select + count(ms_id) + from yeshi_ec_user_msg_system where + ms_uid = + #{uid,jdbcType=BIGINT} + </select> + + + <select id="selectBySystemZNXId" resultMap="BaseResultMap" + parameterType="java.lang.Long"> + select + <include refid="Base_Column_List" /> + from yeshi_ec_user_msg_system where ms_system_znx_id = + #{id,jdbcType=BIGINT} and ms_uid=#{uid} + </select> + + + + <select id="selectLatestUserSystemMsg" resultMap="BaseResultMap" + parameterType="java.lang.Long"> + select + <include refid="Base_Column_List" /> + from yeshi_ec_user_msg_system where ms_uid = #{uid} order by + ms_create_time desc limit 1 + </select> + + + + + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from - yeshi_ec_msg_system where ms_id = #{id,jdbcType=BIGINT} + yeshi_ec_user_msg_system where ms_id = #{id,jdbcType=BIGINT} </delete> <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.msg.UserSystemMsg" - useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_msg_system + useGeneratedKeys="true" keyProperty="id">insert into + yeshi_ec_user_msg_system (ms_id,ms_uid,ms_type,ms_system_znx_id,ms_read,ms_solved,ms_title,ms_content,ms_time_tag,ms_create_time,ms_update_time) values (#{id,jdbcType=BIGINT},#{user.id,jdbcType=BIGINT},#{type,jdbcType=VARCHAR},#{systemZNX.id,jdbcType=BIGINT},#{read,jdbcType=BOOLEAN},#{solved,jdbcType=BOOLEAN},#{title,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR},#{timeTag,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP}) </insert> <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.msg.UserSystemMsg" useGeneratedKeys="true" keyProperty="id"> - insert into yeshi_ec_msg_system + insert into yeshi_ec_user_msg_system <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null">ms_id,</if> <if test="user != null">ms_uid,</if> @@ -71,7 +114,8 @@ </trim> </insert> <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.msg.UserSystemMsg">update - yeshi_ec_msg_system set ms_uid = #{user.id,jdbcType=BIGINT},ms_type = + yeshi_ec_user_msg_system set ms_uid = + #{user.id,jdbcType=BIGINT},ms_type = #{type,jdbcType=VARCHAR},ms_system_znx_id = #{systemZNX.id,jdbcType=BIGINT},ms_read = #{read,jdbcType=BOOLEAN},ms_solved = @@ -83,7 +127,7 @@ #{updateTime,jdbcType=TIMESTAMP} where ms_id = #{id,jdbcType=BIGINT} </update> <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.msg.UserSystemMsg"> - update yeshi_ec_msg_system + update yeshi_ec_user_msg_system <set> <if test="user != null">ms_uid=#{user.id,jdbcType=BIGINT},</if> <if test="type != null">ms_type=#{type,jdbcType=VARCHAR},</if> @@ -98,4 +142,10 @@ </set> where ms_id = #{id,jdbcType=BIGINT} </update> + + + <update id="setMsgReadByUid" parameterType="java.lang.Long"> + update + yeshi_ec_user_msg_system set ms_read=1 where ms_uid=#{0} + </update> </mapper> -- Gitblit v1.8.0