Commit 38436103 by zhengxj

finish sql on 20191028 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@24459 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent b84729d8
......@@ -34,7 +34,24 @@ CREATE TABLE `sys_service_item_photo_config` (
ALTER TABLE `sys_order`
ADD COLUMN `service_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '服务项目代码' AFTER `reference_price`,
ALTER TABLE `sys_order_file`
ADD COLUMN `file_name` varchar(64) NULL DEFAULT '' COMMENT '照片名称' AFTER `order_id`,
ADD COLUMN `file_desc` varchar(128) NULL DEFAULT '' COMMENT '文件描述' AFTER `file_type`;
-----技工表新增字段
ALTER TABLE `sys_mechanic`
ADD COLUMN `bank_card_no` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '银行卡号' AFTER `send_type`,
ADD COLUMN `real_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '真实姓名' AFTER `real_name`,
-----标记改派技工的状态记录
UPDATE sys_order_status sos
SET sos.remark = 'discard'
WHERE
sos.id NOT IN ( SELECT MAx( Id ) AS Id
FROM
( SELECT * FROM sys_order_status order_id WHERE active_status = 4 ) d
GROUP BY
order_id
HAVING
COUNT( order_id ) > 1
)
AND sos.order_id IN ( SELECT order_id FROM ( SELECT * FROM sys_order_status order_id WHERE active_status = 4 ) d GROUP BY order_id HAVING COUNT( order_id ) > 1 )
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!