48 lines
2.1 KiB
XML
48 lines
2.1 KiB
XML
<?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.sqx.modules.sys.mapper.SysUserMoneyDetailsMapper">
|
|
|
|
<resultMap id="BaseResultMap" type="com.sqx.modules.sys.entity.SysUserMoneyDetails">
|
|
<id property="id" column="id" jdbcType="INTEGER"/>
|
|
<result property="userId" column="user_id" jdbcType="INTEGER"/>
|
|
<result property="sysUserId" column="sys_user_id" jdbcType="INTEGER"/>
|
|
<result property="byUserId" column="by_user_id" jdbcType="INTEGER"/>
|
|
<result property="title" column="title" jdbcType="VARCHAR"/>
|
|
<result property="classify" column="classify" jdbcType="INTEGER"/>
|
|
<result property="type" column="type" jdbcType="INTEGER"/>
|
|
<result property="state" column="state" jdbcType="INTEGER"/>
|
|
<result property="money" column="money" jdbcType="DECIMAL"/>
|
|
<result property="content" column="content" jdbcType="VARCHAR"/>
|
|
<result property="moneyType" column="money_type" jdbcType="INTEGER"/>
|
|
<result property="createTime" column="create_time" jdbcType="VARCHAR"/>
|
|
<result property="sourceId" column="source_id" jdbcType="BIGINT"/>
|
|
</resultMap>
|
|
|
|
<sql id="Base_Column_List">
|
|
id,user_id,sys_user_id,
|
|
by_user_id,title,classify,
|
|
type,state,money,
|
|
content,money_type,create_time,
|
|
source_id
|
|
</sql>
|
|
|
|
<select id="queryPayMoney" resultType="Double">
|
|
select sum(money) from sys_user_money_details
|
|
where `type` = 1 and `state` = 2
|
|
<if test="userId!=null">
|
|
and user_id=#{userId}
|
|
</if>
|
|
<if test="type==1">
|
|
and date_format(create_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
|
|
</if>
|
|
<if test="type==2">
|
|
and date_format(create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
|
|
</if>
|
|
<if test="type==3">
|
|
and date_format(create_time,'%Y')=date_format(#{date},'%Y')
|
|
</if>
|
|
</select>
|
|
</mapper>
|