mcs.sql 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. -- select * from apisql where sqlname ='checkDeviceId';
  2. -- select * from apisql where sqlname ='addDeviceInformation';
  3. -- select * from apisql where sqlname ='updateUserDevice';
  4. -- select sqlname,params,sqlstr from apisql where sqlname ='updateDeviceInformation';
  5. -- select sqlname,params,sqlstr from apisql where sqlname ='updateUser';
  6. -- select sqlname,params,sqlstr from apisql where sqlname ='user_mainthenance';
  7. -- "insert into user_mainthenance( user_id,maintenance_id)
  8. -- select DISTINCT ?, ? from DUAL where NOT EXISTS
  9. -- (select maintenance_id from user_mainthenance where maintenance_id = ?
  10. -- and user_id = ?)"
  11. -- "delete from user_mainthenance where user_id = 1"
  12. -- select * from user_mainthenance limit 10;
  13. -- select * from video;
  14. -- show create table device_information;
  15. -- select distinct maintenancePerson from user ;
  16. -- where id =2494;
  17. -- select distinct maintenancePerson from mainthenance limit 10;
  18. -- select if((select id from device_information where deviceId = 'apptest2')is null,'','已被绑定') vmsg;
  19. -- INSERT INTO device_information(empId,uId,deviceId,`password`) VALUES(3206,'PC','apptest2','mcs8@666');
  20. -- update `user` set device = 1 where empid = ?
  21. -- update user set username=? ,empid=?,sort=?,enable=?,maintenancePerson=?,keeper=? where id=?
  22. -- update `user` set device = 1 where empId = empIdIN;
  23. -- update device_information set empId = empIdIN where deviceId = deviceIdIN;
  24. -- update device_information set empid=3206 where deviceId='apptest2';
  25. -- show create procedure update_device;
  26. -- delete from device_information where deviceId ='apptest3'
  27. -- call update_device(3206,'apptest2');
  28. -- call update_device(1,'apptest2');
  29. -- delete from device_information where id =21;
  30. -- select * from device_information ;
  31. -- select * from user where device=1;
  32. -- -- select v.*,bk.upkeepCode from video v left join bigupkeep bk on v.upkeepId =bk.id;
  33. -- select
  34. -- case
  35. -- when (select id from video where upkeepId = 183064 ) is null then '未录制'
  36. -- when (select id from video where upkeepId = 183064 and endRecord=2 ) is not null then '录制中'
  37. -- when (select id from video where upkeepId = 183064 and newCreateTime=createTime and location <>'') is not null then '已录制'
  38. -- else '已录制上传中'
  39. -- end as videoTxt;
  40. -- select sqlname,params,sqlstr from apisql where sqlname ='upkeepChargDone';
  41. -- select * from apisql where sqlname ='getMcsAccounts';
  42. -- select table_name from information_schema.TABLES
  43. -- where table_schema=schema() and table_name like '%app%';
  44. -- select sqlname,params,sqlstr from apisql where sqlname ='updateEquseEmpId';
  45. -- select sqlname,params,sqlstr from apisql where sqlname ='deleteutupbyBigid';
  46. -- select sqlname,params,sqlstr from apisql where sqlname ='insertSpotList';
  47. -- select sqlname,params,sqlstr from apisql where sqlname ='insertutup';
  48. -- select sqlname,params,sqlstr from apisql where sqlname ='completeUpkeep';
  49. -- select params,sqlstr from apisql where sqlname ='getBigupkeepListAPP';
  50. select params,sqlstr from apisql where sqlname ='getBigupkeepList';
  51. -- select params,sqlstr from apisql where sqlname ='addDeviceVideo';
  52. -- select params,sqlstr from apisql where sqlname ='updateUserDevice';
  53. -- show create procedure add_device_video;
  54. -- describe video;
  55. -- update user set device=1 where username ='02820' and empid=3206;
  56. -- select * from emp where id =3206;
  57. -- select * from user where username ='02820' and empid=3206;
  58. -- select * from video ;
  59. -- where upkeepId =4657;
  60. -- delete from video;
  61. -- select upkeepId ,count(*) from video group by upkeepId;
  62. -- delete from video where upkeepId = 4657;
  63. -- alter table user
  64. -- add column deviceId varchar(50) not null default '' after device;
  65. -- alter table video
  66. -- add column endRecord int(11) not null default 0;
  67. -- add unique key `upkeepId` (`upkeepId`);
  68. -- add column newCreateTime datetime default '0000-00-00 00:00:00';
  69. -- show index from video;
  70. -- show create table video;