用户列表-投资记录sql

--普通标、定向标、新手标、老互融计划-投资记录表
select bid.borrow_id,
(select yyb.borrow_valid_time from YYD_Borrow_BorrowInfo as yyb where yyb.ID=bid.borrow_id ) as borrow_valid_time,
(select yyb.borrow_end_time from YYD_Borrow_BorrowInfo as yyb where yyb.ID=bid.borrow_id ) as borrow_end_time,
(select yyb.BidComRate from YYD_Borrow_BorrowInfo as yyb where yyb.ID=bid.borrow_id ) as BidComRate,
(select yyb.Title from YYD_Borrow_BorrowInfo as yyb where yyb.ID=bid.borrow_id ) as Title,
bid.amount as amount,
(select yyb.BorrowCode from YYD_Borrow_BorrowInfo as yyb where yyb.ID=bid.borrow_id) as BorrowCode,
(select yyb.borrow_period from YYD_Borrow_BorrowInfo as yyb where yyb.ID=bid.borrow_id) as borrow_period,
(select yyb.status from YYD_Borrow_BorrowInfo as yyb where yyb.ID=bid.borrow_id) as statuss,
bid.createtime as createtime,
--(select DATEADD(MONTH,yyb.borrow_period,yyb.loanDate) from YYD_Borrow_BorrowInfo as yyb where yyb.ID=bid.borrow_id ) as endDate
(
select case when yyb.loanDate=‘1900-01-01 00:00:00.000‘ then ‘1900-01-01 00:00:00.000‘ else
DATEADD(MONTH,yyb.borrow_period,yyb.loanDate) end
from YYD_Borrow_BorrowInfo as yyb where yyb.ID=bid.borrow_id

) as endDate

from YYD_Borrow_BidRecord as bid inner join YYD_Borrow_borrowinfo_ext as ext on bid.borrow_id = ext.borrow_id where ext.borrow_product<>50 and ext.borrow_product<>70 and bid.bid_user_id=1239

union all

--新互融计划投资记录表
select newbid.nplid,‘‘ as borrow_valid_time,‘‘ as borrow_end_time,‘‘ as BidComRate,
(select bTitle+‘[‘+qishu+‘]‘ from HUR_NewPlanLoan where id=newbid.nplid)Title,
newbid.amount as amount,‘‘ as BorrowCode,
(select bPeriod from HUR_NewPlanLoan where id=newbid.nplid)borrow_period,
newbid.nplStatus as statuss,newbid.createtime as createtime,

(select case when yyb.loanDate=‘1900-01-01 00:00:00.000‘ then ‘1900-01-01 00:00:00.000‘ else
DATEADD(MONTH,loan.bPeriod,yyb.loanDate) end from YYD_Borrow_BorrowInfo as yyb,HUR_NewPlanLoan as loan
where yyb.id in (select top 1 borrowId from HUR_NewPlanLoan_ItemLoan as item
where item.nplBid = newbid.id) and loan.id = newbid.nplid) as endDate
from HUR_NewPlanLoan_BidRecord as newbid where newbid.nplStatus=1 and newbid.userid=1337

union all

----个人债权转让的投资记录表
select bid.borrow_id,
(select yyb.borrow_valid_time from YYD_Borrow_BorrowInfo as yyb where yyb.ID=(
select top 1 ext.OrginBorrowId from YYD_Borrow_borrowinfo_ext as ext where ext.borrow_id=bid.borrow_id)) as borrow_valid_time,
(select yyb.borrow_end_time from YYD_Borrow_BorrowInfo as yyb where yyb.ID=(
select top 1 ext.OrginBorrowId from YYD_Borrow_borrowinfo_ext as ext where ext.borrow_id=bid.borrow_id)) as borrow_end_time,
(select yyb.BidComRate from YYD_Borrow_BorrowInfo as yyb where yyb.ID=(
select top 1 ext.OrginBorrowId from YYD_Borrow_borrowinfo_ext as ext where ext.borrow_id=bid.borrow_id)) as BidComRate,

(select yyb.Title from YYD_Borrow_BorrowInfo as yyb where yyb.id =(
select top 1 ext.OrginBorrowId from YYD_Borrow_borrowinfo_ext as ext where ext.borrow_id=bid.borrow_id)) as Title,

bid.amount as amount,

(select yyb.BorrowCode from YYD_Borrow_BorrowInfo as yyb where yyb.id =(
select top 1 ext.OrginBorrowId from YYD_Borrow_borrowinfo_ext as ext where ext.borrow_id=bid.borrow_id)) as BorrowCode,

(select yyb.borrow_period from YYD_Borrow_BorrowInfo as yyb where yyb.id =(
select top 1 ext.OrginBorrowId from YYD_Borrow_borrowinfo_ext as ext where ext.borrow_id=bid.borrow_id)) as borrow_period,

(select yyb.status from YYD_Borrow_BorrowInfo as yyb where yyb.id =(
select top 1 ext.OrginBorrowId from YYD_Borrow_borrowinfo_ext as ext where ext.borrow_id=bid.borrow_id)) as statuss,
bid.createtime as createtime,
--(select DATEADD(MONTH,yyb.borrow_period,yyb.loanDate) from YYD_Borrow_BorrowInfo as yyb where id =(
--select top 1 ext.OrginBorrowId from YYD_Borrow_borrowinfo_ext as ext where ext.borrow_id=bid.borrow_id)) as endDate
(select case when yyb.loanDate=‘1900-01-01 00:00:00.000‘ then ‘1900-01-01 00:00:00.000‘ else
DATEADD(MONTH,yyb.borrow_period,yyb.loanDate) end
from YYD_Borrow_BorrowInfo as yyb where yyb.id =(select top 1 ext.OrginBorrowId from YYD_Borrow_borrowinfo_ext as ext
where ext.borrow_id=bid.borrow_id)) as endDate

from YYD_Borrow_BidRecord as bid inner join YYD_Borrow_borrowinfo_ext as ext on bid.borrow_id = ext.borrow_id
where ext.borrow_product=50 and bid.bid_user_id=1239

时间: 2024-08-11 01:35:48

用户列表-投资记录sql的相关文章

Springmvc框架-实现用户列表查询&#183;

需求:通过用户名和用户角色查询符合条件的用户列表信息 UserController.java package cn.smbms.controller; import java.util.List; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.apache.log4j.Logger;

C#开发微信门户及应用(4)--关注用户列表及详细信息管理

在上个月的对C#开发微信门户及应用做了介绍,写过了几篇的随笔进行分享,由于时间关系,间隔了一段时间没有继续写这个系列的博客了,并不是对这个方面停止了研究,而是继续深入探索这方面的技术,为了更好的应用起来,专心做好底层的技术开发. 微信的很重要的一个特点就是能够利用其平台庞大的用户群体,因此很容易整合在CRM(客户关系管理)系统里面,服务号和订阅好都能够向关注者推送相关的产品消息,还能和48小时内响应消息和事件的活跃用户进行交互对话,因此用户信息是微信API里面非常重要的一环,本随笔主要介绍获取关

Android 实现用户列表信息滑动删除功能和选择删除功能

在项目开发过程中,常常需要对用户列表的信息进行删除的操作.Android中常用的删除操作方式有两种 ,一种就是类似微信的滑动出现删除按钮方式,还有一种是通过CheckBox进行选择,然后通过按钮进行删除的方式.本来的实例集成上述的两种操作方式来实现用户列表删除的效果. 设计思路:在适配器类MyAdapter一个滑动删除按钮显示或隐藏的Map,一个用于CheckBox是否选中的Map和一个与MainAcitivyt进行数据交互的接口ContentsDeleteListener,同时该接口包含两个方

利用Excel导入用户列表(POI)

1.jsp页面的代码(和上一个导出的实例是同一个) <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib prefix="s" uri="/struts-tags"%> <html> <head> <title>用户管理</title> <%@incl

夺命雷公狗---Redis---6-案例操作2(用户列表页,实现分页显示已经关注功能)

redis.php(公共文件) <?php $redis = new Redis(); $redis -> connect('localhost',6379); $redis -> auth('123456');//因为我修改了配置文件的密码是123456 login.php(登录页面) <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>&

RDIFramework.NET ━ .NET快速信息化系统开发框架 V3.2-&gt;新增记录SQL执行过程

有时我们需要记录整个系统运行的SQL以作分析,特别是在上线前这对我们做内部测试也非常有帮助,当然记录SQL的方法有很多,也可以使用三方的组件.3.2版本我们在框架底层新增了记录框架运行的所有SQl过程保存到用户指定的地方以便分析查看,只需要在配置文件把配置项"LogSQL"设置为True即可.框架会自动记录各常用数据库如:Oracle.SqlServer.MySQL等的操作情况. 一.Web记录Sql执行情况 1.在我们的Web项目中要记录SQL可以在Web的配置文件中设置LogSql

基于Redis的在线用户列表解决方案

前言: 由于项目需求,需要在集群环境下实现在线用户列表的功能,并依靠在线列表实现用户单一登陆(同一账户只能一处登陆)功能: 在单机环境下,在线列表的实现方案可以采用SessionListener来完成,当有Session创建和销毁的时候做相应的操作即可完成功能及将相应的Session的引用存放于内存中,由于持有了所有的Session的引用,故可以方便的实现用户单一登陆的功能(比如在第二次登陆的时候使之前登陆的账户所在的Session失效). 而在集群环境下,由于用户的请求可能分布在不同的Web服

Android 实现用户列表信息的功能,然后选择删除幻灯片删除功能

在项目开发过程中.经常须要对用户列表的信息进行删除的操作.Android中经常使用的删除操作方式有两种 .一种就是类似微信的滑动出现删除button方式,另一种是通过CheckBox进行选择.然后通过button进行删除的方式.本来的实例集成上述的两种操作方式来实现用户列表删除的效果. 设计思路:在适配器类MyAdapter一个滑动删除button显示或隐藏的Map,一个用于CheckBox是否选中的Map和一个与MainAcitivyt进行数据交互的接口ContentsDeleteListen

在线用户列表

[转载]Asp.Net在线用户列表的開發匯總 这是转载的别人的一篇,解决了困扰我已久的问题,虽然文章里少了两张图,但是不影响阅读. 1.在线用户列表的实现在ASP时代,要实现一个网站的在线用户列表显示功能的惯用做法是修改global.asa文件中的:Application_Start.Session_Start和Session_End这三个函数.在ASP.NET时代,我依然这样做.但是必须注意很多问题.首先来看看最简单的代码实现: protected void Application_Start