sqlup.sql 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. update apisql
  2. set
  3. params ='pastureId,deptId,feeType,monthBudget,monthLimit,budgetMonth',
  4. sqlstr =
  5. "INSERT INTO month_budget(
  6. pastureId,
  7. deptId,
  8. feeType,
  9. monthBudget,
  10. monthLimit,
  11. budgetMonth
  12. )VALUES(
  13. ?,?,?,?,?,?
  14. )"
  15. where sqlname ='insertMonthbudget';
  16. update apisql
  17. set params='monthBudget,monthLimit,id',
  18. sqlstr ="update month_budget set monthBudget=?,monthLimit=? where id = ?"
  19. where sqlname ='updateMonthbudget';
  20. update dictlist set label = '饲养头数月预算' where label = '饲养头数月预算,';
  21. update apisql
  22. set sqlstr =
  23. "select
  24. mb.`budgetMonth`,
  25. mb.`feeType`,
  26. mb.`id`,
  27. mb.`monthBudget`,
  28. mb.`monthLimit`,
  29. mb.`pastureId`,
  30. p.`name` pastureName,
  31. mb.deptId,
  32. ifnull(d.name, '') deptName
  33. from
  34. month_budget mb
  35. inner join pasture p
  36. on
  37. p.id = mb.pastureId
  38. left join department d
  39. on
  40. d.id = mb.deptId
  41. where
  42. (p.`name` =?
  43. or ?= '现代牧业')
  44. and (mb.`feeType` = ?
  45. or ?= '')
  46. and (mb.deptId =?
  47. or ?= '' )
  48. order by
  49. mb.`budgetMonth` desc ,
  50. mb.`feeType` desc,
  51. mb.id desc"
  52. where sqlname ='getMonthbudgetlist';