You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/word/新协航_设计文档/数据库建表文档/1.0/临时文档.sql

34 lines
3.5 KiB
MySQL

3 years ago
select * from tsysenumvalue
select * from ch_fee
update ch_fee set feestatus=2
update ch_fee set FeeStatus=0, Auditdate=getdate()
where gid='11339172-BDAE-48A1-B985-DFBAC1D005EC'
select * from sys_module where description='<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ'
--delete from info_client
select * from info_client
select gid,shortname as name,codename+'_'+shortname codename from info_client
select * from import_main
SELECT M.[id],M.[ContractNo],[HTH],[seller],[company],comp.name as companyname,[buyer],[STT], M.[countryid],[creator],[Auditor],[MainState],[printed],[AutoAPP],[ShipCompany_id], [BillNo] ,[BillType],[Vessel],[Voyage], ci.code as cicode,ci.name as ciname, case [BillTime] when '1900-01-01 00:00:00.000' then '' else CONVERT(varchar(12) , [BillTime],23) end as BillTime, case [Ex_sailingdate] when '1900-01-01 00:00:00.000' then '' else CONVERT(varchar(12) , [Ex_sailingdate],23) end as Ex_sailingdate, case [Sailingdate] when '1900-01-01 00:00:00.000' then '' else CONVERT(varchar(12) , [Sailingdate],23) end as Sailingdate , case [ArrivalDate] when '1900-01-01 00:00:00.000' then '' else CONVERT(varchar , [ArrivalDate],120) end as ArrivalDate ,[ContainerNo],[SealNo],[TransactionMethod],[PaymentMethods] ,[SecurityDeposit], case [CustomsReleaseDate] when '1900-01-01 00:00:00.000' then '' else CONVERT(varchar ,[CustomsReleaseDate],120) end as CustomsReleaseDate, case [SamplingDate_Plan] when '1900-01-01 00:00:00.000' then '' else CONVERT(varchar ,[SamplingDate_Plan],120) end as SamplingDate_Plan, case [SamplingDate_Act] when '1900-01-01' then '' else CONVERT(varchar ,[SamplingDate_Act],120) end as SamplingDate_Act,case [inspection_Signup_date] when '1900-01-01 00:00:00.000' then '' else CONVERT(varchar ,[inspection_Signup_date],120) end as inspection_Signup_date ,[inspection_no], case [inspection_date] when '1900-01-01 00:00:00.000' then '' else CONVERT(varchar ,[inspection_date],120) end as inspection_date ,cg.id as cgid ,cg.name,c.countryid,c.country, convert(bigint ,M.TimeMark) as TimeMark , case [creattime] when '1900-01-01 00:00:00.000' then '' else CONVERT(varchar(12) , [creattime],120) end as creattime , case [Audittime] when '1900-01-01 00:00:00.000' then '' else CONVERT(varchar(12) , [Audittime],120) end as Audittime , Freetime,CIQ_licence,CIQ_canbesearch, case [tax_date] when '1900-01-01 00:00:00.000' then '' else CONVERT(varchar(12) , [tax_date],23) end as tax_date , case [tax_paydate] when '1900-01-01 00:00:00.000' then '' else CONVERT(varchar(12) , [tax_paydate],23) end as tax_paydate , (select EnumValueName from tSysEnumValue where LangId=0 and EnumTypeID=3 and EnumValueID=M.MainState) as MainStateRef, (select EnumValueName from tSysEnumValue where LangId=0 and EnumTypeID=10 and EnumValueID=M.port) as portRef, M.port, M.remark FROM [dbo].[Import_main] M left join code_country c on m.countryid=c.countryid left join import_cargo cg on cg.contractno=M.contractno left join import_cargoinfo ci on ci.id=cg.cargoinfo_id left join company comp on comp.gid=M.company where m.id='1'
select fd.gid,fd.bsno,f.customername,fd.feeid,f.feename,fd.Doamount,f.feetype,
fd.createtime from ch_fee_do fd
left join ch_fee f on f.gid=fd.feeid
--condition---where fd.bsno='' and fd.gid=''
update ch_fee set feestatus=2
delete from ch_fee_do
select fd.gid,fd.bsno,fd.customername,fd.feeid,f.feename,Doamount,f.feetype,
fd.createtime from ch_fee_do fd
left join ch_fee f on f.gid=fd.feeid
where fd.bsno='A1' and fd.feeid='13D8660F-EBF0-4AA8-B0C0-1AAF28A663D7'