소스 검색

Merge branch 'test' into test-dj

dongxin 1 년 전
부모
커밋
141a8dc84c

+ 1 - 0
src/main/java/com/ydtech/components/TokenInterceptor.java

@@ -88,6 +88,7 @@ public class TokenInterceptor {
 
         // 平安相关屏蔽地址
         notMatchList.add("/order/pingAnApi/getApplyVerifyCodeAndRecoverApplyVerifyCode");
+        notMatchList.add("/sysUserAccount/queryCount");
         notMatchList.add("/order/pingAnApi/recoverApplyVerifyCode");
         notMatchList.add("/order/pingAnApi/payReturn");
 

+ 26 - 1
src/main/java/com/ydtech/modules/admin/controller/SysUserAccountController.java

@@ -1,10 +1,10 @@
 package com.ydtech.modules.admin.controller;
 
 
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.admin.model.dto.*;
 import com.ydtech.modules.admin.model.po.SysUserAccount;
+import com.ydtech.modules.admin.model.po.SysUserBankCard;
 import com.ydtech.modules.admin.model.vo.MyIncomeAndExpensesNewPageVo;
 import com.ydtech.modules.admin.model.vo.SubOrder;
 import com.ydtech.modules.admin.model.vo.SysUserAccountVo;
@@ -312,4 +312,29 @@ public class SysUserAccountController extends BaseController {
         MySumAmountDto amountDto = sysUserAccountService.findMyAmount(mySumAmountQueryDto);
         return HttpResult.ok(amountDto);
     }
+
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2025/1/6 18:14
+     *  @Description: 查询用户的提现总金额去除电销组员的金额(电销组员通过逻辑累加到组长上了)
+     */
+    @GetMapping("/queryCount")
+    @ApiOperation(value = "查询所有的账户的数据金额")
+    public HttpResult<BigDecimal> queryCount() {
+         BigDecimal bigDecimal = sysUserAccountService.queryCount();
+        return HttpResult.ok("success", bigDecimal);
+    }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2025/1/6 18:15
+     *  @Description:  查询用户的银行卡信息
+     */
+    @GetMapping("/queryCardListByUserId")
+    @ApiOperation(value = "查询用户的银行卡信息")
+    public HttpResult<List> queryCardListByUserId(String userId) {
+        List<SysUserBankCard> cardList = sysUserAccountService.queryCardListByUserId(userId);
+        return HttpResult.ok("success", cardList);
+    }
 }

+ 7 - 0
src/main/java/com/ydtech/modules/admin/dao/DeptBalanceMapper.java

@@ -51,4 +51,11 @@ public interface DeptBalanceMapper {
      *  @Description: 查询电销组长的收入
      */
     BigDecimal getDxWalletAgentAmount(@Param("ids") List<String> userList, @Param("beginDate") String beginDate, @Param("endDate") String endDate);
+
+    /**
+     *
+     * @param deptBalanceVo
+     * @return  获取钱包总收入
+     */
+    HashMap<String, BigDecimal> getIncomeIndication(DeptBalanceVo deptBalanceVo);
 }

+ 6 - 0
src/main/java/com/ydtech/modules/admin/dao/SysPremiumDetailsMapper.java

@@ -6,10 +6,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ydtech.modules.admin.model.SysPremiumDetails;
 import com.ydtech.modules.admin.model.dto.AgencyUserInsAreaDto;
 import com.ydtech.modules.admin.model.dto.CommissionInfoDto;
+import com.ydtech.modules.admin.model.dto.DeptBalanceDto;
 import com.ydtech.modules.admin.model.vo.AgencyUserInsAreaVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.math.BigDecimal;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -23,4 +26,7 @@ public interface SysPremiumDetailsMapper extends BaseMapper<SysPremiumDetails> {
     List<Map<String, Object>> queryInfoPage(@Param("userId") String userId,  @Param("dto") CommissionInfoDto commissionInfoDto);
 
     Page<Map<String, Object>> queryInfoPages(Page page,  @Param("dto") CommissionInfoDto commissionInfoDto);
+
+    HashMap<String, BigDecimal> getTotalAmount(DeptBalanceDto itemLeader);
+
 }

+ 17 - 3
src/main/java/com/ydtech/modules/admin/dao/SysUserAccountMapper.java

@@ -3,9 +3,8 @@ package com.ydtech.modules.admin.dao;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ydtech.modules.admin.model.po.SysUserAccount;
+import com.ydtech.modules.admin.model.po.SysUserBankCard;
 import com.ydtech.modules.admin.model.vo.SysUserAccountVo;
-import com.ydtech.modules.order.entity.InsOrders;
-import com.ydtech.modules.protocols.entity.po.InsFeeOrderNew;
 import org.apache.ibatis.annotations.Param;
 
 import java.math.BigDecimal;
@@ -21,7 +20,7 @@ public interface SysUserAccountMapper extends BaseMapper<SysUserAccount> {
 
     Page<SysUserAccount> queryPageOrder(SysUserAccountVo sysUserAccountVo,@Param("page") Page page);
 
-    Page<SysUserAccount> queryPageOrder1(@Param("sysUserAccountVo") SysUserAccountVo sysUserAccountVo,@Param("page") Page page);
+    Page<SysUserAccount> queryPageOrder1(@Param("page") Page page,@Param("sysUserAccountVo") SysUserAccountVo sysUserAccountVo);
 
     SysUserAccount getById(String userId);
     /**
@@ -31,6 +30,21 @@ public interface SysUserAccountMapper extends BaseMapper<SysUserAccount> {
      *  @Description: 查询组长下的组员信息账户总金额
      */
     BigDecimal getGroupById(@Param("userId") String userId);
+
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2025/1/6 18:19
+     *  @Description:  查询账户列表
+     */
+    List<SysUserAccount> queryCount();
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2025/1/6 18:28
+     *  @Description:  通过用户id查询银行卡信息
+     */
+    List<SysUserBankCard> queryCardListByUserId(@Param("userId") String userId);
 }
 
 

+ 6 - 1
src/main/java/com/ydtech/modules/admin/model/po/SysUserAccount.java

@@ -8,6 +8,7 @@ import lombok.Data;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
@@ -118,7 +119,7 @@ public class SysUserAccount implements Serializable {
 
     @ApiModelProperty(value = "所属账户下的卡")
     @TableField(exist = false)
-    List<SysUserBankCard> sysUserAccountCardList;
+    List<SysUserBankCard> sysUserAccountCardList =new ArrayList<SysUserBankCard>();
 
     // add by  hxl   2024-06-18  添加账号总金额
     /**
@@ -149,4 +150,8 @@ public class SysUserAccount implements Serializable {
     private  String  managementSource;
     @TableField(exist = false)
     private  String  roleId;
+
+    @TableField(exist = false)
+    private  String  id;
+
 }

+ 3 - 0
src/main/java/com/ydtech/modules/admin/model/vo/SysUserAccountVo.java

@@ -18,6 +18,9 @@ import java.util.List;
 @ApiModel("查询Vo")
 public class SysUserAccountVo {
 
+    @ApiModelProperty(value = "前端唯一key")
+    private String id;
+
     @ApiModelProperty(value = "用户id")
     private String userId;
 

+ 18 - 1
src/main/java/com/ydtech/modules/admin/service/SysUserAccountService.java

@@ -1,10 +1,10 @@
 package com.ydtech.modules.admin.service;
 
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.admin.model.dto.*;
 import com.ydtech.modules.admin.model.po.SysUserAccount;
+import com.ydtech.modules.admin.model.po.SysUserBankCard;
 import com.ydtech.modules.admin.model.vo.MyIncomeAndExpensesNewPageVo;
 import com.ydtech.modules.admin.model.vo.SubOrder;
 import com.ydtech.modules.admin.model.vo.SysUserAccountVo;
@@ -133,4 +133,21 @@ public interface SysUserAccountService extends IService<SysUserAccount> {
      *  @Description: 查询我的账户页面总金额
      */
     MySumAmountDto findMyAmount(MySumAmountQueryDto mySumAmountQueryDto);
+
+
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2025/1/6 18:18
+     *  @Description:  查询提现总金额
+     */
+    public BigDecimal queryCount();
+
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2025/1/6 18:17
+     *  @Description:  通过用户id查询银行卡信息
+     */
+    List<SysUserBankCard> queryCardListByUserId(String userId);
 }

+ 22 - 5
src/main/java/com/ydtech/modules/admin/service/impl/DeptBalanceServiceImpl.java

@@ -21,6 +21,7 @@ import com.ydtech.modules.esm.dao.EsmUserReferrerMapper;
 import com.ydtech.modules.esm.model.EsmUserReferrer;
 import com.ydtech.modules.order.service.InsOrdersService;
 import com.ydtech.modules.protocols.service.InsFeeOrderNewService;
+import com.ydtech.utils.BigDecimalUtils;
 import com.ydtech.utils.StringUtils;
 import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -105,10 +106,11 @@ public class DeptBalanceServiceImpl implements DeptBalanceService {
                     itemLeader.setBeginDate(deptBalanceVo.getBeginDate());
                     itemLeader.setEndDate(deptBalanceVo.getEndDate());
 
-                    SysPartnerAccount sysPartnerAccount =sysPartnerAccountMapper.getByDeptBalanceDto(itemLeader);
-                    if (sysPartnerAccount != null) {
-                        BigDecimal sumPremium = sysPartnerAccount.getSumPremium();
-                        BigDecimal extractFee = sysPartnerAccount.getExtractFee();
+                    HashMap<String,BigDecimal>totalAmountMap =sysPremiumDetailsMapper.getTotalAmount(itemLeader);
+//                    SysPartnerAccount sysPartnerAccount =sysPartnerAccountMapper.getByDeptBalanceDto(itemLeader);
+                    if (totalAmountMap != null) {
+                        BigDecimal sumPremium = totalAmountMap.get("totalAmount");
+                        BigDecimal extractFee = totalAmountMap.get("extractFeeAmount");
                         itemLeader.setTotalIncome(sumPremium);
                         itemLeader.setDeptManagementFee(extractFee);
 
@@ -164,6 +166,8 @@ public class DeptBalanceServiceImpl implements DeptBalanceService {
                 String userId = item.getUserId();
                 item.setLoginUserId(userId);
                 SysPartnerAccount sysPartnerAccount = sysPartnerAccountMapper.selectOne(new LambdaQueryWrapper<SysPartnerAccount>()
+                        .between(StringUtils.isNotEmpty(deptBalanceVo.getBeginDate()) && StringUtils.isNotEmpty(deptBalanceVo.getEndDate()),
+                                SysPartnerAccount::getCreateTime, deptBalanceVo.getBeginDate(), deptBalanceVo.getEndDate())
                         .eq(SysPartnerAccount::getUserId, item.getUserId()));
                 if(ObjectUtils.isNotEmpty(sysPartnerAccount)){
                     if(sysPartnerAccount.getSumPremium() !=null ){
@@ -394,9 +398,22 @@ public class DeptBalanceServiceImpl implements DeptBalanceService {
                     ssKTAmount = sysUserAccountEntity.getSumAmount()==null?BigDecimal.ZERO: sysUserAccountEntity.getSumAmount();
                 }
                 BigDecimal sumAmount=ysTXAmount.add(ssKTAmount).add(txzTXAmount);
+
+                //2025-1-8  需求 总收入 = 当天审核订单收入   收支明细
+                deptBalanceVo.setUserId(record.getUserId());
+                HashMap<String, BigDecimal> incomeIndication = deptBalanceMapper.getIncomeIndication(deptBalanceVo);
                 record.setWithdrawn(ysTXAmount);
                 record.setNotWithdrawn(ssKTAmount);
-                record.setTotalIncome(sumAmount);
+                if(incomeIndication!=null){
+                    if(deptBalanceVo.getManagementSource().equals("2")){
+                        record.setTotalIncome(incomeIndication.get("totalAmount"));
+                    }else {
+                        record.setTotalIncome(BigDecimalUtils.nullToZero(incomeIndication.get("totalAmount")).divide(new BigDecimal(10)));
+
+                    }
+                }else {
+                    record.setTotalIncome(BigDecimal.ZERO);
+                }
                 record.setWithdrawingAmount(txzTXAmount);
             }
         }

+ 6 - 3
src/main/java/com/ydtech/modules/admin/service/impl/ProfitAnalysisServiceImpl.java

@@ -83,9 +83,12 @@ public class ProfitAnalysisServiceImpl implements ProfitAnalysisService {
      */
     @Override
     public List<ProfitAnalysisDto> getProfitAnalysisQueryList(ProfitAnalysisQueryDto profitAnalysisQueryDto) {
-        HashMap<String, String> dateMapByType = getDateMapByType(profitAnalysisQueryDto.getDateType(), profitAnalysisQueryDto.getYear());
-        profitAnalysisQueryDto.setBeginDate(dateMapByType.get("startDate"));
-        profitAnalysisQueryDto.setEndDate(dateMapByType.get("endDate"));
+        if(StringUtils.isNotEmpty(profitAnalysisQueryDto.getDateType())){
+            profitAnalysisQueryDto.setYear(null);
+            HashMap<String, String> dateMapByType = getDateMapByType(profitAnalysisQueryDto.getDateType(), profitAnalysisQueryDto.getYear());
+            profitAnalysisQueryDto.setBeginDate(dateMapByType.get("startDate"));
+            profitAnalysisQueryDto.setEndDate(dateMapByType.get("endDate"));
+        }
         List<ProfitAnalysisDto> profitAnalysisQueryList = insPlyIncomeMapper.getProfitAnalysisQueryList(profitAnalysisQueryDto);
         if(!profitAnalysisQueryList.isEmpty()){
             for (ProfitAnalysisDto profitAnalysisDto : profitAnalysisQueryList) {

+ 41 - 3
src/main/java/com/ydtech/modules/admin/service/impl/SysUserAccountServiceImpl.java

@@ -251,7 +251,7 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
     @Override
     public BasePageResult<SysUserAccount> queryByVo1(SysUserAccountVo sysUserAccountVo) {
         Page<SysUserAccount> page = new Page<>(sysUserAccountVo.getPageNum(), sysUserAccountVo.getPageSize());
-        Page<SysUserAccount> sysUserAccountHistoryPage = baseMapper.queryPageOrder1(sysUserAccountVo,page);
+        Page<SysUserAccount> sysUserAccountHistoryPage = baseMapper.queryPageOrder1(page,sysUserAccountVo);
         if(sysUserAccountHistoryPage!=null){
             List<SysUserAccount> records = sysUserAccountHistoryPage.getRecords();
             List<SysUserAccount> newRecords = new ArrayList<>();
@@ -284,7 +284,7 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
             }
             sysUserAccountHistoryPage.setRecords(newRecords);
         }
-        return new BasePageResult<>(sysUserAccountVo.getPageNum(), page.getSize(), sysUserAccountHistoryPage.getTotal(), page.getPages(),
+        return new BasePageResult<>(sysUserAccountVo.getPageNum(), sysUserAccountVo.getPageSize(), sysUserAccountHistoryPage.getTotal(), page.getPages(),
                 sysUserAccountHistoryPage.getRecords());
     }
 
@@ -1664,6 +1664,44 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
             }
         }
     }
-
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2025/1/6 18:27
+     *  @Description:  查询提现的总金额
+     */
+    @Override
+    public BigDecimal queryCount() {;
+        List<SysUserAccount> list = baseMapper.queryCount();
+        BigDecimal sumYsTXAmount =BigDecimal.ZERO;
+        if(list!=null && !list.isEmpty()){
+            for(SysUserAccount  sysUserAccount :list){
+                MySumAmountQueryDto mySumAmountQueryDto =new MySumAmountQueryDto();
+                mySumAmountQueryDto.setUserId(sysUserAccount.getUserId());
+                //出单员是19 且是渠道的话,给渠道团队长
+                if ("21".equals(sysUserAccount.getRoleId()) && "1".equals(sysUserAccount.getManagementSource())) {
+                    mySumAmountQueryDto.setDeptId(sysUserAccount.getDeptId());
+                }
+                //如果是电销组长,将组员的数据算进来
+                if ("72".equals(sysUserAccount.getRoleId()) && "3".equals(sysUserAccount.getManagementSource())) {
+                    mySumAmountQueryDto.setGroupFlag(true);
+                }
+                // 可提现
+                BigDecimal ssKTAmount = sysUserAccount.getSumAmount()==null?BigDecimal.ZERO:sysUserAccount.getSumAmount();
+                sumYsTXAmount =sumYsTXAmount.add(ssKTAmount);
+            }
+        }
+        return   sumYsTXAmount;
+    }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2025/1/6 18:28
+     *  @Description:  通过用户id查询银行卡信息
+     */
+    @Override
+    public List<SysUserBankCard> queryCardListByUserId(String userId) {
+        return baseMapper.queryCardListByUserId(userId);
+    }
 
 }

+ 33 - 1
src/main/resources/mapper/modules/admin/DeptBalanceMapper.xml

@@ -184,7 +184,7 @@
              and   io.userid =#{userId}
             </if>
             <if test="beginDate !=null and beginDate != '' and endDate !=null and endDate != ''">
-                AND  iac.signing_time  BETWEEN  #{beginDate}  AND  #{endDate}
+                AND  DATE_FORMAT( iac.createtime, '%Y-%m-%d')  BETWEEN DATE_FORMAT( #{beginDate}, '%Y-%m-%d')    AND   DATE_FORMAT( #{endDate}, '%Y-%m-%d')
             </if>
         </where>
     </select>
@@ -207,4 +207,36 @@
             </if>
         </where>
     </select>
+
+    <select id="getIncomeIndication" resultType="java.util.HashMap">
+        select ifnull(sum(a.amount) ,0) as "totalAmount"
+        from (
+        SELECT
+        his.amount as "amount"
+        FROM
+        sys_user_account_history his
+        LEFT JOIN ins_area_company ins ON his.suborder = ins.id
+        LEFT JOIN ins_orders o ON o.orderno = ins.orderno
+        left join sys_amount_auditing saa on saa.id =his.auditiing_id
+        left join sys_user su on su.id =his.user_id
+        WHERE
+        his.property !=1
+        and his.property !=2
+        AND his.documentary = '2'
+        <if test="beginDate !=null and beginDate != '' and endDate !=null and endDate != '' ">
+            AND date(his.create_time) BETWEEN #{beginDate} AND #{endDate}
+        </if>
+        <if test="userId !=null and userId!=''">
+            AND his.user_id =#{userId}
+        </if>
+        <if test="name !=null and name !=''">
+            and su.name like concat('%',#{name},'%')
+        </if>
+
+        <if test="phoneNumber !=null and phoneNumber !=''">
+            and su.mobile =#{phoneNumber}
+        </if>
+        order by his.create_time desc
+        ) a
+    </select>
 </mapper>

+ 21 - 0
src/main/resources/mapper/modules/admin/SysPremiumDetailsMapper.xml

@@ -49,6 +49,25 @@
     <sql id="setGroupConcatMaxLen">
         SET SESSION group_concat_max_len = 100000;
     </sql>
+    <select id="getTotalAmount" resultType="java.util.HashMap">
+        SELECT
+        sum(a.sumpremium) as "totalAmount",
+        sum(a.extract_fee) as "extractFeeAmount"
+        from
+        sys_premium_details a
+        <where>
+            a.status ='1'
+            <if test="beginDate !=null and beginDate != '' and endDate !=null and endDate != ''">
+                AND DATE_FORMAT( a.create_time, '%Y-%m-%d') BETWEEN DATE_FORMAT( #{beginDate}, '%Y-%m-%d') AND
+                DATE_FORMAT( #{endDate}, '%Y-%m-%d')
+            </if>
+            <if test="userId !=null  and  userId !=''">
+                and a.user_id = #{userId}
+            </if>
+        </where>
+
+
+    </select>
     <select id="queryInfoPage" resultType="java.util.Map">
         <include refid="setGroupConcatMaxLen"/>
         SELECT
@@ -97,6 +116,8 @@
             company_id ASC
         LIMIT #{dto.pageSize} OFFSET #{dto.pageNum};
     </select>
+
+    
     <select id="queryInfoPages" resultType="java.util.Map">
         SELECT
         company_id as companyId,

+ 66 - 11
src/main/resources/mapper/modules/admin/SysUserAccountMapper.xml

@@ -5,6 +5,7 @@
 <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"/>
@@ -28,8 +29,8 @@
             <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"/>
+       <!-- <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">
@@ -109,6 +110,7 @@
 
     <select id="queryPageOrder1"  resultMap="BaseResultMap">
         select
+        a.user_id as id,
         a.user_id,
         a.handling_fee,
         a.documentary,
@@ -126,13 +128,6 @@
         b.dept_id  as  deptId,
         b.name  as  name,
         sd.name  as  deptName,
-        c.id,
-        c.bank_number,
-        c.bank_account,
-        c.bank_address,
-        c.del_flag,
-        c.audit_status,
-        c.real_user_name,
         a.sum_amount,
         a.sum_amount_withdrawal,
         a.sum_amount_account,
@@ -143,10 +138,8 @@
         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_bank_card c on c.user_id = a.user_id
         left join sys_user_role role on role.user_id = a.user_id
         <where>
-            1=1
             <if test="sysUserAccountVo.userId != null and sysUserAccountVo.userId != ''">
                 and a.user_id = #{sysUserAccountVo.userId}
             </if>
@@ -171,4 +164,66 @@
     </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>

+ 1 - 0
src/main/resources/mapper/modules/admin/SysUserMapper.xml

@@ -1387,6 +1387,7 @@
         <where>
             info.id is not null
             and su.id NOT LIKE '%M%'
+            AND ( su.type != '1' and  su.type != '2' )
             <if test="vo.provinceId != null and vo.provinceId != ''">
                 and sd.id like concat('%',#{vo.provinceId},'%')
             </if>