| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229 |
- <?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.ydtech.modules.admin.dao.SysUserAccountMapper">
- <resultMap id="BaseResultMap" type="com.ydtech.modules.admin.model.po.SysUserAccount">
- <id property="id" column="id" jdbcType="VARCHAR"/>
- <id property="userId" column="user_id" jdbcType="VARCHAR"/>
- <result property="handlingFee" column="handling_fee" jdbcType="DECIMAL"/>
- <result property="documentary" column="documentary" jdbcType="DECIMAL"/>
- <result property="promotion" column="promotion" jdbcType="DECIMAL"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
- <result property="name" column="name" jdbcType="VARCHAR"/>
- <result property="deptId" column="deptId" jdbcType="VARCHAR"/>
- <result property="deptName" column="deptName" jdbcType="VARCHAR"/>
- <result property="handlingAmountWithdrawal" column="handling_amount_withdrawal" jdbcType="DECIMAL"/>
- <result property="handlingAmountAccount" column="handling_amount_account" jdbcType="DECIMAL"/>
- <result property="handlingAmountPayment" column="handling_amount_payment" jdbcType="DECIMAL"/>
- <result property="documentaryAmountWithdrawal" column="documentary_amount_withdrawal" jdbcType="DECIMAL"/>
- <result property="documentaryAmountAccount" column="documentary_amount_account" jdbcType="DECIMAL"/>
- <result property="documentaryAmountpayment" column="documentary_amount_payment" jdbcType="DECIMAL"/>
- <result property="promotionAmountWithdrawal" column="promotion_amount_withdrawal" jdbcType="DECIMAL"/>
- <result property="promotionAmountAccount" column="promotion_amount_account" jdbcType="DECIMAL"/>
- <result property="promotionAmountPayment" column="promotion_amount_payment" jdbcType="DECIMAL"/>
- <result property="sumAmount" column="sum_amount" jdbcType="DECIMAL"/>
- <result property="sumAmountWithdrawal" column="sum_amount_withdrawal" jdbcType="DECIMAL"/>
- <result property="sumAmountAccount" column="sum_amount_account" jdbcType="DECIMAL"/>
- <result property="sumAmountPayment" column="sum_amount_payment" jdbcType="DECIMAL"/>
- <result property="managementSource" column="managementSource" jdbcType="VARCHAR"/>
- <result property="roleId" column="roleId" jdbcType="VARCHAR"/>
- <!-- <collection property="sysUserAccountCardList" ofType="com.ydtech.modules.admin.model.po.SysUserBankCard"
- resultMap="sysUserAccountCardList"/> -->
- </resultMap>
- <resultMap id="sysUserAccountCardList" type="com.ydtech.modules.admin.model.po.SysUserBankCard">
- <id property="id" column="id" jdbcType="VARCHAR"/>
- <result property="bankNumber" column="bank_number" jdbcType="VARCHAR"/>
- <result property="bankAccount" column="bank_account" jdbcType="VARCHAR"/>
- <result property="bankAddress" column="bank_address" jdbcType="VARCHAR"/>
- <result property="realUserName" column="real_user_name" jdbcType="VARCHAR"/>
- <result property="auditStatus" column="audit_status" jdbcType="VARCHAR"/>
- <result property="delFlag" column="del_flag" jdbcType="VARCHAR"/>
- </resultMap>
- <sql id="Base_Column_List">
- user_id,handling_fee,documentary,
- promotion,create_time
- </sql>
- <select id="queryPageOrder" resultType="com.ydtech.modules.admin.model.po.SysUserAccount">
- select
- a.user_id as "userId",
- a.handling_fee as "handlingFee",
- a.documentary as "documentary",
- a.promotion as "promotion",
- a.create_time as "createTime",
- a.handling_amount_withdrawal as "handlingAmountWithdrawal",
- a.handling_amount_account as "handlingAmountAccount",
- a.handling_amount_payment as "handlingAmountPayment",
- a.documentary_amount_withdrawal as "documentaryAmountWithdrawal",
- a.documentary_amount_account as "documentaryAmountAccount",
- a.documentary_amount_payment as "documentaryAmountPayment",
- a.promotion_amount_withdrawal as "promotionAmountWithdrawal",
- a.promotion_amount_account as "promotionAmountAccount",
- a.promotion_amount_payment as "promotionAmountPayment",
- b.dept_id as "deptId",
- b.name as "name",
- sd.name as "deptName"
- from
- sys_user_account a
- left join sys_user b on a.user_id = b.id
- left join sys_dept sd on sd.id =b.dept_id
- <where>
- <if test="sysUserAccountVo.userId != null and sysUserAccountVo.userId != ''">
- and a.user_id = #{sysUserAccountVo.userId}
- </if>
- <if test="sysUserAccountVo.deptId != null and sysUserAccountVo.deptId != ''">
- and b.dept_id like concat(#{sysUserAccountVo.deptId},'%')
- </if>
- </where>
- </select>
- <select id="getById" resultType="com.ydtech.modules.admin.model.po.SysUserAccount">
- select
- a.user_id as "userId",
- a.handling_fee as "handlingFee",
- a.documentary as "documentary",
- a.promotion as "promotion",
- a.create_time as "createTime",
- a.handling_amount_withdrawal as "handlingAmountWithdrawal",
- a.handling_amount_account as "handlingAmountAccount",
- a.handling_amount_payment as "handlingAmountPayment",
- a.documentary_amount_withdrawal as "documentaryAmountWithdrawal",
- a.documentary_amount_account as "documentaryAmountAccount",
- a.documentary_amount_payment as "documentaryAmountPayment",
- a.promotion_amount_withdrawal as "promotionAmountWithdrawal",
- a.promotion_amount_account as "promotionAmountAccount",
- a.promotion_amount_payment as "promotionAmountPayment",
- ifnull(a.sum_amount,0) as "sumAmount",
- ifnull(a.sum_amount_withdrawal,0) as "sumAmountWithdrawal",
- ifnull(a.sum_amount_account,0) as "sumAmountAccount",
- ifnull(a.sum_amount_payment,0) as "sumAmountPayment"
- from sys_user_account a
- <where>
- <if test="userId != null and userId != ''">
- and a.user_id = #{userId}
- </if>
- </where>
- </select>
- <select id="queryPageOrder1" resultMap="BaseResultMap">
- select
- a.user_id as id,
- a.user_id,
- a.handling_fee,
- a.documentary,
- a.promotion,
- a.create_time,
- a.handling_amount_withdrawal,
- a.handling_amount_account,
- a.handling_amount_payment,
- a.documentary_amount_withdrawal,
- a.documentary_amount_account,
- a.documentary_amount_payment,
- a.promotion_amount_withdrawal,
- a.promotion_amount_account,
- a.promotion_amount_payment,
- b.dept_id as deptId,
- b.name as name,
- sd.name as deptName,
- a.sum_amount,
- a.sum_amount_withdrawal,
- a.sum_amount_account,
- a.sum_amount_payment,
- sd.management_source as managementSource,
- role.role_id as roleId
- from
- sys_user_account a
- left join sys_user b on a.user_id = b.id
- left join sys_dept sd on sd.id = b.dept_id
- left join sys_user_role role on role.user_id = a.user_id
- <where>
- <if test="sysUserAccountVo.userId != null and sysUserAccountVo.userId != ''">
- and a.user_id = #{sysUserAccountVo.userId}
- </if>
- <if test="sysUserAccountVo.name != null and sysUserAccountVo.name != ''">
- and b.name = #{sysUserAccountVo.name}
- </if>
- <if test="sysUserAccountVo.deptId != null and sysUserAccountVo.deptId != ''">
- and b.dept_id like concat(#{sysUserAccountVo.deptId}, '%')
- </if>
- <if test="sysUserAccountVo.userName != null and sysUserAccountVo.userName != ''">
- and b.name = #{sysUserAccountVo.userName}
- </if>
- <if test="sysUserAccountVo.bankNumber != null and sysUserAccountVo.bankNumber != ''">
- and c.bank_number = #{sysUserAccountVo.bankNumber}
- </if>
- </where>
- </select>
- <select id="getGroupById" resultType="java.math.BigDecimal">
- select sum(sum_amount) from sys_user_account WHERE user_id in (
- select id from sys_user where manager_id = #{userId} or id = #{userId}
- )
- </select>
- <select id="queryCount" resultMap="BaseResultMap">
- select
- a.user_id,
- a.handling_fee,
- a.documentary,
- a.promotion,
- a.create_time,
- a.handling_amount_withdrawal,
- a.handling_amount_account,
- a.handling_amount_payment,
- a.documentary_amount_withdrawal,
- a.documentary_amount_account,
- a.documentary_amount_payment,
- a.promotion_amount_withdrawal,
- a.promotion_amount_account,
- a.promotion_amount_payment,
- b.dept_id as deptId,
- b.name as name,
- sd.name as deptName,
- sd.management_source as managementSource,
- role.role_id as roleId
- from
- sys_user_account a
- left join sys_user b on a.user_id = b.id
- left join sys_dept sd on sd.id = b.dept_id
- left join sys_user_role role on role.user_id = a.user_id
- <where>
- a.user_id not in (
- SELECT
- su.id AS userId
- FROM
- sys_user su
- LEFT JOIN sys_user_info info ON info.id = su.id
- LEFT JOIN sys_dept sd ON su.dept_id = sd.id
- LEFT JOIN sys_dept psd ON psd.id = sd.parent_id
- LEFT JOIN sys_user_role t3 ON su.id = t3.user_id
- LEFT JOIN sys_role t4 ON t3.role_id = t4.id
- AND sd.del_flag = '0'
- WHERE
- su.dept_id LIKE concat( '%', '99', '%' )
- AND t3.role_id IN ( 3 )
- AND sd.management_source = 3
- ORDER BY
- su.create_time DESC
- )
- </where>
- </select>
- <select id="queryCardListByUserId" resultMap="sysUserAccountCardList">
- select
- c.id,
- c.bank_number,
- c.bank_account,
- c.bank_address,
- c.del_flag,
- c.audit_status,
- c.real_user_name
- from
- sys_user_bank_card c
- where c.user_id =#{userId}
- </select>
- </mapper>
|