
import at.dockwork.security.domain.*

import groovy.sql.Sql
import java.sql.Connection
import java.sql.DriverManager
import javax.sql.DataSource




class UpdateScriptService {

	def run(def connection, def dataSourceFields) {

		def resultMap = at.dockwork.system.service.DataSourceService.execute(
			connection,
			dataSourceFields,
			[
				mySQLStatement:"delete from dw_user_2_operator_type_2_person_wl",
				msSQLStatement:"delete from dw_user_2_operator_type_2_person_wl"
			]
		)

		resultMap = at.dockwork.system.service.DataSourceService.execute(
			connection,
			dataSourceFields,
			[
				mySQLStatement:"delete from dw_user_2_operator_type_2_person_bl",
				msSQLStatement:"delete from dw_user_2_operator_type_2_person_bl"
			]
		)

		resultMap = at.dockwork.system.service.DataSourceService.execute(
			connection,
			dataSourceFields,
			[
				mySQLStatement:"delete from dw_user_2_operator_type_2_person_category_wl",
				msSQLStatement:"delete from dw_user_2_operator_type_2_person_category_wl"
			]
		)

		resultMap = at.dockwork.system.service.DataSourceService.execute(
			connection,
			dataSourceFields,
			[
				mySQLStatement:"delete from dw_user_2_operator_type_2_person_category_bl",
				msSQLStatement:"delete from dw_user_2_operator_type_2_person_category_bl"
			]
		)

		resultMap = at.dockwork.system.service.DataSourceService.execute(
			connection,
			dataSourceFields,
			[
				mySQLStatement:"delete from dw_user_2_operator_type",
				msSQLStatement:"delete from dw_user_2_operator_type"
			]
		)

		resultMap = at.dockwork.system.service.DataSourceService.execute(
			connection,
			dataSourceFields,
			[
				mySQLStatement:"delete from dw_operator_type_2_operation_role_2_personal_pronoun",
				msSQLStatement:"delete from dw_operator_type_2_operation_role_2_personal_pronoun"
			]
		)

		resultMap = at.dockwork.system.service.DataSourceService.execute(
			connection,
			dataSourceFields,
			[
				mySQLStatement:"delete from dw_operator_type_2_report_role_2_personal_pronoun",
				msSQLStatement:"delete from dw_operator_type_2_report_role_2_personal_pronoun"
			]
		)

		resultMap = at.dockwork.system.service.DataSourceService.execute(
			connection,
			dataSourceFields,
			[
				mySQLStatement:"delete from dw_operator_type_2_operation_role",
				msSQLStatement:"delete from dw_operator_type_2_operation_role"
			]
		)

		resultMap = at.dockwork.system.service.DataSourceService.execute(
			connection,
			dataSourceFields,
			[
				mySQLStatement:"delete from dw_operator_type_2_report_role",
				msSQLStatement:"delete from dw_operator_type_2_report_role"
			]
		)

		resultMap = at.dockwork.system.service.DataSourceService.execute(
			connection,
			dataSourceFields,
			[
				mySQLStatement:"delete from dw_operator_type_2_script",
				msSQLStatement:"delete from dw_operator_type_2_script"
			]
		)

		resultMap = at.dockwork.system.service.DataSourceService.execute(
			connection,
			dataSourceFields,
			[
				mySQLStatement:"delete from dw_operator_type_2_menu",
				msSQLStatement:"delete from dw_operator_type_2_menu"
			]
		)

		true
	}
}
