feat:交易记录、日期组建

This commit is contained in:
dzc committed 2025-03-11 18:04:58 +08:00
1 parent 08ad1c2d81
commit 88e73ad950
32 files changed
+672 -279

No files matched your search

@@ -33,7 +33,7 @@ abstract class OrderDao {
(:status == "-1" OR status = :status) AND
(:sysType = '-1' OR sysType = :sysType) AND
(:hourType = '-1' OR hourType = :hourType) AND
createTime >= :startCreateOrderTime AND createTime <= :endCreateOrderTime
strftime('%Y-%m-%d', createTime) >= strftime('%Y-%m-%d', :startCreateOrderTime) AND strftime('%Y-%m-%d', createTime) <= strftime('%Y-%m-%d', :endCreateOrderTime)
ORDER BY createTime DESC
LIMIT :pageSize OFFSET :offset
''')
@@ -53,7 +53,7 @@ abstract class OrderDao {
(:status == "-1" OR status = :status) AND
(:sysType = '-1' OR sysType = :sysType) AND
(:hourType = '-1' OR hourType = :hourType) AND
createTime >= :startCreateOrderTime AND createTime <= :endCreateOrderTime
strftime('%Y-%m-%d', createTime) >= strftime('%Y-%m-%d', :startCreateOrderTime) AND strftime('%Y-%m-%d', createTime) <= strftime('%Y-%m-%d', :endCreateOrderTime)
''')
Future<int?> count(
String status,
@@ -19,6 +19,7 @@ abstract class ProductDao {
final placeholders = List.generate(codes.length, (index) => '?').join(', ');
final sql = '''
UPDATE product SET delFlag = 1 WHERE serviceUniqueCode IN ($placeholders)
AND (sysType = 'canteen' OR strftime('%Y-%m-%d', saleDate) = strftime('%Y-%m-%d', 'now', 'localtime'))
''';
return await database.rawUpdate(sql, [...codes]);
}
@@ -38,7 +39,9 @@ abstract class ProductDao {
@Query("""
UPDATE product SET isDefault = :isDefault
WHERE
delFlag = 0 AND serviceUniqueCode = :uniqueCode AND hourType = :hourType
delFlag = 0
AND serviceUniqueCode = :uniqueCode AND hourType = :hourType
AND (sysType = 'canteen' OR strftime('%Y-%m-%d', saleDate) = strftime('%Y-%m-%d', 'now', 'localtime'))
""")
Future<void> edit(bool isDefault, String uniqueCode, String hourType);
@@ -51,6 +54,7 @@ abstract class ProductDao {
delFlag = 0
AND (:sysType = '-1' OR sysType = :sysType)
AND (:hourType = '-1' OR INSTR(',' || hourType || ',', ',' || :hourType || ',') > 0)
AND (:sysType = 'canteen' OR strftime('%Y-%m-%d', saleDate) = strftime('%Y-%m-%d', 'now', 'localtime'))
""")
Future<int?> getCount(
String sysType,
@@ -88,11 +92,12 @@ abstract class ProductDao {
product.delFlag = 0 AND
(:classifyServiceUniqueCode = '-1' OR product.classifyServiceUniqueCode = :classifyServiceUniqueCode) AND
(:hourType = '-1' OR INSTR(',' || product.hourType || ',', ',' || :hourType || ',') > 0) AND
(:sysType = '-1' OR product.sysType = :sysType)
(:sysType = '-1' OR product.sysType = :sysType) AND
(:sysType = 'canteen' OR strftime('%Y-%m-%d', product.saleDate) = strftime('%Y-%m-%d', 'now', 'localtime'))
ORDER BY classify.sort, classify.id, product.price
LIMIT :pageSize OFFSET :offset
''')
Future<List<ProductEntity>> getCurrentDayAllPage(
Future<List<ProductEntity>> getAllPage(
String classifyServiceUniqueCode,
String hourType,
String sysType,
@@ -103,10 +108,11 @@ abstract class ProductDao {
@Query('''
SELECT * FROM product
WHERE
product.delFlag = 0
delFlag = 0
AND isDefault = 1
AND (:sysType = '-1' OR sysType = :sysType)
AND (:hourType = '-1' OR hourType = :hourType)
AND (:sysType = 'canteen' OR strftime('%Y-%m-%d', saleDate) = strftime('%Y-%m-%d', 'now', 'localtime'))
''')
Future<List<ProductEntity>> getDefault(String sysType, String hourType);
}