PrintersDao.dql 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. -- [queryAuthorizationItems]
  2. select * from $table$;
  3. -- [deleteAuthorizationItems]
  4. delete from $table$;
  5. -- [addAuthorizationItems]
  6. insert into $table$ (permissionIndex, itemName, createBy,
  7. createTime, createTimeLong, updateBy,
  8. updateTime, updateTimeLong ) values (#{permissionindex}, #{itemname}, #{createby},
  9. #{createtime}, #{createtimelong}, #{updateby},
  10. #{updatetime}, #{updatetimelong} );
  11. -- [addPrinterClient]
  12. insert into $table$ (id, printerUniqueCode, printerName, voidFlag,
  13. authorizeDate, authorizeDateLong, province,
  14. city, district, address,
  15. permissions, createBy, createTime,
  16. createTimeLong, updateBy, updateTime,
  17. updateTimeLong ) values ( #{id}, #{printeruniquecode}, #{printername}, #{voidflag},
  18. #{authorizedate}, #{authorizedatelong}, #{province},
  19. #{city}, #{district}, #{address},
  20. #{permissions}, #{createby}, #{createtime},
  21. #{createtimelong}, #{updateby}, #{updatetime},
  22. #{updatetimelong} );
  23. -- [voidPrinterClient]
  24. update $table$ set voidFlag = #{voidflag} where id = #{id};
  25. -- [updatePrinterClient]
  26. update $table$ set printerName = #{printername},
  27. province = #{province}, city = #{city}, district = #{district},
  28. address = #{address} where id = #{id};
  29. -- [authorizePrinterClient]
  30. update $table$ set authorizeDate = #{authorizedate},
  31. authorizeDateLong = #{authorizedatelong},
  32. permissions = #{permissions}
  33. where id = #{id};
  34. -- [queryPrinterClients]
  35. select * from $table$
  36. -- trim prefix=WHERE prefixOverrides=AND|OR
  37. -- isNotEmpty printerName
  38. printerName LIKE #{Like:printerName}
  39. -- end
  40. -- isNotEmpty keyWord
  41. and (printerName LIKE #{Like:keyWord} or city LIKE #{Like:keyWord})
  42. -- end
  43. -- isNotEmpty printerUniqueCode
  44. and printerUniqueCode = #{printerUniqueCode}
  45. -- end
  46. -- isNotEmpty authOverDays
  47. -- if authOverDays >= 0
  48. and DATEDIFF(authorizeDate, NOW()) < #{authOverDays}
  49. -- end
  50. -- end
  51. -- isNotEmpty voidFlag
  52. -- if voidFlag >= 0
  53. and voidFlag = #{voidFlag}
  54. -- end
  55. -- end
  56. -- end
  57. ;