tst.sql 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. -- SELECT
  2. -- m.id,
  3. -- DATE_FORMAT(m.endDate, '%Y-%m-%d'),
  4. -- m.endAmount,
  5. -- m.Multiple
  6. -- -- INTO measureIdS,
  7. -- -- measureDateS,
  8. -- -- measureAmountS,
  9. -- -- rates
  10. -- FROM
  11. -- measure m
  12. -- left JOIN electricity w ON w.measureId = m.id
  13. -- WHERE
  14. -- m.meterNumber = '02.01'
  15. -- AND m.meterType = '电表'
  16. -- and m.meterName = '牛舍'
  17. -- and m.pastureId = 52
  18. -- AND m.isDel = '0';
  19. -- 牧场,表名称,表编号,上次抄表日期,上次值,
  20. -- 抄表日期,用量,本次值,单价,录入人,
  21. -- 备注
  22. -- (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
  23. -- 塞一牧场 牛舍 02.01 2022-6-5 12891.8 2022-7-1 3550.2 3550.2 0.33 周志国
  24. -- 消毒室 02.14
  25. -- call insert_electricity
  26. -- (
  27. -- '塞一牧场',
  28. -- '消毒室',
  29. -- '02.14',
  30. -- '2022-06-05',
  31. -- '12891.8',
  32. -- '2022-07-01',
  33. -- '185',
  34. -- '3238.2',
  35. -- '0.33',
  36. -- '周志国',
  37. -- '',
  38. -- '');
  39. -- call insert_electricity
  40. -- (
  41. -- '塞一牧场',
  42. -- '牛舍',
  43. -- '02.01',
  44. -- '2022-06-05',
  45. -- '12891.8',
  46. -- '2022-07-01',
  47. -- '12891.8',
  48. -- '12891.8',
  49. -- '0.33',
  50. -- '周志国',
  51. -- '',
  52. -- ''
  53. -- );
  54. -- SELECT * from electricity where date = '2022-07-01';
  55. -- show create table electricity;
  56. -- show index from electricity;
  57. -- SELECT id from measure limit 10;
  58. SELECT sqlstr from apisql where sqlname ='importDiesel';
  59. show create PROCEDURE importDiesel;
  60. -- SELECT measureid from electricity
  61. -- where pastureId =52
  62. -- order by date desc limit 10;
  63. -- drop PROCEDURE if exists `eq`.`importDiesel`;