Browse Source

清理mysql

wudianlong 2 years ago
parent
commit
e659e4b420
1 changed files with 35 additions and 22 deletions
  1. 35 22
      energy/dayTask/clean_mysql.sh

+ 35 - 22
energy/dayTask/clean_mysql.sh

@@ -21,6 +21,11 @@ database=saga_dev
 #del_energy_15_min_fjd="delete from energy_15_min_fjd where 1 = 1;"
 
 del_energy_15_min="truncate table energy_15_min;"
+del_co2_15_min="truncate table co2_15_min;"
+del_pm25_15_min="truncate table pm25_15_min;"
+del_hcho_15_min="truncate table hcho_15_min;"
+del_temperature_15_min="truncate table temperature_15_min;"
+del_humidity_15_min="truncate table humidity_15_min;"
 #del_energy_5_min="truncate table energy_5_min;"
 #del_energy_15_min_fjd="truncate table energy_15_min_fjd;"
 #del_energy_5_min_fjd="truncate table energy_5_min_fjd;"
@@ -30,43 +35,51 @@ clean_energy_15(){
 mysql -h${host}  -P3306  -u${username} -p${password} ${database} -e "${del_energy_15_min}"
 }
 
-clean_energy_5(){
-mysql -h${host}  -P3306  -u${username} -p${password} ${database} -e "${del_energy_5_min}"
+clean_co2_15_min(){
+mysql -h${host}  -P3306  -u${username} -p${password} ${database} -e "${del_co2_15_min}"
 }
 
-clean_energy_15_fjd(){
-mysql -h${host}  -P3306  -u${username} -p${password} ${database} -e "${del_energy_15_min_fjd}"
+clean_pm25_15_min(){
+mysql -h${host}  -P3306  -u${username} -p${password} ${database} -e "${del_pm25_15_min}"
 }
 
-clean_energy_5_fjd(){
-mysql -h${host}  -P3306  -u${username} -p${password} ${database} -e "${del_energy_5_min_fjd}"
+clean_hcho_15_min(){
+mysql -h${host}  -P3306  -u${username} -p${password} ${database} -e "${del_hcho_15_min}"
+}
+
+clean_temperature_15_min(){
+mysql -h${host}  -P3306  -u${username} -p${password} ${database} -e "${del_temperature_15_min}"
+}
+
+clean_humidity_15_min(){
+mysql -h${host}  -P3306  -u${username} -p${password} ${database} -e "${del_humidity_15_min}"
 }
 
 case $1 in
 "all")
     clean_energy_15
-    clean_energy_15_fjd
-    clean_energy_5
-    clean_energy_5_fjd
+    clean_co2_15_min
+    clean_pm25_15_min
+    clean_hcho_15_min
+    clean_temperature_15_min
+    clean_humidity_15_min
   ;;
-"clean_15")
+"clean_energy_15")
     clean_energy_15
-#    clean_energy_15_fjd
   ;;
-"clean_5")
-    clean_energy_5
-    clean_energy_5_fjd
+"clean_co2_15_min")
+    clean_co2_15_min
   ;;
-"clean_energy_15")
-    clean_energy_15
+"clean_pm25_15_min")
+    clean_pm25_15_min
   ;;
-"clean_energy_15_fjd")
-    clean_energy_15_fjd
+"clean_hcho_15_min")
+    clean_hcho_15_min
   ;;
-"clean_energy_5")
-    clean_energy_5
+"clean_temperature_15_min")
+    clean_temperature_15_min
   ;;
-"clean_energy_5_fjd")
-    clean_energy_5_fjd
+"clean_humidity_15_min")
+    clean_humidity_15_min
   ;;
 esac