sql_query.py 1.8 KB

12345678910111213141516171819202122
  1. QUERY_BASE = """SELECT goods_no 货号, clothes_type 产品名称, CONCAT(color_id, color_name) AS 色号, style_batch 批次, hao_type 号型,
  2. exec_standard 执行标准, safe_standard 安全类别, element 纤维成分, maintaindes 保养说明, Maintaindes1 保养说明1, Maintaindes2
  3. 保养说明2, Maintaindes3 保养说明3, Maintaindes4 保养说明4, price 零售价, size 尺码, desc11, desc9 产地, desc4, desc5, size_id, color_name, color_id, language,
  4. warm 温馨提示, warm1 温馨提示1, warm2 温馨提示2, warm3 温馨提示3, warm4 温馨提示4, warm5 温馨提示5
  5. FROM water_mark_info WHERE matio_id = '{matio_id}' AND COLOR_ID = '{color_id}' AND SIZE = '{size}' AND language = 'CN'"""
  6. QUERY_MATIO_ID = """SELECT BAR_CODE, matio_id, COLOR_ID, SIZE FROM tag_code WHERE BAR_CODE LIKE '{barcode}%'"""
  7. query_condition_rfid = "AND print_type LIKE '%主打%'"
  8. query_condition_normal = "AND print_type NOT LIKE '%主打%'"
  9. color_sql = """SELECT language, color_id, color_name, clothes_type FROM water_mark_info WHERE matio_id = '{matio_id}' AND language = 'CN'"""
  10. color_code_sql = """SELECT code, name FROM color WHERE code = '{code}'"""
  11. size_first_sql = """SELECT SIZE, hao_type, size_id, clothes_type, language FROM water_mark_info WHERE matio_id = '{matio_id}' AND COLOR_ID = '{color_id}' AND language = 'CN'"""
  12. size_check_sql = """SELECT d.dict_label, s.size_code, s.sizes
  13. FROM base_size s
  14. LEFT JOIN sys_dict_data d ON d.dict_value = s.size_name
  15. WHERE d.dict_type = 'base_size_group'
  16. AND dict_label IN (SELECT group_size FROM water_mark_info WHERE group_size IS NOT NULL AND goods_no = '{item_id}' ORDER BY pkid ASC)
  17. AND s.language = 'CN'"""
  18. matio_id_sql = """SELECT distinct matio_id FROM tag_code WHERE prefix_code = '{prefix_code}' order by matio_id"""