<?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.yeshi.fanli.dao.mybatis.msg.MsgMoneyDetailMapper">
|
<resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail">
|
<id column="mm_id" property="id" jdbcType="BIGINT" />
|
<result column="mm_type" property="msgType"
|
typeHandler="com.yeshi.fanli.util.mybatishandler.msg.MsgTypeMoneyTypeEnumHandler" />
|
<result column="mm_order_count" property="orderCount" jdbcType="INTEGER" />
|
<result column="mm_goods_count" property="goodsCount" jdbcType="INTEGER" />
|
<result column="mm_order_id" property="orderId" jdbcType="VARCHAR" />
|
<result column="mm_money" property="money" jdbcType="DECIMAL" />
|
<result column="mm_balance" property="balance" jdbcType="DECIMAL" />
|
<result column="mm_state_desc" property="stateDesc" jdbcType="VARCHAR" />
|
<result column="mm_beizhu" property="beiZhu" jdbcType="VARCHAR" />
|
<result column="mm_create_time" property="createTime" jdbcType="TIMESTAMP" />
|
<result column="mm_update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
<result column="mm_read" property="read" jdbcType="BOOLEAN" />
|
<result column="mm_order_type" property="orderType" jdbcType="INTEGER" />
|
<result column="mm_desc" property="desc" jdbcType="VARCHAR" />
|
<result column="mm_content" property="content" jdbcType="VARCHAR" />
|
<result column="extraInfo" property="extraInfo" jdbcType="VARCHAR"/>
|
<association property="user" column="mm_uid"
|
javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
|
<id column="mm_uid" property="id" jdbcType="BIGINT" />
|
</association>
|
<association property="extract" column="mm_source_id_extract"
|
select="com.yeshi.fanli.dao.mybatis.ExtractMapper.selectByPrimaryKey" />
|
<association property="alipayAccountValid" column="mm_source_id_alipayvalid"
|
select="com.yeshi.fanli.dao.mybatis.AlipayAccountValidNormalHistoryMapper.selectByPrimaryKey" />
|
</resultMap>
|
<sql id="Base_Column_List">mm_id,mm_uid,mm_type,mm_order_count,mm_goods_count,mm_order_id,mm_source_id,mm_money,mm_balance,mm_state_desc,mm_beizhu,mm_create_time,mm_update_time,mm_read,mm_order_type,mm_desc,mm_content
|
</sql>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_msg_money where mm_id = #{id,jdbcType=BIGINT}
|
</select>
|
<select id="selectBySourceIdAndMsgType" resultMap="BaseResultMap">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_msg_money where mm_source_id =
|
#{sourceId,jdbcType=BIGINT} and mm_type=#{type}
|
</select>
|
<select id="listByUid" resultMap="BaseResultMap">
|
select d.*, d.mm_source_id as mm_source_id_extract, d.mm_source_id as mm_source_id_alipayvalid
|
,t.`mea_content` AS extraInfo from yeshi_ec_msg_money d
|
LEFT JOIN `yeshi_ec_msg_extra` t ON (t.`mea_rid` = d.`mm_id` AND t.`mea_type` = 'money')
|
where d.mm_uid =#{uid,jdbcType=BIGINT} order by d.mm_update_time desc
|
limit #{start},#{count}
|
</select>
|
<select id="countByUid" resultType="java.lang.Long"
|
parameterType="java.lang.Long">select count(mm_id) from yeshi_ec_msg_money where mm_uid
|
= #{uid,jdbcType=BIGINT}
|
</select>
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
yeshi_ec_msg_money where mm_id = #{id,jdbcType=BIGINT}
|
</delete>
|
<insert id="insert" parameterType="com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail"
|
useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_msg_money
|
(mm_id,mm_uid,mm_type,mm_order_count,mm_goods_count,mm_order_id,mm_source_id,mm_money,mm_balance,mm_state_desc,mm_beizhu,mm_create_time,mm_update_time,mm_read,mm_order_type,mm_desc,mm_content)
|
values
|
(#{id,jdbcType=BIGINT},#{user.id,jdbcType=BIGINT},#{msgType,jdbcType=VARCHAR},#{orderCount,jdbcType=INTEGER},#{goodsCount,jdbcType=INTEGER},#{orderId,jdbcType=VARCHAR},#{extract.id,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{balance,jdbcType=DECIMAL},#{stateDesc,jdbcType=VARCHAR},#{beiZhu,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{read,jdbcType=BOOLEAN},#{orderType,jdbcType=INTEGER},#{desc,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR})
|
</insert>
|
<insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail"
|
useGeneratedKeys="true" keyProperty="id">
|
insert into yeshi_ec_msg_money
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">mm_id,</if>
|
<if test="user != null">mm_uid,</if>
|
<if test="msgType != null">mm_type,</if>
|
<if test="orderCount != null">mm_order_count,</if>
|
<if test="goodsCount != null">mm_goods_count,</if>
|
<if test="orderId != null">mm_order_id,</if>
|
<if test="extract != null">mm_source_id,</if>
|
<if test="alipayAccountValid != null">mm_source_id,</if>
|
<if test="money != null">mm_money,</if>
|
<if test="balance != null">mm_balance,</if>
|
<if test="stateDesc != null">mm_state_desc,</if>
|
<if test="beiZhu != null">mm_beizhu,</if>
|
<if test="createTime != null">mm_create_time,</if>
|
<if test="updateTime != null">mm_update_time,</if>
|
<if test="read != null">mm_read,</if>
|
<if test="orderType != null">mm_order_type,</if>
|
<if test="desc != null">mm_desc,</if>
|
<if test="content != null">mm_content,</if>
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id,jdbcType=BIGINT},</if>
|
<if test="user != null">#{user.id,jdbcType=BIGINT},</if>
|
<if test="msgType != null">#{msgType,jdbcType=VARCHAR},</if>
|
<if test="orderCount != null">#{orderCount,jdbcType=INTEGER},</if>
|
<if test="goodsCount != null">#{goodsCount,jdbcType=INTEGER},</if>
|
<if test="orderId != null">#{orderId,jdbcType=VARCHAR},</if>
|
<if test="extract != null">#{extract.id,jdbcType=BIGINT},</if>
|
<if test="alipayAccountValid != null">#{alipayAccountValid.id,jdbcType=BIGINT},</if>
|
<if test="money != null">#{money,jdbcType=DECIMAL},</if>
|
<if test="balance != null">#{balance,jdbcType=DECIMAL},</if>
|
<if test="stateDesc != null">#{stateDesc,jdbcType=VARCHAR},</if>
|
<if test="beiZhu != null">#{beiZhu,jdbcType=VARCHAR},</if>
|
<if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
|
<if test="read != null">#{read,jdbcType=BOOLEAN},</if>
|
<if test="orderType != null">#{orderType,jdbcType=INTEGER}</if>
|
<if test="desc != null">#{desc,jdbcType=VARCHAR},</if>
|
<if test="content != null">#{content,jdbcType=VARCHAR},</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail">update
|
yeshi_ec_msg_money set mm_uid = #{user.id,jdbcType=BIGINT},mm_type =
|
#{msgType,jdbcType=VARCHAR},mm_order_count =
|
#{orderCount,jdbcType=INTEGER},mm_goods_count =
|
#{goodsCount,jdbcType=INTEGER},mm_order_id =
|
#{orderId,jdbcType=VARCHAR},mm_source_id =
|
#{extract.id,jdbcType=BIGINT},mm_money =
|
#{money,jdbcType=DECIMAL},mm_balance =
|
#{balance,jdbcType=DECIMAL},mm_state_desc =
|
#{stateDesc,jdbcType=VARCHAR},mm_beizhu =
|
#{beiZhu,jdbcType=VARCHAR},mm_create_time =
|
#{createTime,jdbcType=TIMESTAMP},mm_update_time =
|
#{updateTime,jdbcType=TIMESTAMP},mm_read = #{read,jdbcType=BOOLEAN}
|
,mm_order_type =#{orderType,jdbcType=INTEGER},
|
mm_desc = #{desc,jdbcType=VARCHAR},
|
mm_content = #{content,jdbcType=VARCHAR} where mm_id =
|
#{id,jdbcType=BIGINT}
|
</update>
|
<update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail">
|
update yeshi_ec_msg_money
|
<set>
|
<if test="user != null">mm_uid=#{user.id,jdbcType=BIGINT},</if>
|
<if test="msgType != null">mm_type=#{msgType,jdbcType=VARCHAR},</if>
|
<if test="orderCount != null">mm_order_count=#{orderCount,jdbcType=INTEGER},</if>
|
<if test="goodsCount != null">mm_goods_count=#{goodsCount,jdbcType=INTEGER},</if>
|
<if test="orderId != null">mm_order_id=#{orderId,jdbcType=VARCHAR},</if>
|
<if test="extract != null">mm_source_id=#{extract.id,jdbcType=BIGINT},</if>
|
<if test="alipayAccountValid != null">mm_source_id=#{alipayAccountValid.id,jdbcType=BIGINT},
|
</if>
|
<if test="money != null">mm_money=#{money,jdbcType=DECIMAL},</if>
|
<if test="balance != null">mm_balance=#{balance,jdbcType=DECIMAL},</if>
|
<if test="stateDesc != null">mm_state_desc=#{stateDesc,jdbcType=VARCHAR},</if>
|
<if test="beiZhu != null">mm_beizhu=#{beiZhu,jdbcType=VARCHAR},</if>
|
<if test="createTime != null">mm_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="updateTime != null">mm_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
|
<if test="read != null">mm_read=#{read,jdbcType=BOOLEAN},</if>
|
<if test="orderType !=null">mm_order_type =#{orderType,jdbcType=INTEGER},</if>
|
<if test="desc != null">mm_desc=#{desc,jdbcType=VARCHAR},</if>
|
<if test="content != null">mm_content=#{content,jdbcType=VARCHAR},</if>
|
</set>
|
where mm_id = #{id,jdbcType=BIGINT}
|
</update>
|
<update id="setMsgReadByUid" parameterType="java.lang.Long">update
|
yeshi_ec_msg_money set mm_read=1 where mm_uid=#{0}
|
</update>
|
</mapper>
|