抚顺电厂更改低保等状态

--抚顺电厂备份的数据库调整现用数据库

update aa
set aa.gratisreason = bb.gratisreason from owereportmx aa, [shengji].dbo.owereportmx bb

where aa.yearnum = bb.yearnum and aa.ownerid = bb.ownerid
and aa.yearnum = '2012-2013'
and aa.gratisreason <> bb.gratisreason

 

--更新

update o
set o.gratisreason =
 case
  when charindex( '正常',p.appenidix,0) > 0 then '0'
  when charindex( '减免',p.appenidix,0) > 0 then '1' 
  when charindex( '低保边缘户',p.appenidix,0) > 0 then '4' 

  when charindex( '低保',p.appenidix,0) > 0 then '2'
  when charindex( '三方面',p.appenidix,0) > 0 then '3' 
  when charindex( '离休',p.appenidix,0) > 0 then '5'
  --when charindex( '供1-3月',p.appenidix,0) > 0 then '6'
 end
from paydetail p,owereportmx o
where o.ownerid = p.ownerid and
 (p.appenidix like '%正常%'
 OR p.appenidix like '%减免%'
 OR p.appenidix like '%低保%'
 OR p.appenidix like '%三方面%'
 OR p.appenidix like '%低保边缘户%'
 OR p.appenidix like '%离休%'
 --OR p.appenidix like '%供1-3月%'
 )
 and p.yearnum='20122013'
 and o.yearnum = '2012-2013'
 and p.exist <>'1'
 and left(billid,2) = 'db'

 

 

--更新业主表和收款明细表

update p
set p.gratisreason = o.gratisreason from owereportmx o, paydetail p
where o.yearnum = '2012-2013'
 and p.yearnum = '20122013'
 and p.ownerid = o.ownerid
 and p.gratisreason <> o.gratisreason
 and p.exist = '0'
 
update r
set r.gratisreason = o.gratisreason from owereportmx o,owner r
where o.yearnum = '2012-2013'
 and r.ownerid = o.ownerid
 and r.gratisreason <> o.gratisreason
 and r.exist = '0'

 

 

--20131102抚顺电厂新建楼房灌入业主信息

INSERT INTO owner
 ([ownerid]
 ,[name] 
 ,[contactmode]
 ,[yjmoney]
 ,[collectorid]
 ,[roomId]
 ,[Heatattribute]
 ,[Chargemodeid]
 ,[comein]
 ,[address]
 ,[appendix]
 ,[area]
 ,[roomtypeid]
 ,[feemodel]
 ,[area1]
 ,[Chargemodeid1]
 ,[orderId]
 ,[exist]
 ,[Gratis]
 ,[gratis1]
 ,[gratisreason])

select mx.ownerid,mx.name,mx.contactmode,mx.yjk,mx.collectorid,mx.roomid,mx.heatattribute,
 c.chargemodeId,mx.comein,mx.roomname,mx.appendix,mx.area,mx.roomtypeid,mx.boiler,mx.area,
 c.chargemodeId,1,'0',mx.gratis,mx.gratis1,'0'
from owereportmx mx left outer join
 (select Unitprice,max(chargemodeid) chargemodeid from chargemode group by Unitprice) c
 on mx.chargestandard=c.Unitprice
where mx.roomid in(
 select roomidtext from room
 where left(roomidtext,6) in   
  ('012202',
  '012203',
  '012204',
  '012205',
  '012206',
  '012207',
  '012209',
  '012211',
  '012213',
  '012214',
  '012216',
  '012231',
  '012232',
  '012233',
  '012235',
  
  '012501',
  '012502',
  '012503',
  '012504',
  
  '012401',
  '012402',
  '012403',
  
  '012011',
  '012013',
  '012015',
  
  '073001',
  
  '073101',
  '073104',
  '073105',
  '073106',
  '073107',
  '073108',
  '073109',
  '073110',
  '073111',
  '073112',
  '073113',
  '073114',
  '073115',
  '073116',
  '073121',
  
  '123403',
  '123404',
  '123405',
  '123406',
  '123407',
  '123408',
  '123410',

  '073301',
  '073302',
  '073303',
  '073304',
  '073306',
  '073307',
  '073308',
  '073309',
  '073310',
  '073311',
  '073312',
  '073313',
  '073314',
  '073315',
  '073318',
  '073319',
  '073320',
  '073321',
  '073322',
  '073323',
  '073324',
  '073325',
  '073326',
  '073327',
  '073328',
  '073329',
  '073330',
  '073331',
  '073332',
  '073333',
  '073334',
  '073335',
  '073336',
  '073351',
  '073352',
  '073353',
  '073354',
  '073355'
  )
  and roomidtext not in (select roomid from owner)
 )

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
毕设新项目-基于Java开发的智慧养老院信息管理系统源码+数据库(含vue前端源码).zip 【备注】 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用!有问题请及时沟通交流。 2、适用人群:计算机相关专业(如计科、信息安全、数据科学与大数据技术、人工智能、通信、物联网、自动化、电子信息等)在校学生、专业老师或者企业员工下载使用。 3、用途:项目具有较高的学习借鉴价值,不仅适用于小白学习入门进阶。也可作为毕设项目、课程设计、大作业、初期项目立项演示等。 4、如果基础还行,或热爱钻研,亦可在此项目代码基础上进行修改添加,实现其他不同功能。 欢迎下载!欢迎交流学习!不清楚的可以私信问我! 毕设新项目-基于Java开发的智慧养老院信息管理系统源码+数据库(含vue前端源码).zip毕设新项目-基于Java开发的智慧养老院信息管理系统源码+数据库(含vue前端源码).zip毕设新项目-基于Java开发的智慧养老院信息管理系统源码+数据库(含vue前端源码).zip毕设新项目-基于Java开发的智慧养老院信息管理系统源码+数据库(含vue前端源码).zip毕设新项目-基于Java开发的智慧养老院信息管理系统源码+数据库(含vue前端源码).zip毕设新项目-基于Java开发的智慧养老院信息管理系统源码+数据库(含vue前端源码).zip毕设新项目-基于Java开发的智慧养老院信息管理系统源码+数据库(含vue前端源码).zip毕设新项目-基于Java开发的智慧养老院信息管理系统源码+数据库(含vue前端源码).zip毕设新项目-基于Java开发的智慧养老院信息管理系统源码+数据库(含vue前端源码).zip
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值