<?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.makemoney.app.dao.money.UserMoneyRecordMapper">
|
<resultMap id="BaseResultMap"
|
type="com.yeshi.makemoney.app.entity.money.UserMoneyRecord">
|
<id column="id" property="id" jdbcType="BIGINT"/>
|
<result column="type" property="type" jdbcType="VARCHAR"/>
|
<result column="serial_no" property="serialNo" jdbcType="VARCHAR"/>
|
<result column="money" property="money" jdbcType="DECIMAL"/>
|
<result column="`add`" property="add" jdbcType="BOOLEAN"/>
|
<result column="`show`" property="show" jdbcType="BOOLEAN"/>
|
<result column="remarks" property="remarks" jdbcType="VARCHAR"/>
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
<association property="user" column="uid" javaType="com.yeshi.makemoney.app.entity.user.UserInfo">
|
<id column="uid" property="id" jdbcType="BIGINT"></id>
|
</association>
|
|
</resultMap>
|
|
<sql id="Base_Column_List">
|
<trim suffixOverrides=",">
|
id,uid,`type`,serial_no,money,`add`,`show`,remarks,create_time,update_time,
|
</trim>
|
</sql>
|
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List"/>
|
from mm_user_money_record where id = #{id, jdbcType=BIGINT}
|
</select>
|
|
<select id="selectByPrimaryKeyForUpdate" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List"/>
|
from mm_user_money_record where id = #{id,jdbcType=BIGINT} for update
|
</select>
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
delete from
|
mm_user_money_record where id = #{id,jdbcType=BIGINT}
|
</delete>
|
<insert id="insert"
|
parameterType="com.yeshi.makemoney.app.entity.money.UserMoneyRecord"
|
useGeneratedKeys="true" keyProperty="id">
|
insert into
|
mm_user_money_record
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
uid,
|
`type`,
|
serial_no,
|
money,
|
`add`,
|
`show`,
|
remarks,
|
create_time,
|
update_time,
|
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
#{user.id,jdbcType=BIGINT},
|
#{type,jdbcType=VARCHAR},
|
#{serialNo,jdbcType=VARCHAR},
|
#{money,jdbcType=DECIMAL},
|
#{add,jdbcType=BOOLEAN},
|
#{show,jdbcType=BOOLEAN},
|
#{remarks,jdbcType=VARCHAR},
|
#{createTime,jdbcType=TIMESTAMP},
|
#{updateTime,jdbcType=TIMESTAMP},
|
|
</trim>
|
|
</insert>
|
<insert id="insertSelective"
|
parameterType="com.yeshi.makemoney.app.entity.money.UserMoneyRecord"
|
useGeneratedKeys="true" keyProperty="id">
|
insert into mm_user_money_record
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,</if>
|
<if test="user != null">uid,</if>
|
<if test="type != null">`type`,</if>
|
<if test="serialNo != null">serial_no,</if>
|
<if test="money != null">money,</if>
|
<if test="add != null">`add`,</if>
|
<if test="show != null">`show`,</if>
|
<if test="remarks != null">remarks,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="updateTime != null">update_time,</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="type != null">#{type,jdbcType=VARCHAR},</if>
|
<if test="serialNo != null">#{serialNo,jdbcType=VARCHAR},</if>
|
<if test="money != null">#{money,jdbcType=DECIMAL},</if>
|
<if test="add != null">#{add,jdbcType=BOOLEAN},</if>
|
<if test="show != null">#{show,jdbcType=BOOLEAN},</if>
|
<if test="remarks != null">#{remarks,jdbcType=VARCHAR},</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.makemoney.app.entity.money.UserMoneyRecord">
|
update mm_user_money_record
|
<set>
|
<if test="id != null">id = #{id,jdbcType=BIGINT},</if>
|
<if test="user != null">uid = #{user.id,jdbcType=BIGINT},</if>
|
<if test="type != null">`type` = #{type,jdbcType=VARCHAR},</if>
|
<if test="serialNo != null">serial_no = #{serialNo,jdbcType=VARCHAR},</if>
|
<if test="money != null">money = #{money,jdbcType=DECIMAL},</if>
|
<if test="add != null">`add` = #{add,jdbcType=BOOLEAN},</if>
|
<if test="show != null">`show` = #{show,jdbcType=BOOLEAN},</if>
|
<if test="remarks != null">remarks = #{remarks,jdbcType=VARCHAR},</if>
|
<if test="createTime != null">create_time = #{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="updateTime != null">update_time = #{updateTime,jdbcType=TIMESTAMP},</if>
|
</set>
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
<update id="updateByPrimaryKeySelective"
|
parameterType="com.yeshi.makemoney.app.entity.money.UserMoneyRecord">
|
update mm_user_money_record
|
<set>
|
<if test="user != null">uid = #{user.id,jdbcType=BIGINT},</if>
|
<if test="type != null">`type` = #{type,jdbcType=VARCHAR},</if>
|
<if test="serialNo != null">serial_no = #{serialNo,jdbcType=VARCHAR},</if>
|
<if test="money != null">money = #{money,jdbcType=DECIMAL},</if>
|
<if test="add != null">`add` = #{add,jdbcType=BOOLEAN},</if>
|
<if test="show != null">`show` = #{show,jdbcType=BOOLEAN},</if>
|
<if test="remarks != null">remarks = #{remarks,jdbcType=VARCHAR},</if>
|
<if test="createTime != null">create_time = #{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="updateTime != null">update_time = #{updateTime,jdbcType=TIMESTAMP},</if>
|
</set>
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
|
<sql id="listWhere">
|
<if test="query.uid!=null">
|
and uid = #{query.uid}
|
</if>
|
<if test="query.type!=null">
|
and `type` = #{query.type}
|
</if>
|
<if test="query.serialNo!=null">
|
and serial_no = #{query.serialNo}
|
</if>
|
<if test="query.add!=null">
|
and `add` = #{query.add}
|
</if>
|
<if test="query.show!=null">
|
and `show` = #{query.show}
|
</if>
|
</sql>
|
|
<select id="list"
|
resultMap="BaseResultMap">
|
SELECT * FROM mm_user_money_record
|
<where>
|
<include refid="listWhere">
|
</include>
|
</where>
|
<if test="query.sortList!=null">
|
<foreach collection="query.sortList" open=" order by " separator="," item="item">
|
${item}
|
</foreach>
|
</if>
|
limit #{query.start},#{query.count}
|
</select>
|
|
|
<select id="count"
|
resultType="java.lang.Long">
|
SELECT count(*) FROM mm_user_money_record
|
<where>
|
<include refid="listWhere">
|
</include>
|
</where>
|
</select>
|
|
|
</mapper>
|