<?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.ExtractMapper">
|
<resultMap id="BaseResultMap"
|
type="com.yeshi.makemoney.app.entity.money.Extract">
|
<id column="id" property="id" jdbcType="BIGINT"/>
|
<result column="admin_id" property="adminId" jdbcType="BIGINT"/>
|
<result column="account" property="account" jdbcType="VARCHAR"/>
|
<result column="name" property="name" jdbcType="VARCHAR"/>
|
<result column="type" property="type" jdbcType="VARCHAR"/>
|
<result column="money" property="money" jdbcType="DECIMAL"/>
|
<result column="ip" property="ip" jdbcType="VARCHAR"/>
|
<result column="state" property="state" jdbcType="INTEGER"/>
|
<result column="reason" property="reason" jdbcType="VARCHAR"/>
|
<result column="success_time" property="successTime" jdbcType="TIMESTAMP"/>
|
<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,admin_id,account,name,type,money,ip,state,reason,success_time,create_time,update_time,
|
</trim>
|
</sql>
|
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List"/>
|
from mm_extract where id = #{id, jdbcType=BIGINT}
|
</select>
|
|
<select id="selectByPrimaryKeyForUpdate" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List"/>
|
from mm_extract where id = #{id,jdbcType=BIGINT} for update
|
</select>
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
delete from
|
mm_extract where id = #{id,jdbcType=BIGINT}
|
</delete>
|
<insert id="insert"
|
parameterType="com.yeshi.makemoney.app.entity.money.Extract"
|
useGeneratedKeys="true" keyProperty="id">
|
insert into
|
mm_extract
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
uid,
|
admin_id,
|
account,
|
name,
|
type,
|
money,
|
ip,
|
state,
|
reason,
|
success_time,
|
create_time,
|
update_time,
|
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
#{user.id,jdbcType=BIGINT},
|
#{adminId,jdbcType=BIGINT},
|
#{account,jdbcType=VARCHAR},
|
#{name,jdbcType=VARCHAR},
|
#{type,jdbcType=VARCHAR},
|
#{money,jdbcType=DECIMAL},
|
#{ip,jdbcType=VARCHAR},
|
#{state,jdbcType=INTEGER},
|
#{reason,jdbcType=VARCHAR},
|
#{successTime,jdbcType=TIMESTAMP},
|
#{createTime,jdbcType=TIMESTAMP},
|
#{updateTime,jdbcType=TIMESTAMP},
|
|
</trim>
|
|
</insert>
|
<insert id="insertSelective"
|
parameterType="com.yeshi.makemoney.app.entity.money.Extract"
|
useGeneratedKeys="true" keyProperty="id">
|
insert into mm_extract
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,</if>
|
<if test="user != null">uid,</if>
|
<if test="adminId != null">admin_id,</if>
|
<if test="account != null">account,</if>
|
<if test="name != null">name,</if>
|
<if test="type != null">type,</if>
|
<if test="money != null">money,</if>
|
<if test="ip != null">ip,</if>
|
<if test="state != null">state,</if>
|
<if test="reason != null">reason,</if>
|
<if test="successTime != null">success_time,</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="adminId != null">#{adminId,jdbcType=BIGINT},</if>
|
<if test="account != null">#{account,jdbcType=VARCHAR},</if>
|
<if test="name != null">#{name,jdbcType=VARCHAR},</if>
|
<if test="type != null">#{type,jdbcType=VARCHAR},</if>
|
<if test="money != null">#{money,jdbcType=DECIMAL},</if>
|
<if test="ip != null">#{ip,jdbcType=VARCHAR},</if>
|
<if test="state != null">#{state,jdbcType=INTEGER},</if>
|
<if test="reason != null">#{reason,jdbcType=VARCHAR},</if>
|
<if test="successTime != null">#{successTime,jdbcType=TIMESTAMP},</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.Extract">
|
update mm_extract
|
<set>
|
<if test="id != null">id = #{id,jdbcType=BIGINT},</if>
|
<if test="user != null">uid = #{user.id,jdbcType=BIGINT},</if>
|
<if test="adminId != null">admin_id = #{adminId,jdbcType=BIGINT},</if>
|
<if test="account != null">account = #{account,jdbcType=VARCHAR},</if>
|
<if test="name != null">name = #{name,jdbcType=VARCHAR},</if>
|
<if test="type != null">type = #{type,jdbcType=VARCHAR},</if>
|
<if test="money != null">money = #{money,jdbcType=DECIMAL},</if>
|
<if test="ip != null">ip = #{ip,jdbcType=VARCHAR},</if>
|
<if test="state != null">state = #{state,jdbcType=INTEGER},</if>
|
<if test="reason != null">reason = #{reason,jdbcType=VARCHAR},</if>
|
<if test="successTime != null">success_time = #{successTime,jdbcType=TIMESTAMP},</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.Extract">
|
update mm_extract
|
<set>
|
<if test="user != null">uid = #{user.id,jdbcType=BIGINT},</if>
|
<if test="adminId != null">admin_id = #{adminId,jdbcType=BIGINT},</if>
|
<if test="account != null">account = #{account,jdbcType=VARCHAR},</if>
|
<if test="name != null">name = #{name,jdbcType=VARCHAR},</if>
|
<if test="type != null">type = #{type,jdbcType=VARCHAR},</if>
|
<if test="money != null">money = #{money,jdbcType=DECIMAL},</if>
|
<if test="ip != null">ip = #{ip,jdbcType=VARCHAR},</if>
|
<if test="state != null">state = #{state,jdbcType=INTEGER},</if>
|
<if test="reason != null">reason = #{reason,jdbcType=VARCHAR},</if>
|
<if test="successTime != null">success_time = #{successTime,jdbcType=TIMESTAMP},</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.state!=null">
|
and state = #{query.state}
|
</if>
|
|
<if test="query.stateList!=null">
|
<foreach collection="query.stateList" open=" and (" separator=" or " close=")" item="state">
|
state = #{state}
|
</foreach>
|
</if>
|
|
<if test="query.minMoney!=null">
|
and money >= #{query.minMoney}
|
</if>
|
|
<if test="query.maxMoney!=null">
|
and #{query.maxMoney} >money
|
</if>
|
|
<if test="query.state!=null">
|
and state = #{query.state}
|
</if>
|
|
<if test="query.maxSuccessTime!=null">
|
and success_time <![CDATA[<]]> #{query.maxSuccessTime}
|
</if>
|
<if test="query.minSuccessTime!=null">
|
and success_time >= #{query.minSuccessTime}
|
</if>
|
<if test="query.maxCreateTime!=null">
|
and create_time <![CDATA[<]]> #{query.maxCreateTime}
|
</if>
|
<if test="query.minCreateTime!=null">
|
and create_time >= #{query.minCreateTime}
|
</if>
|
</sql>
|
|
<select id="list"
|
resultMap="BaseResultMap">
|
SELECT * FROM mm_extract
|
<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_extract
|
<where>
|
<include refid="listWhere">
|
</include>
|
</where>
|
</select>
|
|
<select id="sumMoney"
|
resultType="java.math.BigDecimal">
|
SELECT sum(money) FROM mm_extract
|
<where>
|
<include refid="listWhere">
|
</include>
|
</where>
|
</select>
|
|
|
</mapper>
|