'commit'
This commit is contained in:
57
DbKit/Sql/DouYin.sql
Normal file
57
DbKit/Sql/DouYin.sql
Normal file
@@ -0,0 +1,57 @@
|
||||
#namespace("DouYin")
|
||||
#sql("updateStatus")
|
||||
UPDATE t_douyin_record
|
||||
SET status = #para(status)
|
||||
#if(error_msg)
|
||||
, error_msg = #para(error_msg)
|
||||
#end
|
||||
WHERE id = #para(id)
|
||||
#end
|
||||
|
||||
#sql("updateRecord")
|
||||
UPDATE t_douyin_record
|
||||
SET video_name = #para(title),
|
||||
obs_url = #para(obs_url),
|
||||
transcript = #para(transcript),
|
||||
status = #para(status)
|
||||
WHERE id = #para(id)
|
||||
#end
|
||||
|
||||
#sql("insertRecord")
|
||||
INSERT INTO t_douyin_record (id, original_text, status, create_time)
|
||||
VALUES (#para(id), #para(url), 'PENDING', #para(create_time))
|
||||
#end
|
||||
|
||||
#sql("getRecords")
|
||||
SELECT * FROM t_douyin_record
|
||||
ORDER BY create_time DESC
|
||||
LIMIT #para(limit)
|
||||
#end
|
||||
|
||||
#sql("deleteRecord")
|
||||
DELETE FROM t_douyin_record WHERE id = #para(id)
|
||||
#end
|
||||
|
||||
#sql("getTranscriptsByIds")
|
||||
SELECT video_name, transcript
|
||||
FROM t_douyin_record
|
||||
WHERE id IN (#para(ids))
|
||||
AND status = 'COMPLETED'
|
||||
#end
|
||||
|
||||
#sql("getLatestTranscripts")
|
||||
SELECT video_name, transcript
|
||||
FROM t_douyin_record
|
||||
WHERE status = 'COMPLETED'
|
||||
ORDER BY create_time DESC
|
||||
LIMIT #para(limit)
|
||||
#end
|
||||
|
||||
#sql("getInterruptedTasks")
|
||||
SELECT id, original_text, status
|
||||
FROM t_douyin_record
|
||||
WHERE status IN ('PENDING', 'PROCESSING')
|
||||
ORDER BY create_time DESC
|
||||
LIMIT #para(limit)
|
||||
#end
|
||||
#end
|
||||
12
DbKit/Sql/HaiBao.sql
Normal file
12
DbKit/Sql/HaiBao.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
#namespace("HaiBao")
|
||||
#sql("insertHistory")
|
||||
INSERT INTO haibao_history (id, prompt, image_url, scheme_content, created_at)
|
||||
VALUES (#para(id), #para(prompt), #para(image_url), #para(scheme_content), #para(created_at))
|
||||
#end
|
||||
|
||||
#sql("getHistory")
|
||||
SELECT * FROM haibao_history
|
||||
ORDER BY created_at DESC
|
||||
LIMIT #para(limit)
|
||||
#end
|
||||
#end
|
||||
79
DbKit/Sql/YltAnalytics.sql
Normal file
79
DbKit/Sql/YltAnalytics.sql
Normal file
@@ -0,0 +1,79 @@
|
||||
#namespace("YltAnalytics")
|
||||
#sql("getOperatorsPriceTrends")
|
||||
SELECT
|
||||
p.operator,
|
||||
DATE(sc.valid_start_time) as date_str,
|
||||
sc.schedule_json
|
||||
FROM t_station_price_schedule_scd sc
|
||||
JOIN t_station_profile_scd p ON sc.station_hash = p.station_hash AND p.is_current = 1
|
||||
WHERE sc.valid_start_time >= DATE_SUB(CURDATE(), INTERVAL #para(days) DAY)
|
||||
ORDER BY date_str ASC
|
||||
#end
|
||||
|
||||
#sql("listYltStations")
|
||||
SELECT
|
||||
p.station_hash,
|
||||
p.operator,
|
||||
p.station_name,
|
||||
p.address,
|
||||
p.coord_x,
|
||||
p.coord_y,
|
||||
s.current_price
|
||||
FROM t_station_profile_scd p
|
||||
LEFT JOIN t_station_status_scd s
|
||||
ON p.station_hash = s.station_hash AND s.is_current = 1
|
||||
WHERE p.operator = '驿来特'
|
||||
#if(q)
|
||||
AND (p.station_name LIKE #para(kw) OR p.address LIKE #para(kw))
|
||||
#end
|
||||
ORDER BY p.station_name
|
||||
#end
|
||||
|
||||
#sql("fetchCurrentStations")
|
||||
SELECT
|
||||
p.station_hash,
|
||||
p.operator,
|
||||
p.station_name,
|
||||
p.address,
|
||||
p.coord_x,
|
||||
p.coord_y,
|
||||
s.current_price
|
||||
FROM t_station_profile_scd p
|
||||
LEFT JOIN t_station_status_scd s
|
||||
ON p.station_hash = s.station_hash AND s.is_current = 1
|
||||
WHERE p.is_current = 1
|
||||
#end
|
||||
|
||||
#sql("fetchStationScheduleJson")
|
||||
SELECT sc.schedule_json, p.operator
|
||||
FROM t_station_price_schedule_scd sc
|
||||
JOIN t_station_profile_scd p ON sc.station_hash = p.station_hash AND p.is_current = 1
|
||||
WHERE sc.station_hash = #para(h) AND sc.is_current = 1
|
||||
ORDER BY sc.valid_start_time DESC
|
||||
LIMIT 1
|
||||
#end
|
||||
|
||||
#sql("fetchCurrentStationRows")
|
||||
SELECT
|
||||
p.station_hash,
|
||||
p.station_name,
|
||||
p.address,
|
||||
p.coord_x,
|
||||
p.coord_y,
|
||||
s.total_piles AS total_guns,
|
||||
s.free_piles AS free_guns,
|
||||
s.current_price,
|
||||
s.pro_price,
|
||||
s.parking_info,
|
||||
s.distance,
|
||||
s.valid_start_time AS status_update_time,
|
||||
sc.schedule_json,
|
||||
sc.valid_start_time AS schedule_update_time,
|
||||
s.piles_detail_json
|
||||
FROM t_station_profile_scd p
|
||||
LEFT JOIN t_station_status_scd s ON p.station_hash = s.station_hash AND s.is_current = 1
|
||||
LEFT JOIN t_station_price_schedule_scd sc ON p.station_hash = sc.station_hash AND sc.is_current = 1
|
||||
WHERE p.operator = #para(op) AND p.is_current = 1
|
||||
ORDER BY p.station_name ASC
|
||||
#end
|
||||
#end
|
||||
Reference in New Issue
Block a user