diff --git a/.gitignore b/.gitignore
index 0f182a0..b82a7cd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,12 @@
*.class
+*.prefs
+.settings
+.project
+.classpath
# Package Files #
*.jar
*.war
*.ear
+/crm/src/main/webapp/Charts/exporting-server/java/highcharts-export/highcharts-export-convert/target/
+/crm/src/main/webapp/Charts/exporting-server/java/highcharts-export/highcharts-export-web/target/
\ No newline at end of file
diff --git a/README.md b/README.md
index 0b0c46b..0800f68 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,30 @@
-tigerp
+fei
======
-Tiger's public repo
\ No newline at end of file
+Fy's public repo for the BaaS system.
+
+
+Some notes:
+
+1. You can create your database schema and restore database by executing following command
+
mysql -ucrm crmdb < src/main/db/dump.sql
+
+2. If you want to try 'offline' version of the service, you can check it out at http://localhost:8080/offline/home.html
+
+
+some users/password roles for the testing.
+
+tig/12345 Manager
+
+li/12345 Admin
+
+pi/12345 Sales
+
+ki/12345 Sales
+
+
+All report to tig
+
+
+
+
diff --git a/crm/.gitignore b/crm/.gitignore
new file mode 100644
index 0000000..ea8c4bf
--- /dev/null
+++ b/crm/.gitignore
@@ -0,0 +1 @@
+/target
diff --git a/crm/ReportEngine/genReport.bat b/crm/ReportEngine/genReport.bat
new file mode 100644
index 0000000..b9273ea
--- /dev/null
+++ b/crm/ReportEngine/genReport.bat
@@ -0,0 +1,91 @@
+ECHO off
+
+REM org.eclipse.birt.report.engine.impl.ReportRunner Usage:
+REM --mode/-m [ run | render | runrender] the default is runrender
+REM for runrender mode:
+REM we should add it in the end
+REM --format/-f [ HTML \| PDF ]
+REM --output/-o
+REM --htmlType/-t < HTML \| ReportletNoCSS >
+REM --locale /-l
+REM --parameter/-p <"parameterName=parameterValue">
+REM --file/-F
+REM --encoding/-e
+REM
+REM Locale: default is english
+REM parameters in command line will overide parameters in parameter file
+REM parameter name cant include characters such as \ ', '=', ':'
+REM
+REM For RUN mode:
+REM we should add it in the end
+REM --output/-o
+REM --locale /-l
+REM --parameter/-p
+REM --file/-F
+REM
+REM Locale: default is english
+REM parameters in command line will overide parameters in parameter file
+REM parameter name cant include characters such as \ ', '=', ':'
+REM
+REM For RENDER mode:
+REM we should add it in the end
+REM --output/-o
+REM --page/-p
+REM --locale /-l
+REM
+REM Locale: default is english
+IF not "%BIRT_HOME%" == "" GOTO runBirt
+ECHO "Please set BIRT_HOME first."
+GOTO end
+:runBirt
+
+
+SET java.io.tmpdir=%BIRT_HOME%\ReportEngine\tmpdir
+SET org.eclipse.datatools_workspacepath=%java.io.tmpdir%\workspace_dtp
+
+
+IF not exist %java.io.tmpdir% mkdir %java.io.tmpdir%
+IF not exist %org.eclipse.datatools_workspacepath% mkdir %org.eclipse.datatools_workspacepath%
+
+
+REM set the birt class path.
+setlocal enabledelayedexpansion
+set BIRTCLASSPATH=
+for %%i in (%BIRT_HOME%\ReportEngine\lib\*.jar) do set BIRTCLASSPATH=%%i;!BIRTCLASSPATH!
+
+
+REM set command
+SET JAVACMD=java
+set p1=%1
+set p2=%2
+set p3=%3
+set p4=%4
+set p5=%5
+set p6=%6
+set p7=%7
+set p8=%8
+set p9=%9
+shift
+set p10=%9
+shift
+set p11=%9
+shift
+set p12=%9
+shift
+set p13=%9
+shift
+set p14=%9
+shift
+set p15=%9
+shift
+set p16=%9
+shift
+set p17=%9
+shift
+set p18=%9
+shift
+set p19=%9
+
+%JAVACMD% -cp "%BIRTCLASSPATH%" -DBIRT_HOME="%BIRT_HOME%\ReportEngine" org.eclipse.birt.report.engine.api.ReportRunner %p1% %p2% %p3% %p4% %p5% %p6% %p7% %p8% %p9% %p10% %p11% %p12% %p13% %p14% %p15% %p16% %p17% %p18% %p19%
+
+:end
diff --git a/crm/ReportEngine/genReport.sh b/crm/ReportEngine/genReport.sh
new file mode 100644
index 0000000..49530d2
--- /dev/null
+++ b/crm/ReportEngine/genReport.sh
@@ -0,0 +1,53 @@
+################USAGE OF REPORTRUNNER#########################
+# echo "org.eclipse.birt.report.engine.impl.ReportRunner Usage:";
+# echo "--mode/-m [ run | render | runrender] the default is runrender "
+# echo "for runrender mode: "
+# echo "" "we should add it in the end "
+# echo "" "--format/-f [ HTML | PDF ] "
+# echo "" "--output/-o "
+# echo "" "--htmlType/-t < HTML | ReportletNoCSS >"
+# echo "" "--locale /-l"
+# echo "" "--parameter/-p <"parameterName=parameterValue">"
+# echo "" "--file/-F "
+# echo "" "--encoding/-e "
+# echo " "
+# echo "Locale: default is english"
+# echo "parameters in command line will overide parameters in parameter file"
+# echo "parameter name cant include characters such as \ ', '=', ':'"
+# echo " "
+# echo "For RUN mode:"
+# echo "we should add it in the end"
+# echo "" "--output/-o "
+# echo "" "--locale /-l"
+# echo "" "--parameter/-p "
+# echo "" "--file/-F "
+# echo " "
+# echo "Locale: default is english"
+# echo "parameters in command line will overide parameters in parameter file"
+# echo "parameter name cant include characters such as \ ', '=', ':'"
+# echo " "
+# echo "For RENDER mode:"
+# echo "" "we should add it in the end"
+# echo "" "--output/-o "
+# echo "" "--page/-p "
+# echo "" "--locale /-l"
+# echo " "
+# echo "Locale: default is english"
+################END OF USAGE #########################
+if [ "$BIRT_HOME" = "" ];
+
+then
+echo " The BIRT_HOME need be set before BirtRunner can run.";
+else
+
+
+java_io_tmpdir=$BIRT_HOME/ReportEngine/tmpdir
+org_eclipse_datatools_workspacepath=$java_io_tmpdir/workspace_dtp
+mkdir -p $org_eclipse_datatools_workspacepath
+unset BIRTCLASSPATH
+for i in `ls $BIRT_HOME/ReportEngine/lib/*.jar`;do export BIRTCLASSPATH=$i:$BIRTCLASSPATH;done
+
+JAVACMD='java';
+$JAVACMD -Djava.awt.headless=true -cp "$BIRTCLASSPATH" -DBIRT_HOME="$BIRT_HOME/ReportEngine" -Dorg.eclipse.datatools_workspacepath="$org_eclipse_datatools_workspacepath" org.eclipse.birt.report.engine.api.ReportRunner ${1+"$@"}
+
+fi
diff --git a/crm/ReportEngine/samples/AccountAndContact.rptdesign b/crm/ReportEngine/samples/AccountAndContact.rptdesign
new file mode 100644
index 0000000..6542a0d
--- /dev/null
+++ b/crm/ReportEngine/samples/AccountAndContact.rptdesign
@@ -0,0 +1,1473 @@
+
+
+ Eclipse BIRT Designer Version 4.3.1.v201309091055 Build <4.3.1.v20130917-1035>
+ in
+ /templates/blank_report.gif
+ ltr
+ 72
+
+
+
+
+ metadataBidiFormatStr
+ ILYNN
+
+
+ disabledMetadataBidiFormatStr
+
+
+ contentBidiFormatStr
+ ILYNN
+
+
+ disabledContentBidiFormatStr
+
+
+ com.mysql.jdbc.Driver
+ jdbc:mysql://localhost/crmdb
+ crm
+
+
+
+
+
+
+ id
+ measure
+ cid
+ cid
+
+
+ name
+ dimension
+ cname
+ cname
+
+
+ id_3
+ measure
+ aid
+ aid
+
+
+ name_4
+ dimension
+ aname
+ aname
+
+
+ bdm_code
+ dimension
+ BDMCode
+ BDMCode
+
+
+
+
+
+ 1
+ id
+ integer
+
+
+ 2
+ name
+ string
+
+
+ 3
+ id_3
+ integer
+
+
+ 4
+ name_4
+ string
+
+
+ 5
+ bdm_code
+ string
+
+
+
+ Data Source
+
+
+ 1
+ id
+ id
+ integer
+ 4
+
+
+ 2
+ name
+ name
+ string
+ 12
+
+
+ 3
+ id_3
+ id
+ integer
+ 4
+
+
+ 4
+ name_4
+ name
+ string
+ 12
+
+
+ 5
+ bdm_code
+ bdm_code
+ string
+ 12
+
+
+
+
+
+ 2.0
+
+
+
+
+
+
+ id
+ 1
+
+ 4
+ 9
+ 0
+ NotNullable
+
+ cid
+
+
+
+ cid
+
+ 9
+
+
+
+
+
+
+ name
+ 2
+
+ 12
+ 255
+ 0
+ NotNullable
+
+ cname
+
+
+
+ cname
+
+ 255
+
+
+
+
+
+
+ id
+ 3
+
+ 4
+ 9
+ 0
+ Nullable
+
+ aid
+
+
+
+ aid
+
+ 9
+
+
+
+
+
+
+ name
+ 4
+
+ 12
+ 255
+ 0
+ Nullable
+
+ aname
+
+
+
+ aname
+
+ 255
+
+
+
+
+
+
+ bdm_code
+ 5
+
+ 12
+ 255
+ 0
+ Nullable
+
+ BDMCode
+
+
+
+ BDMCode
+
+ 255
+
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+ NewTabularHierarchy
+
+
+
+
+ integer
+ id_3
+
+
+
+
+
+
+ NewTabularHierarchy1
+
+
+
+
+ string
+ name_4
+
+
+
+
+
+
+
+
+
+
+ count
+ dataSetRow["name_4"]
+ integer
+
+
+
+
+ Account&Contact
+
+
+
+
+
+
+
+
+
+
+
+
+ html
+ new Date()]]>
+
+
+
+
+
+
+ solid
+ 1px
+ solid
+ 1px
+ solid
+ 1px
+ solid
+ 1px
+ 7.930555555555555in
+ Account&Contact
+
+
+ id
+ cid
+ dataSetRow["id"]
+ integer
+
+
+ name
+ cname
+ dataSetRow["name"]
+ string
+
+
+ id_3
+ aid
+ dataSetRow["id_3"]
+ integer
+
+
+ name_4
+ aname
+ dataSetRow["name_4"]
+ string
+
+
+ bdm_code
+ BDMCode
+ dataSetRow["bdm_code"]
+ string
+
+
+
+ justify
+ 1.5694444444444444in
+
+
+ 1.6111111111111112in
+
+
+ justify
+ 1.5833333333333333in
+
+
+ justify
+ 1.5833333333333333in
+
+
+ justify
+ 1.5833333333333333in
+
+
+
+ none
+ none
+ none
+ none
+
+ NewStyle
+ solid
+ medium
+
+ none
+ none
+ none
+ none
+ 医生ID
+
+ |
+
+ NewStyle
+ solid
+ medium
+
+ none
+ none
+ none
+ none
+ justify
+ 医生姓名
+
+ |
+
+ NewStyle
+ solid
+ medium
+
+ none
+ none
+ none
+ none
+ 医院ID
+
+ |
+
+ NewStyle
+ solid
+ medium
+
+ none
+ none
+ none
+ none
+ 医院名称
+
+ |
+
+ NewStyle
+ none
+ none
+ solid
+ medium
+ none
+
+ none
+ none
+ none
+ none
+ 医院BDM
+
+ |
+
+
+
+
+ none
+ none
+ none
+ none
+
+ NewStyle
+ solid
+ medium
+
+ none
+ none
+ none
+ none
+ id
+
+ |
+
+ NewStyle
+ solid
+ medium
+
+ none
+ none
+ none
+ none
+ name
+
+ |
+
+ NewStyle
+ solid
+ medium
+
+ none
+ none
+ none
+ none
+ id_3
+
+ |
+
+ NewStyle
+ solid
+ medium
+
+ none
+ none
+ none
+ none
+ name_4
+
+ |
+
+ NewStyle
+ solid
+ medium
+
+ none
+ none
+ none
+ none
+ bdm_code
+
+ |
+
+
+
+
+
+ solid
+ medium
+ |
+
+ solid
+ medium
+ |
+
+ solid
+ medium
+ |
+
+ solid
+ medium
+ |
+
+ solid
+ medium
+ |
+
+
+
+
+ Data Cube
+
+ 2.6.1
+ Pie Chart
+ Standard
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+
+
+ 医院医生数统计
+
+ 16.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+ 5
+ 5
+
+
+
+ 0
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+
+
+
+ 0
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 2.0
+ 2.0
+ 2.0
+ 2.0
+
+
+
+
+
+
+
+
+ Vertical
+ Top_Bottom
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+ Right
+ Categories
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Above
+
+
+ 0.0
+ 0.0
+ 212.0
+ 130.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+
+ Two_Dimensional
+ Points
+ 10.0
+ 0
+
+ enable.area.alt
+ false
+
+
+
+ 'A','B','C','D','E'
+
+
+ 6,4,12,8,10
+ 0
+
+
+
+
+
+ This chart contains no data.
+
+
+ Center
+ Center
+
+
+
+
+ 64
+ 127
+ 127
+ 127
+
+
+
+ 128
+ 127
+ 127
+ 127
+
+ true
+
+
+ 10.0
+ 10.0
+ 10.0
+ 10.0
+
+ false
+
+
+
+
+
+
+
+ 255
+ 80
+ 166
+ 218
+
+
+ 255
+ 242
+ 88
+ 106
+
+
+ 255
+ 232
+ 172
+ 57
+
+
+ 255
+ 128
+ 255
+ 128
+
+
+ 255
+ 64
+ 128
+ 128
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 170
+ 85
+ 85
+
+
+ 255
+ 128
+ 128
+ 0
+
+
+ 255
+ 192
+ 192
+ 192
+
+
+ 255
+ 255
+ 255
+ 128
+
+
+ 255
+ 128
+ 192
+ 128
+
+
+ 255
+ 7
+ 146
+ 94
+
+
+ 255
+ 0
+ 128
+ 255
+
+
+ 255
+ 255
+ 128
+ 192
+
+
+ 255
+ 0
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 128
+
+
+ 255
+ 0
+ 128
+ 192
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 255
+ 0
+ 255
+
+
+ 255
+ 128
+ 64
+ 64
+
+
+ 255
+ 255
+ 128
+ 64
+
+
+ 255
+ 80
+ 240
+ 120
+
+
+ 255
+ 0
+ 64
+ 128
+
+
+ 255
+ 128
+ 0
+ 64
+
+
+ 255
+ 255
+ 0
+ 128
+
+
+ 255
+ 128
+ 128
+ 64
+
+
+ 255
+ 128
+ 128
+ 128
+
+
+ 255
+ 255
+ 128
+ 255
+
+
+ 255
+ 0
+ 64
+ 0
+
+
+ 255
+ 0
+ 0
+ 0
+
+
+ 255
+ 255
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 0
+
+
+
+
+
+
+
+
+ 255
+ 80
+ 166
+ 218
+
+
+ 255
+ 242
+ 88
+ 106
+
+
+ 255
+ 232
+ 172
+ 57
+
+
+ 255
+ 128
+ 255
+ 128
+
+
+ 255
+ 64
+ 128
+ 128
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 170
+ 85
+ 85
+
+
+ 255
+ 128
+ 128
+ 0
+
+
+ 255
+ 192
+ 192
+ 192
+
+
+ 255
+ 255
+ 255
+ 128
+
+
+ 255
+ 128
+ 192
+ 128
+
+
+ 255
+ 7
+ 146
+ 94
+
+
+ 255
+ 0
+ 128
+ 255
+
+
+ 255
+ 255
+ 128
+ 192
+
+
+ 255
+ 0
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 128
+
+
+ 255
+ 0
+ 128
+ 192
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 255
+ 0
+ 255
+
+
+ 255
+ 128
+ 64
+ 64
+
+
+ 255
+ 255
+ 128
+ 64
+
+
+ 255
+ 80
+ 240
+ 120
+
+
+ 255
+ 0
+ 64
+ 128
+
+
+ 255
+ 128
+ 0
+ 64
+
+
+ 255
+ 255
+ 0
+ 128
+
+
+ 255
+ 128
+ 128
+ 64
+
+
+ 255
+ 128
+ 128
+ 128
+
+
+ 255
+ 255
+ 128
+ 255
+
+
+ 255
+ 0
+ 64
+ 0
+
+
+ 255
+ 0
+ 0
+ 0
+
+
+ 255
+ 255
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 0
+
+
+
+ true
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+
+ data["id/aname"]
+
+ Text
+ Sum
+
+
+
+
+ Orthogonal_Value
+
+ ,
+
+ Outside
+ false
+
+ onmouseover
+
+ Show_Tooltip
+
+
+ 200
+
+
+
+ 0
+
+
+
+
+ 16.0
+ true
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+ Below
+
+
+ 1
+ true
+
+ 10.0
+
+
+ Text
+ Sum
+
+
+
+ true
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+
+ data["name/aname"]
+
+
+
+
+ Orthogonal_Value
+
+ ,
+
+ Outside
+ false
+
+
+ Text
+ Sum
+
+
+
+]]>
+ SVG
+ false
+ 130pt
+ 212pt
+
+
+ id/aid
+ dimension["id"]["aid"]
+ integer
+
+
+ name/aname
+ dimension["name"]["aname"]
+ string
+
+
+ id/aid1
+ measure["aid"]
+ integer
+ SUM
+
+
+ id/aname
+ measure["aname"]
+ integer
+ SUM
+
+
+
+
+
diff --git a/crm/ReportEngine/samples/UserAndRole.rptdesign b/crm/ReportEngine/samples/UserAndRole.rptdesign
new file mode 100644
index 0000000..3b50061
--- /dev/null
+++ b/crm/ReportEngine/samples/UserAndRole.rptdesign
@@ -0,0 +1,2604 @@
+
+
+ Eclipse BIRT Designer Version 4.3.1.v201309091055 Build <4.3.1.v20130917-1035>
+ in
+ /templates/blank_report.gif
+ ltr
+ 72
+
+
+
+
+ metadataBidiFormatStr
+ ILYNN
+
+
+ disabledMetadataBidiFormatStr
+
+
+ contentBidiFormatStr
+ ILYNN
+
+
+ disabledContentBidiFormatStr
+
+
+ com.mysql.jdbc.Driver
+ jdbc:mysql://localhost/crmdb
+ crm
+
+
+
+
+
+
+ id
+ measure
+ uid
+ uid
+
+
+ name
+ dimension
+ uname
+ uname
+
+
+ id_3
+ measure
+ cid
+ cid
+
+
+ name_4
+ dimension
+ cname
+ cname
+
+
+ id_5
+ measure
+ rid
+ rid
+
+
+ val
+ dimension
+ rolename
+ rolename
+
+
+
+
+
+
+ 1
+ id
+ integer
+
+
+ 2
+ name
+ string
+
+
+ 3
+ id_3
+ integer
+
+
+ 4
+ name_4
+ string
+
+
+ 5
+ id_5
+ integer
+
+
+ 6
+ val
+ string
+
+
+
+ Data Source
+
+
+ 1
+ id
+ id
+ integer
+ 4
+
+
+ 2
+ name
+ name
+ string
+ 12
+
+
+ 3
+ id_3
+ id
+ integer
+ 4
+
+
+ 4
+ name_4
+ name
+ string
+ 12
+
+
+ 5
+ id_5
+ id
+ integer
+ 4
+
+
+ 6
+ val
+ val
+ string
+ 12
+
+
+ ""]]>
+
+
+ 2.0
+
+
+
+
+
+
+ id
+ 1
+
+ 4
+ 9
+ 0
+ NotNullable
+
+ uid
+
+
+
+ uid
+
+ 9
+
+
+
+
+
+
+ name
+ 2
+
+ 12
+ 255
+ 0
+ NotNullable
+
+ uname
+
+
+
+ uname
+
+ 255
+
+
+
+
+
+
+ id
+ 3
+
+ 4
+ 9
+ 0
+ Nullable
+
+ cid
+
+
+
+ cid
+
+ 9
+
+
+
+
+
+
+ name
+ 4
+
+ 12
+ 255
+ 0
+ Nullable
+
+ cname
+
+
+
+ cname
+
+ 255
+
+
+
+
+
+
+ id
+ 5
+
+ 4
+ 9
+ 0
+ Nullable
+
+ rid
+
+
+
+ rid
+
+ 9
+
+
+
+
+
+
+ val
+ 6
+
+ 12
+ 255
+ 0
+ Nullable
+
+ rolename
+
+
+
+ rolename
+
+ 255
+
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+ NewTabularHierarchy
+
+
+
+
+ integer
+ id_3
+
+
+
+
+
+
+ NewTabularHierarchy1
+
+
+
+
+ string
+ name
+
+
+
+
+
+
+ NewTabularHierarchy2
+
+
+
+
+ string
+ val
+
+
+
+
+
+
+
+
+
+
+ count
+ false
+ dataSetRow["id_5"]
+ integer
+ true
+
+
+
+
+ User&Role
+
+
+
+
+
+
+
+
+
+
+
+ html
+ new Date()]]>
+
+
+
+
+
+
+ left
+ User&Role
+
+
+ id
+ uid
+ dataSetRow["id"]
+ integer
+
+
+ name
+ uname
+ dataSetRow["name"]
+ string
+
+
+ id_3
+ cid
+ dataSetRow["id_3"]
+ integer
+
+
+ name_4
+ cname
+ dataSetRow["name_4"]
+ string
+
+
+ id_5
+ rid
+ dataSetRow["id_5"]
+ integer
+
+
+ val
+ rolename
+ dataSetRow["val"]
+ string
+
+
+
+
+
+
+
+
+
+
+
+ 6
+ 1
+
+ 16pt
+ center
+ 用户--岗位-角色关系表
+
+ |
+
+
+ 12pt
+ bold
+ #996633
+
+
+ 用户ID
+
+ |
+
+
+ 用户名
+
+ |
+
+
+ 岗位ID
+
+ |
+
+
+ 岗位名称
+
+ |
+
+
+ 角色ID
+
+ |
+
+
+ 角色
+
+ |
+
+
+
+
+
+
+ id
+
+ |
+
+
+ name
+
+ |
+
+
+ id_3
+
+ |
+
+
+ name_4
+
+ |
+
+
+ id_5
+
+ |
+
+
+ val
+
+ |
+
+
+
+
+ 0.19444444444444445in
+ |
+ |
+ |
+ |
+ |
+ |
+
+
+
+
+ User&Role
+
+
+
+
+
+
+ Data Cube
+
+ 2.6.1
+ Pie Chart
+ Standard
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+
+
+ 角色分布情况
+
+ 16.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+ 5
+ 5
+
+
+
+ 0
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+
+
+
+ 0
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 2.0
+ 2.0
+ 2.0
+ 2.0
+
+
+
+
+
+
+
+
+ Vertical
+ Top_Bottom
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+ Right
+ Categories
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Above
+
+
+ 0.0
+ 0.0
+ 212.0
+ 130.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+
+ Two_Dimensional
+ Points
+ 10.0
+ 0
+
+ enable.area.alt
+ false
+
+
+
+ 'A','B','C','D','E'
+
+
+ 6,4,12,8,10
+ 0
+
+
+
+
+
+ This chart contains no data.
+
+
+ Center
+ Center
+
+
+
+
+ 64
+ 127
+ 127
+ 127
+
+
+
+ 128
+ 127
+ 127
+ 127
+
+ true
+
+
+ 10.0
+ 10.0
+ 10.0
+ 10.0
+
+ false
+
+
+
+
+
+
+
+ 255
+ 80
+ 166
+ 218
+
+
+ 255
+ 242
+ 88
+ 106
+
+
+ 255
+ 232
+ 172
+ 57
+
+
+ 255
+ 128
+ 255
+ 128
+
+
+ 255
+ 64
+ 128
+ 128
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 170
+ 85
+ 85
+
+
+ 255
+ 128
+ 128
+ 0
+
+
+ 255
+ 192
+ 192
+ 192
+
+
+ 255
+ 255
+ 255
+ 128
+
+
+ 255
+ 128
+ 192
+ 128
+
+
+ 255
+ 7
+ 146
+ 94
+
+
+ 255
+ 0
+ 128
+ 255
+
+
+ 255
+ 255
+ 128
+ 192
+
+
+ 255
+ 0
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 128
+
+
+ 255
+ 0
+ 128
+ 192
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 255
+ 0
+ 255
+
+
+ 255
+ 128
+ 64
+ 64
+
+
+ 255
+ 255
+ 128
+ 64
+
+
+ 255
+ 80
+ 240
+ 120
+
+
+ 255
+ 0
+ 64
+ 128
+
+
+ 255
+ 128
+ 0
+ 64
+
+
+ 255
+ 255
+ 0
+ 128
+
+
+ 255
+ 128
+ 128
+ 64
+
+
+ 255
+ 128
+ 128
+ 128
+
+
+ 255
+ 255
+ 128
+ 255
+
+
+ 255
+ 0
+ 64
+ 0
+
+
+ 255
+ 0
+ 0
+ 0
+
+
+ 255
+ 255
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 0
+
+
+
+
+
+
+
+
+ 255
+ 80
+ 166
+ 218
+
+
+ 255
+ 242
+ 88
+ 106
+
+
+ 255
+ 232
+ 172
+ 57
+
+
+ 255
+ 128
+ 255
+ 128
+
+
+ 255
+ 64
+ 128
+ 128
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 170
+ 85
+ 85
+
+
+ 255
+ 128
+ 128
+ 0
+
+
+ 255
+ 192
+ 192
+ 192
+
+
+ 255
+ 255
+ 255
+ 128
+
+
+ 255
+ 128
+ 192
+ 128
+
+
+ 255
+ 7
+ 146
+ 94
+
+
+ 255
+ 0
+ 128
+ 255
+
+
+ 255
+ 255
+ 128
+ 192
+
+
+ 255
+ 0
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 128
+
+
+ 255
+ 0
+ 128
+ 192
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 255
+ 0
+ 255
+
+
+ 255
+ 128
+ 64
+ 64
+
+
+ 255
+ 255
+ 128
+ 64
+
+
+ 255
+ 80
+ 240
+ 120
+
+
+ 255
+ 0
+ 64
+ 128
+
+
+ 255
+ 128
+ 0
+ 64
+
+
+ 255
+ 255
+ 0
+ 128
+
+
+ 255
+ 128
+ 128
+ 64
+
+
+ 255
+ 128
+ 128
+ 128
+
+
+ 255
+ 255
+ 128
+ 255
+
+
+ 255
+ 0
+ 64
+ 0
+
+
+ 255
+ 0
+ 0
+ 0
+
+
+ 255
+ 255
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 0
+
+
+
+ true
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+
+ data["Summary Field/rid"]
+
+ false
+ Text
+
+
+
+
+
+ Orthogonal_Value
+
+ ,
+
+ Outside
+ false
+
+ onmouseover
+
+ Show_Tooltip
+
+
+ 200
+
+
+
+ 0
+
+
+
+
+ 16.0
+ true
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+ Below
+
+
+ 1
+ true
+
+ 10.0
+
+
+ Text
+ Sum
+
+
+
+ true
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+
+ data["rname/rolename"]
+
+
+
+
+ Orthogonal_Value
+
+ ,
+
+ Outside
+ false
+
+
+ false
+ Text
+ Sum
+
+
+
+]]>
+ SVG
+ false
+ 130pt
+ 212pt
+
+
+ cid/cid
+ dimension["cid"]["cid"]
+ integer
+
+
+ uname/uname
+ dimension["uname"]["uname"]
+ string
+
+
+ rname/rolename
+ dimension["rname"]["rolename"]
+ string
+
+
+ Summary Field/rid
+ measure["rid"]
+ integer
+ SUM
+
+
+
+ |
+
+
+ Data Cube
+
+ 2.6.1
+ Bar Chart
+ Side-by-side
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+
+
+ 角色分布情况
+
+ 16.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+ 5
+ 5
+
+
+
+ 0
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+
+
+
+ 0
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 2.0
+ 2.0
+ 2.0
+ 2.0
+
+
+
+
+
+
+
+
+ Vertical
+ Top_Bottom
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+ Right
+ Categories
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Above
+
+
+ 0.0
+ 0.0
+ 212.0
+ 130.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+
+ Two_Dimensional
+ Points
+ 10.0
+
+ enable.area.alt
+ false
+
+
+
+ A, B, C
+
+
+ 5,4,12
+ 0
+
+
+
+
+
+ This chart contains no data.
+
+
+ Center
+ Center
+
+
+
+
+ 64
+ 127
+ 127
+ 127
+
+
+
+ 128
+ 127
+ 127
+ 127
+
+ true
+
+
+ 10.0
+ 10.0
+ 10.0
+ 10.0
+
+ false
+
+
+ Text
+
+
+ X-Axis Title
+
+ 14.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Below
+
+ Linear
+
+
+ Y-Axis Title
+
+ 14.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Left
+
+
+
+
+
+
+ 255
+ 80
+ 166
+ 218
+
+
+ 255
+ 242
+ 88
+ 106
+
+
+ 255
+ 232
+ 172
+ 57
+
+
+ 255
+ 128
+ 255
+ 128
+
+
+ 255
+ 64
+ 128
+ 128
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 170
+ 85
+ 85
+
+
+ 255
+ 128
+ 128
+ 0
+
+
+ 255
+ 192
+ 192
+ 192
+
+
+ 255
+ 255
+ 255
+ 128
+
+
+ 255
+ 128
+ 192
+ 128
+
+
+ 255
+ 7
+ 146
+ 94
+
+
+ 255
+ 0
+ 128
+ 255
+
+
+ 255
+ 255
+ 128
+ 192
+
+
+ 255
+ 0
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 128
+
+
+ 255
+ 0
+ 128
+ 192
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 255
+ 0
+ 255
+
+
+ 255
+ 128
+ 64
+ 64
+
+
+ 255
+ 255
+ 128
+ 64
+
+
+ 255
+ 80
+ 240
+ 120
+
+
+ 255
+ 0
+ 64
+ 128
+
+
+ 255
+ 128
+ 0
+ 64
+
+
+ 255
+ 255
+ 0
+ 128
+
+
+ 255
+ 128
+ 128
+ 64
+
+
+ 255
+ 128
+ 128
+ 128
+
+
+ 255
+ 255
+ 128
+ 255
+
+
+ 255
+ 0
+ 64
+ 0
+
+
+ 255
+ 0
+ 0
+ 0
+
+
+ 255
+ 255
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 0
+
+
+
+ true
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+
+ data["Summary Field/rid"]
+
+ false
+ Text
+
+
+
+ Series 1
+
+
+ Orthogonal_Value
+
+ ,
+
+ Outside
+ false
+
+ onmouseover
+
+ Show_Tooltip
+
+
+ 200
+
+
+
+ Rectangle
+
+
+ Text
+ Sum
+
+
+ Vertical
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+ Left
+
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ true
+
+
+
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+
+
+ 5
+
+
+ Min
+
+ 0.0
+
+
+ true
+ false
+
+
+
+
+
+
+
+ 255
+ 80
+ 166
+ 218
+
+
+ 255
+ 242
+ 88
+ 106
+
+
+ 255
+ 232
+ 172
+ 57
+
+
+ 255
+ 128
+ 255
+ 128
+
+
+ 255
+ 64
+ 128
+ 128
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 170
+ 85
+ 85
+
+
+ 255
+ 128
+ 128
+ 0
+
+
+ 255
+ 192
+ 192
+ 192
+
+
+ 255
+ 255
+ 255
+ 128
+
+
+ 255
+ 128
+ 192
+ 128
+
+
+ 255
+ 7
+ 146
+ 94
+
+
+ 255
+ 0
+ 128
+ 255
+
+
+ 255
+ 255
+ 128
+ 192
+
+
+ 255
+ 0
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 128
+
+
+ 255
+ 0
+ 128
+ 192
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 255
+ 0
+ 255
+
+
+ 255
+ 128
+ 64
+ 64
+
+
+ 255
+ 255
+ 128
+ 64
+
+
+ 255
+ 80
+ 240
+ 120
+
+
+ 255
+ 0
+ 64
+ 128
+
+
+ 255
+ 128
+ 0
+ 64
+
+
+ 255
+ 255
+ 0
+ 128
+
+
+ 255
+ 128
+ 128
+ 64
+
+
+ 255
+ 128
+ 128
+ 128
+
+
+ 255
+ 255
+ 128
+ 255
+
+
+ 255
+ 0
+ 64
+ 0
+
+
+ 255
+ 0
+ 0
+ 0
+
+
+ 255
+ 255
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 0
+
+
+
+ true
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+
+ data["rname/rolename"]
+
+
+
+
+ Orthogonal_Value
+
+ ,
+
+ Outside
+ false
+
+
+ false
+ Text
+ Sum
+
+
+ Horizontal
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+ Below
+
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ true
+
+
+
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+
+
+ 5
+
+
+ Min
+
+ 0.0
+
+
+ true
+ true
+ false
+
+ Vertical
+ 50.0
+
+
+ -20.0
+ 45.0
+ 0.0
+ None
+
+
+
+]]>
+ JPG
+ false
+ 130pt
+ 212pt
+
+
+ cid/cid
+ dimension["cid"]["cid"]
+ integer
+
+
+ uname/uname
+ dimension["uname"]["uname"]
+ string
+
+
+ rname/rolename
+ dimension["rname"]["rolename"]
+ string
+
+
+ Summary Field/rid
+ measure["rid"]
+ integer
+ SUM
+
+
+
+ |
+
+
+
+
+
diff --git a/crm/WebContent/META-INF/MANIFEST.MF b/crm/WebContent/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..254272e
--- /dev/null
+++ b/crm/WebContent/META-INF/MANIFEST.MF
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
diff --git a/crm/WebContent/WEB-INF/web.xml b/crm/WebContent/WEB-INF/web.xml
new file mode 100644
index 0000000..1aa8cdb
--- /dev/null
+++ b/crm/WebContent/WEB-INF/web.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/crm/nb-configuration.xml b/crm/nb-configuration.xml
new file mode 100644
index 0000000..6f59166
--- /dev/null
+++ b/crm/nb-configuration.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+ JDK_1.7
+
+ /less:/css
+ false
+ /scss:/css
+ false
+
+ bootstrap-datepicker/js/locales
+ Tomcat
+
+
diff --git a/crm/pom.xml b/crm/pom.xml
new file mode 100644
index 0000000..972de33
--- /dev/null
+++ b/crm/pom.xml
@@ -0,0 +1,315 @@
+
+
+
+
+ 4.0.0
+ com.rex.crm
+ crm
+ war
+ 1.0
+
+ CRM
+
+
+
+
+ The Apache Software License, Version 2.0
+ http://www.apache.org/licenses/LICENSE-2.0.txt
+ repo
+
+
+
+ 6.7.0
+ 7.6.3.v20120416
+ UTF-8
+
+
+
+ org.eclipse.birt.runtime
+ org.eclipse.birt.runtime
+ 4.3.0
+
+
+ org.apache.poi
+ org.eclipse.birt.runtime
+
+
+
+
+ org.apache.poi
+ poi
+ 3.9
+
+
+
+
+ org.apache.wicket
+ wicket-core
+ ${wicket.version}
+
+
+
+
+
+
+
+ org.slf4j
+ slf4j-log4j12
+ 1.6.4
+
+
+ log4j
+ log4j
+ 1.2.16
+
+
+
+
+ junit
+ junit
+ 4.10
+ test
+
+
+
+
+ org.eclipse.jetty.aggregate
+ jetty-all-server
+ ${jetty.version}
+ provided
+
+
+
+ org.apache.wicket
+ wicket-extensions
+ 6.7.0
+
+
+ org.apache.wicket
+ wicket-auth-roles
+ 6.7.0
+
+
+
+ com.google.code.gson
+ gson
+ 2.2.2
+
+
+
+ commons-configuration
+ commons-configuration
+ 1.9
+
+
+
+ com.google.guava
+ guava
+ 14.0.1
+
+
+
+ org.apache.velocity
+ velocity
+ 1.7
+
+
+ commons-dbutils
+ commons-dbutils
+ 1.5
+
+
+ mysql
+ mysql-connector-java
+ 5.1.26
+
+
+ commons-beanutils
+ commons-beanutils
+ 1.8.3
+
+
+ org.apache.commons
+ commons-lang3
+ 3.1
+
+
+
+ commons-codec
+ commons-codec
+ 1.8
+
+
+
+ args4j
+ args4j
+ 2.0.25
+
+
+ javax.mail
+ mail
+ 1.4
+
+
+ org.eclipse.persistence
+ eclipselink
+ 2.5.1
+
+
+ javax.transaction
+ jta
+ 1.1
+ provided
+
+
+ org.jumpmind.symmetric
+ symmetric-csv
+ 3.5.9
+
+
+
+
+
+ false
+ src/main/resources
+
+
+ false
+ src/main/java
+
+ **
+
+
+ **/*.java
+
+
+
+
+
+ false
+ src/test/resources
+
+
+ false
+ src/test/java
+
+ **
+
+
+ **/*.java
+
+
+
+
+
+ true
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 2.5.1
+
+ 1.7
+ 1.7
+ UTF-8
+ true
+ true
+
+
+
+ org.mortbay.jetty
+ jetty-maven-plugin
+ ${jetty.version}
+
+
+
+ 8080
+ 3600000
+
+
+ 8443
+ 3600000
+ ${project.build.directory}/test-classes/keystore
+ wicket
+ wicket
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-eclipse-plugin
+ 2.9
+
+ true
+
+
+
+
+
+
+
+
+
+ Apache Nexus
+ https://repository.apache.org/content/repositories/snapshots/
+
+ false
+
+
+ true
+
+
+
+ http://download.eclipse.org/rt/eclipselink/maven.repo/
+ eclipselink
+ default
+ Repository for library EclipseLink (JPA 2.1)
+
+
+
diff --git a/crm/src/main/db/crmDB.sql b/crm/src/main/db/crmDB.sql
new file mode 100644
index 0000000..f6c6943
--- /dev/null
+++ b/crm/src/main/db/crmDB.sql
@@ -0,0 +1,2 @@
+DROP DATABASE IF EXISTS crmdb;
+CREATE DATABASE crmdb CHARSET utf8 COLLATE utf8_general_ci;
\ No newline at end of file
diff --git a/crm/src/main/db/dump.sql b/crm/src/main/db/dump.sql
new file mode 100644
index 0000000..a2ded82
--- /dev/null
+++ b/crm/src/main/db/dump.sql
@@ -0,0 +1,2269 @@
+-- MySQL dump 10.13 Distrib 5.5.30, for osx10.6 (i386)
+--
+-- Host: localhost Database: crmdb
+-- ------------------------------------------------------
+-- Server version 5.5.30
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+
+--
+-- Table structure for table `account`
+--
+
+DROP TABLE IF EXISTS `account`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `account` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `name` varchar(255) NOT NULL,
+ `bdm_code` varchar(255) DEFAULT NULL,
+ `administrativ_level` mediumint(9) DEFAULT NULL,
+ `hospital_type` mediumint(9) DEFAULT NULL,
+ `local_or_army` mediumint(9) DEFAULT NULL,
+ `comprehensive_or_specialized` mediumint(9) DEFAULT NULL,
+ `key_type` mediumint(9) DEFAULT NULL,
+ `status` mediumint(9) DEFAULT NULL,
+ `duty_officer` varchar(255) DEFAULT NULL,
+ `num_of_doctors` mediumint(9) DEFAULT NULL,
+ `num_of_assistant_doctors` mediumint(9) DEFAULT NULL,
+ `num_of_staff` mediumint(9) DEFAULT NULL,
+ `num_of_treat_per_year` mediumint(9) DEFAULT NULL,
+ `num_of_outpatient` mediumint(9) DEFAULT NULL,
+ `total_num_of_sickbed` mediumint(9) DEFAULT NULL,
+ `num_of_anesthesia_doctor` mediumint(9) DEFAULT NULL,
+ `num_of_pain_doctor` mediumint(9) DEFAULT NULL,
+ `num_of_surgery_per_year` mediumint(9) DEFAULT NULL,
+ `num_of_surgery_room` mediumint(9) DEFAULT NULL,
+ `num_of_using_opiates_medicine` mediumint(9) DEFAULT NULL,
+ `num_of_using_opiates_injection` mediumint(9) DEFAULT NULL,
+ `date_of_establish` varchar(128) DEFAULT NULL,
+ `registered_capital` mediumint(9) DEFAULT NULL,
+ `tel` varchar(255) DEFAULT NULL,
+ `fax` varchar(255) DEFAULT NULL,
+ `market_classification` mediumint(9) DEFAULT NULL,
+ `province` int(11) DEFAULT NULL,
+ `city` int(11) DEFAULT NULL,
+ `districts` varchar(255) DEFAULT NULL,
+ `address` varchar(255) DEFAULT NULL,
+ `owner` varchar(255) DEFAULT NULL,
+ `whenadded` datetime DEFAULT NULL,
+ `modifier` varchar(255) DEFAULT NULL,
+ `modify_datetime` datetime DEFAULT NULL,
+ `responsible_person` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE,
+ UNIQUE KEY `account_ix_01` (`bdm_code`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `account`
+--
+
+LOCK TABLES `account` WRITE;
+/*!40000 ALTER TABLE `account` DISABLE KEYS */;
+/*!40000 ALTER TABLE `account` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `account_administrativ_level_pl`
+--
+
+DROP TABLE IF EXISTS `account_administrativ_level_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `account_administrativ_level_pl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `account_administrativ_level_pl`
+--
+
+LOCK TABLES `account_administrativ_level_pl` WRITE;
+/*!40000 ALTER TABLE `account_administrativ_level_pl` DISABLE KEYS */;
+INSERT INTO `account_administrativ_level_pl` VALUES (1,'一级'),(5,'二级'),(9,'三级'),(13,'未评级');
+/*!40000 ALTER TABLE `account_administrativ_level_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `account_comprehensive_or_specialized_pl`
+--
+
+DROP TABLE IF EXISTS `account_comprehensive_or_specialized_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `account_comprehensive_or_specialized_pl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `account_comprehensive_or_specialized_pl`
+--
+
+LOCK TABLES `account_comprehensive_or_specialized_pl` WRITE;
+/*!40000 ALTER TABLE `account_comprehensive_or_specialized_pl` DISABLE KEYS */;
+INSERT INTO `account_comprehensive_or_specialized_pl` VALUES (1,'综合医院'),(2,'专科医院');
+/*!40000 ALTER TABLE `account_comprehensive_or_specialized_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `account_local_or_army_pl`
+--
+
+DROP TABLE IF EXISTS `account_local_or_army_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `account_local_or_army_pl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `account_local_or_army_pl`
+--
+
+LOCK TABLES `account_local_or_army_pl` WRITE;
+/*!40000 ALTER TABLE `account_local_or_army_pl` DISABLE KEYS */;
+INSERT INTO `account_local_or_army_pl` VALUES (1,'地方医院'),(2,'部队医院');
+/*!40000 ALTER TABLE `account_local_or_army_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `account_market_classification_pl`
+--
+
+DROP TABLE IF EXISTS `account_market_classification_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `account_market_classification_pl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `account_market_classification_pl`
+--
+
+LOCK TABLES `account_market_classification_pl` WRITE;
+/*!40000 ALTER TABLE `account_market_classification_pl` DISABLE KEYS */;
+INSERT INTO `account_market_classification_pl` VALUES (1,'战略城市'),(2,'一级城市'),(3,'二级城市'),(4,'三级城市'),(5,'四级城市');
+/*!40000 ALTER TABLE `account_market_classification_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `account_medicaltype_pl`
+--
+
+DROP TABLE IF EXISTS `account_medicaltype_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `account_medicaltype_pl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `account_medicaltype_pl`
+--
+
+LOCK TABLES `account_medicaltype_pl` WRITE;
+/*!40000 ALTER TABLE `account_medicaltype_pl` DISABLE KEYS */;
+INSERT INTO `account_medicaltype_pl` VALUES (1,'麻药目标医院'),(2,'慢痛目标医院'),(3,'其他');
+/*!40000 ALTER TABLE `account_medicaltype_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `account_point_pl`
+--
+
+DROP TABLE IF EXISTS `account_point_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `account_point_pl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `account_point_pl`
+--
+
+LOCK TABLES `account_point_pl` WRITE;
+/*!40000 ALTER TABLE `account_point_pl` DISABLE KEYS */;
+INSERT INTO `account_point_pl` VALUES (1,'癌痛重点医院'),(2,'慢痛重点医院'),(3,'奥诺美重点医院'),(4,'非重点医院');
+/*!40000 ALTER TABLE `account_point_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `account_status_pl`
+--
+
+DROP TABLE IF EXISTS `account_status_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `account_status_pl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `account_status_pl`
+--
+
+LOCK TABLES `account_status_pl` WRITE;
+/*!40000 ALTER TABLE `account_status_pl` DISABLE KEYS */;
+INSERT INTO `account_status_pl` VALUES (1,'有效'),(2,'无效');
+/*!40000 ALTER TABLE `account_status_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `account_type_pl`
+--
+
+DROP TABLE IF EXISTS `account_type_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `account_type_pl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `account_type_pl`
+--
+
+LOCK TABLES `account_type_pl` WRITE;
+/*!40000 ALTER TABLE `account_type_pl` DISABLE KEYS */;
+INSERT INTO `account_type_pl` VALUES (1,'癌痛目标医院'),(2,'慢痛目标医院'),(3,'奥诺美目标医院'),(4,'非目标医院');
+/*!40000 ALTER TABLE `account_type_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `accountcrmuser`
+--
+
+DROP TABLE IF EXISTS `accountcrmuser`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `accountcrmuser` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `accountId` mediumint(9) NOT NULL,
+ `crmuserId` mediumint(9) NOT NULL,
+ `externalId` varchar(45) DEFAULT NULL,
+ `whenadded` datetime DEFAULT NULL,
+ `modifier` varchar(255) DEFAULT NULL,
+ `modify_datetime` datetime DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE,
+ UNIQUE KEY `accountId` (`accountId`,`crmuserId`),
+ KEY `account_crmuser_cons2` (`crmuserId`),
+ CONSTRAINT `account_crmuser_cons` FOREIGN KEY (`accountId`) REFERENCES `account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `account_crmuser_cons2` FOREIGN KEY (`crmuserId`) REFERENCES `crmuser` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `accountcrmuser`
+--
+
+LOCK TABLES `accountcrmuser` WRITE;
+/*!40000 ALTER TABLE `accountcrmuser` DISABLE KEYS */;
+/*!40000 ALTER TABLE `accountcrmuser` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `activity`
+--
+
+DROP TABLE IF EXISTS `activity`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `activity` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `name` varchar(255) DEFAULT NULL,
+ `crmuserId` mediumint(9) NOT NULL,
+ `event_type` mediumint(9) NOT NULL,
+ `endtime` bigint(20) DEFAULT NULL,
+ `starttime` bigint(20) NOT NULL DEFAULT '0',
+ `title` varchar(128) DEFAULT NULL,
+ `participants` varchar(512) DEFAULT NULL,
+ `activity_type` mediumint(9) DEFAULT NULL,
+ `contactId` mediumint(9) DEFAULT NULL,
+ `coacheeId` int(32) DEFAULT NULL,
+ `status` mediumint(9) DEFAULT NULL,
+ `visiting_purpose` mediumint(9) DEFAULT NULL,
+ `feature_product` mediumint(9) DEFAULT NULL,
+ `act_endtime` datetime DEFAULT NULL,
+ `owner` varchar(255) DEFAULT NULL,
+ `whenadded` datetime DEFAULT NULL,
+ `modifier` varchar(255) DEFAULT NULL,
+ `modify_datetime` datetime DEFAULT NULL,
+ `responsible_person` varchar(255) DEFAULT NULL,
+ `coach` int(32) DEFAULT NULL,
+ `location` varchar(255) DEFAULT NULL,
+ `total_score` mediumint(9) DEFAULT NULL,
+ `planing` mediumint(9) DEFAULT NULL,
+ `openling` mediumint(9) DEFAULT NULL,
+ `enquery_listening` mediumint(9) DEFAULT NULL,
+ `deliverable` mediumint(9) DEFAULT NULL,
+ `objection_handing` mediumint(9) DEFAULT NULL,
+ `summary` mediumint(9) DEFAULT NULL,
+ `whetherCoach` mediumint(9) DEFAULT NULL,
+ `coachTime` mediumint(9) DEFAULT NULL,
+ `accountId` mediumint(9) DEFAULT NULL,
+ `department` mediumint(9) DEFAULT NULL,
+ `whether_coach` varchar(255) DEFAULT NULL,
+ `activity_daypart` mediumint(9) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE,
+ KEY `crmuserId_activity_cons` (`crmuserId`),
+ KEY `contactId_activity_cons` (`contactId`),
+ CONSTRAINT `contactId_activity_cons` FOREIGN KEY (`contactId`) REFERENCES `contact` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `crmuserId_activity_cons` FOREIGN KEY (`crmuserId`) REFERENCES `crmuser` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `activity`
+--
+
+LOCK TABLES `activity` WRITE;
+/*!40000 ALTER TABLE `activity` DISABLE KEYS */;
+/*!40000 ALTER TABLE `activity` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `activity_activity_types_pl`
+--
+
+DROP TABLE IF EXISTS `activity_activity_types_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `activity_activity_types_pl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `activity_activity_types_pl`
+--
+
+LOCK TABLES `activity_activity_types_pl` WRITE;
+/*!40000 ALTER TABLE `activity_activity_types_pl` DISABLE KEYS */;
+INSERT INTO `activity_activity_types_pl` VALUES (1,'专业化拜访'),(2,'事务性拜访');
+/*!40000 ALTER TABLE `activity_activity_types_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Temporary table structure for view `activity_alert`
+--
+
+DROP TABLE IF EXISTS `activity_alert`;
+/*!50001 DROP VIEW IF EXISTS `activity_alert`*/;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+/*!50001 CREATE TABLE `activity_alert` (
+ `id` tinyint NOT NULL,
+ `time` tinyint NOT NULL,
+ `title` tinyint NOT NULL,
+ `name` tinyint NOT NULL,
+ `times` tinyint NOT NULL
+) ENGINE=MyISAM */;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `activity_coachtime_pl`
+--
+
+DROP TABLE IF EXISTS `activity_coachtime_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `activity_coachtime_pl` (
+ `id` int(11) NOT NULL,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `activity_coachtime_pl`
+--
+
+LOCK TABLES `activity_coachtime_pl` WRITE;
+/*!40000 ALTER TABLE `activity_coachtime_pl` DISABLE KEYS */;
+INSERT INTO `activity_coachtime_pl` VALUES (1,'无'),(2,'半天'),(3,'全天');
+/*!40000 ALTER TABLE `activity_coachtime_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `activity_daypart_pl`
+--
+
+DROP TABLE IF EXISTS `activity_daypart_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `activity_daypart_pl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `activity_daypart_pl`
+--
+
+LOCK TABLES `activity_daypart_pl` WRITE;
+/*!40000 ALTER TABLE `activity_daypart_pl` DISABLE KEYS */;
+INSERT INTO `activity_daypart_pl` VALUES (1,'上午'),(2,'下午');
+/*!40000 ALTER TABLE `activity_daypart_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `activity_event_type_pl`
+--
+
+DROP TABLE IF EXISTS `activity_event_type_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `activity_event_type_pl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `activity_event_type_pl`
+--
+
+LOCK TABLES `activity_event_type_pl` WRITE;
+/*!40000 ALTER TABLE `activity_event_type_pl` DISABLE KEYS */;
+INSERT INTO `activity_event_type_pl` VALUES (1,'拜访'),(2,'拜访辅导'),(3,'科室会辅导');
+/*!40000 ALTER TABLE `activity_event_type_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `activity_feature_product_pl`
+--
+
+DROP TABLE IF EXISTS `activity_feature_product_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `activity_feature_product_pl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `activity_feature_product_pl`
+--
+
+LOCK TABLES `activity_feature_product_pl` WRITE;
+/*!40000 ALTER TABLE `activity_feature_product_pl` DISABLE KEYS */;
+INSERT INTO `activity_feature_product_pl` VALUES (1,'美施康定'),(2,'奥施康定'),(3,'奇曼丁'),(4,'若思本'),(5,'奥诺美');
+/*!40000 ALTER TABLE `activity_feature_product_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `activity_score3_pl`
+--
+
+DROP TABLE IF EXISTS `activity_score3_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `activity_score3_pl` (
+ `id` int(11) NOT NULL,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `activity_score3_pl`
+--
+
+LOCK TABLES `activity_score3_pl` WRITE;
+/*!40000 ALTER TABLE `activity_score3_pl` DISABLE KEYS */;
+INSERT INTO `activity_score3_pl` VALUES (0,'0'),(1,'1'),(2,'2'),(3,'3'),(4,'4'),(5,'5'),(6,'6'),(7,'7'),(8,'8'),(9,'9'),(10,'10');
+/*!40000 ALTER TABLE `activity_score3_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `activity_score4_pl`
+--
+
+DROP TABLE IF EXISTS `activity_score4_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `activity_score4_pl` (
+ `id` int(11) NOT NULL,
+ `val` varchar(25) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `activity_score4_pl`
+--
+
+LOCK TABLES `activity_score4_pl` WRITE;
+/*!40000 ALTER TABLE `activity_score4_pl` DISABLE KEYS */;
+INSERT INTO `activity_score4_pl` VALUES (0,'0'),(1,'1'),(2,'2'),(3,'3'),(4,'4'),(5,'5'),(6,'6'),(7,'7'),(8,'8'),(9,'9'),(10,'10'),(11,'11'),(12,'12'),(13,'13'),(14,'14'),(15,'15'),(16,'16'),(17,'17'),(18,'18'),(19,'19'),(20,'20'),(21,'21'),(22,'22'),(23,'23'),(24,'24'),(25,'25');
+/*!40000 ALTER TABLE `activity_score4_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `activity_score5_pl`
+--
+
+DROP TABLE IF EXISTS `activity_score5_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `activity_score5_pl` (
+ `id` int(11) NOT NULL,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `activity_score5_pl`
+--
+
+LOCK TABLES `activity_score5_pl` WRITE;
+/*!40000 ALTER TABLE `activity_score5_pl` DISABLE KEYS */;
+INSERT INTO `activity_score5_pl` VALUES (0,'0'),(1,'1'),(2,'2'),(3,'3'),(4,'4'),(5,'5'),(6,'6'),(7,'7'),(8,'8'),(9,'9'),(10,'10'),(11,'11'),(12,'12'),(13,'13'),(14,'14'),(15,'15'),(16,'16'),(17,'17'),(18,'18'),(19,'19'),(20,'20'),(21,'21'),(22,'22'),(23,'23'),(24,'24'),(25,'25'),(26,'26'),(27,'27'),(28,'28'),(29,'29'),(30,'30'),(31,'31'),(32,'32'),(33,'33'),(34,'34'),(35,'35'),(36,'36'),(37,'37'),(38,'38'),(39,'39'),(40,'40'),(41,'41'),(42,'42'),(43,'43'),(44,'44'),(45,'45'),(46,'46'),(47,'47'),(48,'48'),(49,'49'),(50,'50');
+/*!40000 ALTER TABLE `activity_score5_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `activity_status`
+--
+
+DROP TABLE IF EXISTS `activity_status`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `activity_status` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `activity_status`
+--
+
+LOCK TABLES `activity_status` WRITE;
+/*!40000 ALTER TABLE `activity_status` DISABLE KEYS */;
+INSERT INTO `activity_status` VALUES (1,'计划'),(2,'完成');
+/*!40000 ALTER TABLE `activity_status` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `activity_status_pl`
+--
+
+DROP TABLE IF EXISTS `activity_status_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `activity_status_pl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `activity_status_pl`
+--
+
+LOCK TABLES `activity_status_pl` WRITE;
+/*!40000 ALTER TABLE `activity_status_pl` DISABLE KEYS */;
+INSERT INTO `activity_status_pl` VALUES (1,'计划'),(2,'完成'),(3,'未执行');
+/*!40000 ALTER TABLE `activity_status_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `activity_types`
+--
+
+DROP TABLE IF EXISTS `activity_types`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `activity_types` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `activity_types`
+--
+
+LOCK TABLES `activity_types` WRITE;
+/*!40000 ALTER TABLE `activity_types` DISABLE KEYS */;
+INSERT INTO `activity_types` VALUES (1,'拜访'),(2,'外部会议'),(3,'内部会议');
+/*!40000 ALTER TABLE `activity_types` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `activity_visiting_purpose_pl`
+--
+
+DROP TABLE IF EXISTS `activity_visiting_purpose_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `activity_visiting_purpose_pl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ `activity_type` mediumint(9) DEFAULT NULL,
+ `parentId` mediumint(9) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `activity_visiting_purpose_pl`
+--
+
+LOCK TABLES `activity_visiting_purpose_pl` WRITE;
+/*!40000 ALTER TABLE `activity_visiting_purpose_pl` DISABLE KEYS */;
+INSERT INTO `activity_visiting_purpose_pl` VALUES (1,'传递产品知识',1,1),(2,'处方观念沟通',1,1),(3,'病例沟通',1,1),(4,'会议安排',2,2),(5,'会议跟进',2,2),(6,'交接工作',2,2),(7,'了解竞争',2,2);
+/*!40000 ALTER TABLE `activity_visiting_purpose_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `activity_whethercoach_pl`
+--
+
+DROP TABLE IF EXISTS `activity_whethercoach_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `activity_whethercoach_pl` (
+ `id` mediumint(9) NOT NULL,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `activity_whethercoach_pl`
+--
+
+LOCK TABLES `activity_whethercoach_pl` WRITE;
+/*!40000 ALTER TABLE `activity_whethercoach_pl` DISABLE KEYS */;
+INSERT INTO `activity_whethercoach_pl` VALUES (1,'协访半天'),(2,'协访一天');
+/*!40000 ALTER TABLE `activity_whethercoach_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `activitycrmuser`
+--
+
+DROP TABLE IF EXISTS `activitycrmuser`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `activitycrmuser` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `activityId` mediumint(9) NOT NULL,
+ `crmuserId` mediumint(9) NOT NULL,
+ PRIMARY KEY (`id`) USING BTREE,
+ UNIQUE KEY `activityId` (`activityId`,`crmuserId`),
+ KEY `crm_activity_cons` (`crmuserId`),
+ CONSTRAINT `crm_activity_cons` FOREIGN KEY (`crmuserId`) REFERENCES `crmuser` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `crm_activity_cons2` FOREIGN KEY (`activityId`) REFERENCES `activity` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `activitycrmuser`
+--
+
+LOCK TABLES `activitycrmuser` WRITE;
+/*!40000 ALTER TABLE `activitycrmuser` DISABLE KEYS */;
+/*!40000 ALTER TABLE `activitycrmuser` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `alert`
+--
+
+DROP TABLE IF EXISTS `alert`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `alert` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `name` varchar(255) NOT NULL,
+ `publishDate` bigint(20) DEFAULT NULL,
+ `expired` bigint(20) DEFAULT NULL,
+ `priority` mediumint(9) DEFAULT NULL,
+ `towhom` mediumint(9) DEFAULT NULL,
+ `description` longtext,
+ `owner` varchar(255) DEFAULT NULL,
+ `whenadded` datetime DEFAULT NULL,
+ `modifier` varchar(255) DEFAULT NULL,
+ `modify_datetime` datetime DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `alert`
+--
+
+LOCK TABLES `alert` WRITE;
+/*!40000 ALTER TABLE `alert` DISABLE KEYS */;
+/*!40000 ALTER TABLE `alert` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `alert_priority_pl`
+--
+
+DROP TABLE IF EXISTS `alert_priority_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `alert_priority_pl` (
+ `id` mediumint(9) NOT NULL,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `alert_priority_pl`
+--
+
+LOCK TABLES `alert_priority_pl` WRITE;
+/*!40000 ALTER TABLE `alert_priority_pl` DISABLE KEYS */;
+INSERT INTO `alert_priority_pl` VALUES (1,'高级'),(2,'中级'),(3,'低级');
+/*!40000 ALTER TABLE `alert_priority_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `alert_publicobject_pl`
+--
+
+DROP TABLE IF EXISTS `alert_publicobject_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `alert_publicobject_pl` (
+ `id` mediumint(9) NOT NULL,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `alert_publicobject_pl`
+--
+
+LOCK TABLES `alert_publicobject_pl` WRITE;
+/*!40000 ALTER TABLE `alert_publicobject_pl` DISABLE KEYS */;
+INSERT INTO `alert_publicobject_pl` VALUES (1,'管理员'),(2,'主管'),(3,'代表');
+/*!40000 ALTER TABLE `alert_publicobject_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `appinfo`
+--
+
+DROP TABLE IF EXISTS `appinfo`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `appinfo` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `appinfo`
+--
+
+LOCK TABLES `appinfo` WRITE;
+/*!40000 ALTER TABLE `appinfo` DISABLE KEYS */;
+INSERT INTO `appinfo` VALUES (1,'爱奇艺'),(2,'影视圈'),(3,'多米音乐'),(4,'百度地图'),(5,'新浪微博'),(6,'三星学习'),(7,'印象笔记'),(8,'愤怒的小鸟'),(9,'疯狂飙车'),(10,'股票专家'),(11,'名片全能王'),(12,'携程旅游');
+/*!40000 ALTER TABLE `appinfo` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `boolean_pl`
+--
+
+DROP TABLE IF EXISTS `boolean_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `boolean_pl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `boolean_pl`
+--
+
+LOCK TABLES `boolean_pl` WRITE;
+/*!40000 ALTER TABLE `boolean_pl` DISABLE KEYS */;
+INSERT INTO `boolean_pl` VALUES (1,'是'),(2,'否');
+/*!40000 ALTER TABLE `boolean_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `city`
+--
+
+DROP TABLE IF EXISTS `city`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `city` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `val` varchar(20) DEFAULT NULL,
+ `externalId` varchar(20) DEFAULT NULL,
+ `parentId` int(11) NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY `city_parentid_cons` (`parentId`),
+ CONSTRAINT `city_parentid_cons` FOREIGN KEY (`parentId`) REFERENCES `province` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB AUTO_INCREMENT=344 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `city`
+--
+
+LOCK TABLES `city` WRITE;
+/*!40000 ALTER TABLE `city` DISABLE KEYS */;
+INSERT INTO `city` VALUES (1,'北京','110100',1),(2,'石家庄','130100',3),(3,'唐山','130200',3),(4,'秦皇岛','130300',3),(5,'邯郸','130400',3),(6,'邢台','130500',3),(7,'保定','130600',3),(8,'张家口','130700',3),(9,'承德','130800',3),(10,'沧州','130900',3),(11,'廊坊','131000',3),(12,'衡水','131100',3),(13,'太原','140100',4),(14,'大同','140200',4),(15,'阳泉','140300',4),(16,'长治','140400',4),(17,'晋城','140500',4),(18,'朔州','140600',4),(19,'晋中','140700',4),(20,'运城','140800',4),(21,'忻州','140900',4),(22,'临汾','141000',4),(23,'吕梁','141100',4),(24,'呼和浩特','150100',5),(25,'包头','150200',5),(26,'乌海','150300',5),(27,'赤峰','150400',5),(28,'通辽','150500',5),(29,'鄂尔多斯','150600',5),(30,'呼伦贝尔','150700',5),(31,'巴彦淖尔','150800',5),(32,'乌兰察布','150900',5),(33,'兴安盟','152200',5),(34,'锡林郭勒盟','152500',5),(35,'阿拉善盟','152900',5),(36,'沈阳','210100',6),(37,'大连','210200',6),(38,'鞍山','210300',6),(39,'抚顺','210400',6),(40,'本溪','210500',6),(41,'丹东','210600',6),(42,'锦州','210700',6),(43,'营口','210800',6),(44,'阜新','210900',6),(45,'辽阳','211000',6),(46,'盘锦','211100',6),(47,'铁岭','211200',6),(48,'朝阳','211300',6),(49,'葫芦岛','211400',6),(50,'长春','220100',7),(51,'吉林','220200',7),(52,'四平','220300',7),(53,'辽源','220400',7),(54,'通化','220500',7),(55,'白山','220600',7),(56,'松原','220700',7),(57,'白城','220800',7),(58,'延边朝鲜族自治州','222400',7),(59,'哈尔滨','230100',8),(60,'齐齐哈尔','230200',8),(61,'鸡西','230300',8),(62,'鹤岗','230400',8),(63,'双鸭山','230500',8),(64,'大庆','230600',8),(65,'伊春','230700',8),(66,'佳木斯','230800',8),(67,'七台河','230900',8),(68,'牡丹江','231000',8),(69,'黑河','231100',8),(70,'绥化','231200',8),(71,'大兴安岭地区','232700',8),(72,'上海','310100',9),(73,'县','310200',9),(74,'南京','320100',10),(75,'无锡','320200',10),(76,'徐州','320300',10),(77,'常州','320400',10),(78,'苏州','320500',10),(79,'南通','320600',10),(80,'连云港','320700',10),(81,'淮安','320800',10),(82,'盐城','320900',10),(83,'扬州','321000',10),(84,'镇江','321100',10),(85,'泰州','321200',10),(86,'宿迁','321300',10),(87,'杭州','330100',11),(88,'宁波','330200',11),(89,'温州','330300',11),(90,'嘉兴','330400',11),(91,'湖州','330500',11),(92,'绍兴','330600',11),(93,'金华','330700',11),(94,'衢州','330800',11),(95,'舟山','330900',11),(96,'台州','331000',11),(97,'丽水','331100',11),(98,'合肥','340100',12),(99,'芜湖','340200',12),(100,'蚌埠','340300',12),(101,'淮南','340400',12),(102,'马鞍山','340500',12),(103,'淮北','340600',12),(104,'铜陵','340700',12),(105,'安庆','340800',12),(106,'黄山','341000',12),(107,'滁州','341100',12),(108,'阜阳','341200',12),(109,'宿州','341300',12),(110,'巢湖','341400',12),(111,'六安','341500',12),(112,'亳州','341600',12),(113,'池州','341700',12),(114,'宣城','341800',12),(115,'福州','350100',13),(116,'厦门','350200',13),(117,'莆田','350300',13),(118,'三明','350400',13),(119,'泉州','350500',13),(120,'漳州','350600',13),(121,'南平','350700',13),(122,'龙岩','350800',13),(123,'宁德','350900',13),(124,'南昌','360100',14),(125,'景德镇','360200',14),(126,'萍乡','360300',14),(127,'九江','360400',14),(128,'新余','360500',14),(129,'鹰潭','360600',14),(130,'赣州','360700',14),(131,'吉安','360800',14),(132,'宜春','360900',14),(133,'抚州','361000',14),(134,'上饶','361100',14),(135,'济南','370100',15),(136,'青岛','370200',15),(137,'淄博','370300',15),(138,'枣庄','370400',15),(139,'东营','370500',15),(140,'烟台','370600',15),(141,'潍坊','370700',15),(142,'济宁','370800',15),(143,'泰安','370900',15),(144,'威海','371000',15),(145,'日照','371100',15),(146,'莱芜','371200',15),(147,'临沂','371300',15),(148,'德州','371400',15),(149,'聊城','371500',15),(150,'滨州','371600',15),(151,'荷泽','371700',15),(152,'郑州','410100',16),(153,'开封','410200',16),(154,'洛阳','410300',16),(155,'平顶山','410400',16),(156,'安阳','410500',16),(157,'鹤壁','410600',16),(158,'新乡','410700',16),(159,'焦作','410800',16),(160,'濮阳','410900',16),(161,'许昌','411000',16),(162,'漯河','411100',16),(163,'三门峡','411200',16),(164,'南阳','411300',16),(165,'商丘','411400',16),(166,'信阳','411500',16),(167,'周口','411600',16),(168,'驻马店','411700',16),(169,'武汉','420100',17),(170,'黄石','420200',17),(171,'十堰','420300',17),(172,'宜昌','420500',17),(173,'襄樊','420600',17),(174,'鄂州','420700',17),(175,'荆门','420800',17),(176,'孝感','420900',17),(177,'荆州','421000',17),(178,'黄冈','421100',17),(179,'咸宁','421200',17),(180,'随州','421300',17),(181,'恩施土家族苗族自治州','422800',17),(182,'省直辖行政单位','429000',17),(183,'长沙','430100',18),(184,'株洲','430200',18),(185,'湘潭','430300',18),(186,'衡阳','430400',18),(187,'邵阳','430500',18),(188,'岳阳','430600',18),(189,'常德','430700',18),(190,'张家界','430800',18),(191,'益阳','430900',18),(192,'郴州','431000',18),(193,'永州','431100',18),(194,'怀化','431200',18),(195,'娄底','431300',18),(196,'湘西土家族苗族自治州','433100',18),(197,'广州','440100',19),(198,'韶关','440200',19),(199,'深圳','440300',19),(200,'珠海','440400',19),(201,'汕头','440500',19),(202,'佛山','440600',19),(203,'江门','440700',19),(204,'湛江','440800',19),(205,'茂名','440900',19),(206,'肇庆','441200',19),(207,'惠州','441300',19),(208,'梅州','441400',19),(209,'汕尾','441500',19),(210,'河源','441600',19),(211,'阳江','441700',19),(212,'清远','441800',19),(213,'东莞','441900',19),(214,'中山','442000',19),(215,'潮州','445100',19),(216,'揭阳','445200',19),(217,'云浮','445300',19),(218,'南宁','450100',20),(219,'柳州','450200',20),(220,'桂林','450300',20),(221,'梧州','450400',20),(222,'北海','450500',20),(223,'防城港','450600',20),(224,'钦州','450700',20),(225,'贵港','450800',20),(226,'玉林','450900',20),(227,'百色','451000',20),(228,'贺州','451100',20),(229,'河池','451200',20),(230,'来宾','451300',20),(231,'崇左','451400',20),(232,'海口','460100',21),(233,'三亚','460200',21),(234,'省直辖县级行政单位','469000',21),(235,'辖区','500100',22),(236,'县','500200',22),(237,'','500300',22),(238,'成都','510100',23),(239,'自贡','510300',23),(240,'攀枝花','510400',23),(241,'泸州','510500',23),(242,'德阳','510600',23),(243,'绵阳','510700',23),(244,'广元','510800',23),(245,'遂宁','510900',23),(246,'内江','511000',23),(247,'乐山','511100',23),(248,'南充','511300',23),(249,'眉山','511400',23),(250,'宜宾','511500',23),(251,'广安','511600',23),(252,'达州','511700',23),(253,'雅安','511800',23),(254,'巴中','511900',23),(255,'资阳','512000',23),(256,'阿坝藏族羌族自治州','513200',23),(257,'甘孜藏族自治州','513300',23),(258,'凉山彝族自治州','513400',23),(259,'贵阳','520100',24),(260,'六盘水','520200',24),(261,'遵义','520300',24),(262,'安顺','520400',24),(263,'铜仁地区','522200',24),(264,'黔西南布依族苗族自治州','522300',24),(265,'毕节地区','522400',24),(266,'黔东南苗族侗族自治州','522600',24),(267,'黔南布依族苗族自治州','522700',24),(268,'昆明','530100',25),(269,'曲靖','530300',25),(270,'玉溪','530400',25),(271,'保山','530500',25),(272,'昭通','530600',25),(273,'丽江','530700',25),(274,'思茅','530800',25),(275,'临沧','530900',25),(276,'楚雄彝族自治州','532300',25),(277,'红河哈尼族彝族自治州','532500',25),(278,'文山壮族苗族自治州','532600',25),(279,'西双版纳傣族自治州','532800',25),(280,'大理白族自治州','532900',25),(281,'德宏傣族景颇族自治州','533100',25),(282,'怒江傈僳族自治州','533300',25),(283,'迪庆藏族自治州','533400',25),(284,'拉萨','540100',26),(285,'昌都地区','542100',26),(286,'山南地区','542200',26),(287,'日喀则地区','542300',26),(288,'那曲地区','542400',26),(289,'阿里地区','542500',26),(290,'林芝地区','542600',26),(291,'西安','610100',27),(292,'铜川','610200',27),(293,'宝鸡','610300',27),(294,'咸阳','610400',27),(295,'渭南','610500',27),(296,'延安','610600',27),(297,'汉中','610700',27),(298,'榆林','610800',27),(299,'安康','610900',27),(300,'商洛','611000',27),(301,'兰州','620100',28),(302,'嘉峪关','620200',28),(303,'金昌','620300',28),(304,'白银','620400',28),(305,'天水','620500',28),(306,'武威','620600',28),(307,'张掖','620700',28),(308,'平凉','620800',28),(309,'酒泉','620900',28),(310,'庆阳','621000',28),(311,'定西','621100',28),(312,'陇南','621200',28),(313,'临夏回族自治州','622900',28),(314,'甘南藏族自治州','623000',28),(315,'西宁','630100',29),(316,'海东地区','632100',29),(317,'海北藏族自治州','632200',29),(318,'黄南藏族自治州','632300',29),(319,'海南藏族自治州','632500',29),(320,'果洛藏族自治州','632600',29),(321,'玉树藏族自治州','632700',29),(322,'海西蒙古族藏族自治州','632800',29),(323,'银川','640100',30),(324,'石嘴山','640200',30),(325,'吴忠','640300',30),(326,'固原','640400',30),(327,'中卫','640500',30),(328,'乌鲁木齐','650100',31),(329,'克拉玛依','650200',31),(330,'吐鲁番地区','652100',31),(331,'哈密地区','652200',31),(332,'昌吉回族自治州','652300',31),(333,'博尔塔拉蒙古自治州','652700',31),(334,'巴音郭楞蒙古自治州','652800',31),(335,'阿克苏地区','652900',31),(336,'克孜勒苏柯尔克孜自治州','653000',31),(337,'喀什地区','653100',31),(338,'和田地区','653200',31),(339,'伊犁哈萨克自治州','654000',31),(340,'塔城地区','654200',31),(341,'阿勒泰地区','654300',31),(342,'省直辖行政单位','659000',31),(343,'天津',NULL,2);
+/*!40000 ALTER TABLE `city` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `com_visiting_purpose_pl`
+--
+
+DROP TABLE IF EXISTS `com_visiting_purpose_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `com_visiting_purpose_pl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `com_visiting_purpose_pl`
+--
+
+LOCK TABLES `com_visiting_purpose_pl` WRITE;
+/*!40000 ALTER TABLE `com_visiting_purpose_pl` DISABLE KEYS */;
+INSERT INTO `com_visiting_purpose_pl` VALUES (1,'处方观念沟通'),(2,'病例沟通');
+/*!40000 ALTER TABLE `com_visiting_purpose_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `contact`
+--
+
+DROP TABLE IF EXISTS `contact`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `contact` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `name` varchar(255) NOT NULL,
+ `accountId` mediumint(9) NOT NULL,
+ `department` mediumint(9) DEFAULT NULL,
+ `sex` mediumint(9) DEFAULT NULL,
+ `native_place` varchar(255) DEFAULT NULL,
+ `office_tel` varchar(255) DEFAULT NULL,
+ `office_fax` varchar(255) DEFAULT NULL,
+ `cellphone` varchar(255) DEFAULT NULL,
+ `email` varchar(255) DEFAULT NULL,
+ `status` varchar(255) DEFAULT NULL,
+ `market_classification` mediumint(9) DEFAULT NULL,
+ `grade` mediumint(9) DEFAULT NULL,
+ `province` int(11) DEFAULT NULL,
+ `city` int(11) DEFAULT NULL,
+ `districts` varchar(255) DEFAULT NULL,
+ `duty` mediumint(9) DEFAULT NULL,
+ `job_title` mediumint(9) DEFAULT NULL,
+ `visiting_target` mediumint(9) DEFAULT NULL,
+ `product_target` varchar(255) DEFAULT NULL,
+ `owner` varchar(255) DEFAULT NULL,
+ `whenadded` datetime DEFAULT NULL,
+ `modifier` varchar(255) DEFAULT NULL,
+ `modify_datetime` datetime DEFAULT NULL,
+ `responsible_person` varchar(255) DEFAULT NULL,
+ `contactCode` varchar(255) DEFAULT NULL,
+ `num_of_monthlySurgery` mediumint(9) DEFAULT NULL,
+ `num_of_monthlyAnalgesia` mediumint(9) DEFAULT NULL,
+ `externalId` varchar(128) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE,
+ UNIQUE KEY `contactCode_UNIQUE` (`contactCode`),
+ UNIQUE KEY `externalId` (`externalId`),
+ KEY `account_id_cons` (`accountId`),
+ CONSTRAINT `account_id_cons` FOREIGN KEY (`accountId`) REFERENCES `account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `contact`
+--
+
+LOCK TABLES `contact` WRITE;
+/*!40000 ALTER TABLE `contact` DISABLE KEYS */;
+/*!40000 ALTER TABLE `contact` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `contact_department_pl`
+--
+
+DROP TABLE IF EXISTS `contact_department_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `contact_department_pl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=74 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `contact_department_pl`
+--
+
+LOCK TABLES `contact_department_pl` WRITE;
+/*!40000 ALTER TABLE `contact_department_pl` DISABLE KEYS */;
+INSERT INTO `contact_department_pl` VALUES (1,'ICU'),(2,'内科'),(3,'外科'),(4,'中医科'),(5,'化疗科'),(6,'关怀科'),(7,'牙科'),(8,'急症科'),(9,'骨科'),(10,'肝胆外科'),(11,'血液科'),(12,'风湿科'),(13,'呼吸科'),(14,'保健科'),(15,'采购科'),(16,'传染科'),(17,'创伤外科'),(18,'儿科'),(19,'耳鼻喉科'),(20,'方便门诊'),(21,'放化疗科'),(22,'放疗科'),(23,'放射科'),(24,'妇产科'),(25,'妇科'),(26,'感染科'),(27,'肛肠科'),(28,'姑息科'),(29,'国际医疗科'),(30,'核医学科'),(31,'呼吸内科'),(32,'护理科'),(33,'急诊科'),(34,'介入科'),(35,'康复科'),(36,'口腔科'),(37,'老干科'),(38,'麻醉科'),(39,'泌尿外科'),(40,'脑外科'),(41,'内分泌科'),(42,'宁养科'),(43,'皮肤科'),(44,'普外科'),(45,'其他'),(46,'乳腺外科'),(47,'烧伤整形科'),(48,'神经科'),(49,'神经内科'),(50,'神经外科'),(51,'肾内科'),(52,'生物治疗科'),(53,'特需科'),(54,'疼痛科'),(55,'微创科'),(56,'胃肠外科'),(57,'消化科'),(58,'消化内科'),(59,'消化外科'),(60,'心内科'),(61,'心胸外科'),(62,'血管外科'),(63,'血透科'),(64,'药剂科'),(65,'医保办'),(66,'医务科'),(67,'整形美容科'),(68,'质控科'),(69,'中西医结合科'),(70,'肿瘤科'),(71,'肿瘤内科'),(72,'肿瘤外科'),(73,'综合科');
+/*!40000 ALTER TABLE `contact_department_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `contact_duty_pl`
+--
+
+DROP TABLE IF EXISTS `contact_duty_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `contact_duty_pl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `contact_duty_pl`
+--
+
+LOCK TABLES `contact_duty_pl` WRITE;
+/*!40000 ALTER TABLE `contact_duty_pl` DISABLE KEYS */;
+INSERT INTO `contact_duty_pl` VALUES (1,'主任'),(2,'主治医师'),(3,'科室主任'),(4,'采购'),(5,'科室主任'),(6,'院长'),(7,'副院长'),(8,'药剂科主任'),(9,'医生'),(10,'副主任'),(11,'院长助理'),(12,'书记'),(13,'副书记'),(14,'护士'),(15,'护士长'),(16,'库管'),(17,'采购科科长'),(18,'药师'),(19,'药剂科副主任'),(20,'医务科科长'),(21,'医务科副科长'),(22,'医保办主任'),(23,'科教科主任'),(24,'信息卡科长'),(25,'其他');
+/*!40000 ALTER TABLE `contact_duty_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `contact_generalization_target_pl`
+--
+
+DROP TABLE IF EXISTS `contact_generalization_target_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `contact_generalization_target_pl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `contact_generalization_target_pl`
+--
+
+LOCK TABLES `contact_generalization_target_pl` WRITE;
+/*!40000 ALTER TABLE `contact_generalization_target_pl` DISABLE KEYS */;
+INSERT INTO `contact_generalization_target_pl` VALUES (1,'美施康定'),(2,'奥施康定'),(3,'奇曼丁'),(4,'若思本'),(5,'奥诺美');
+/*!40000 ALTER TABLE `contact_generalization_target_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `contact_grade_pl`
+--
+
+DROP TABLE IF EXISTS `contact_grade_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `contact_grade_pl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `contact_grade_pl`
+--
+
+LOCK TABLES `contact_grade_pl` WRITE;
+/*!40000 ALTER TABLE `contact_grade_pl` DISABLE KEYS */;
+INSERT INTO `contact_grade_pl` VALUES (1,'A'),(2,'B'),(3,'C'),(4,'D'),(5,'V'),(6,'非目标医生');
+/*!40000 ALTER TABLE `contact_grade_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `contact_job_title_pl`
+--
+
+DROP TABLE IF EXISTS `contact_job_title_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `contact_job_title_pl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `contact_job_title_pl`
+--
+
+LOCK TABLES `contact_job_title_pl` WRITE;
+/*!40000 ALTER TABLE `contact_job_title_pl` DISABLE KEYS */;
+INSERT INTO `contact_job_title_pl` VALUES (1,'住院医师'),(2,'主治医师'),(3,'副主任医师'),(4,'主任医师'),(5,'护士'),(6,'主管护士'),(7,'药师'),(8,'技师'),(9,'副主任护士'),(10,'主任护师'),(11,'主管药师'),(12,'副主任药师'),(13,'主任药师'),(14,'主管技师'),(15,'副主任技师'),(16,'主任技师'),(17,'其他');
+/*!40000 ALTER TABLE `contact_job_title_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `contact_market_classification_pl`
+--
+
+DROP TABLE IF EXISTS `contact_market_classification_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `contact_market_classification_pl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `contact_market_classification_pl`
+--
+
+LOCK TABLES `contact_market_classification_pl` WRITE;
+/*!40000 ALTER TABLE `contact_market_classification_pl` DISABLE KEYS */;
+INSERT INTO `contact_market_classification_pl` VALUES (1,'战略城市'),(2,'一级城市'),(3,'二级城市'),(4,'三级城市'),(5,'四级城市');
+/*!40000 ALTER TABLE `contact_market_classification_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `contact_status_pl`
+--
+
+DROP TABLE IF EXISTS `contact_status_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `contact_status_pl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `contact_status_pl`
+--
+
+LOCK TABLES `contact_status_pl` WRITE;
+/*!40000 ALTER TABLE `contact_status_pl` DISABLE KEYS */;
+INSERT INTO `contact_status_pl` VALUES (1,'有效'),(2,'无效');
+/*!40000 ALTER TABLE `contact_status_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `contactcrmuser`
+--
+
+DROP TABLE IF EXISTS `contactcrmuser`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `contactcrmuser` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `contactId` mediumint(9) NOT NULL,
+ `crmuserId` mediumint(9) NOT NULL,
+ PRIMARY KEY (`id`) USING BTREE,
+ UNIQUE KEY `contactId` (`contactId`,`crmuserId`),
+ KEY `crm_contact_cons1` (`crmuserId`),
+ CONSTRAINT `crm_contact_cons1` FOREIGN KEY (`crmuserId`) REFERENCES `crmuser` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `crm_contact_cons2` FOREIGN KEY (`contactId`) REFERENCES `contact` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `contactcrmuser`
+--
+
+LOCK TABLES `contactcrmuser` WRITE;
+/*!40000 ALTER TABLE `contactcrmuser` DISABLE KEYS */;
+/*!40000 ALTER TABLE `contactcrmuser` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `crmuser`
+--
+
+DROP TABLE IF EXISTS `crmuser`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `crmuser` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `name` varchar(255) NOT NULL,
+ `code` varchar(255) DEFAULT NULL,
+ `reportto` mediumint(9) DEFAULT NULL,
+ `role` mediumint(9) DEFAULT NULL,
+ `pl1` mediumint(9) DEFAULT NULL,
+ `pl2` mediumint(9) DEFAULT NULL,
+ `pl4` mediumint(9) DEFAULT NULL,
+ `pl5` mediumint(9) DEFAULT NULL,
+ `city` mediumint(9) DEFAULT NULL,
+ `department` varchar(255) DEFAULT NULL,
+ `whenadded` datetime DEFAULT NULL,
+ `modifier` varchar(255) DEFAULT NULL,
+ `modify_datetime` date DEFAULT NULL,
+ `owner` varchar(255) DEFAULT NULL,
+ `level` mediumint(9) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE,
+ UNIQUE KEY `code` (`code`)
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `crmuser`
+--
+
+LOCK TABLES `crmuser` WRITE;
+/*!40000 ALTER TABLE `crmuser` DISABLE KEYS */;
+INSERT INTO `crmuser` VALUES (-1,'无','BJ',0,-1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(1,'管理员','BJ231011001',-1,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+/*!40000 ALTER TABLE `crmuser` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `crmuser_activited`
+--
+
+DROP TABLE IF EXISTS `crmuser_activited`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `crmuser_activited` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `crmuser_activited`
+--
+
+LOCK TABLES `crmuser_activited` WRITE;
+/*!40000 ALTER TABLE `crmuser_activited` DISABLE KEYS */;
+INSERT INTO `crmuser_activited` VALUES (0,'未激活'),(1,'已激活');
+/*!40000 ALTER TABLE `crmuser_activited` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `crmuser_level_pl`
+--
+
+DROP TABLE IF EXISTS `crmuser_level_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `crmuser_level_pl` (
+ `id` int(11) NOT NULL,
+ `val` varchar(45) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `crmuser_level_pl`
+--
+
+LOCK TABLES `crmuser_level_pl` WRITE;
+/*!40000 ALTER TABLE `crmuser_level_pl` DISABLE KEYS */;
+INSERT INTO `crmuser_level_pl` VALUES (11,'11'),(21,'21'),(31,'31');
+/*!40000 ALTER TABLE `crmuser_level_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `crmuser_pl1`
+--
+
+DROP TABLE IF EXISTS `crmuser_pl1`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `crmuser_pl1` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `crmuser_pl1`
+--
+
+LOCK TABLES `crmuser_pl1` WRITE;
+/*!40000 ALTER TABLE `crmuser_pl1` DISABLE KEYS */;
+INSERT INTO `crmuser_pl1` VALUES (1,'有效'),(2,'无效');
+/*!40000 ALTER TABLE `crmuser_pl1` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `crmuser_pl2`
+--
+
+DROP TABLE IF EXISTS `crmuser_pl2`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `crmuser_pl2` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `crmuser_pl2`
+--
+
+LOCK TABLES `crmuser_pl2` WRITE;
+/*!40000 ALTER TABLE `crmuser_pl2` DISABLE KEYS */;
+INSERT INTO `crmuser_pl2` VALUES (1,'麻药'),(2,'慢痛'),(3,'奥诺美'),(4,'全部');
+/*!40000 ALTER TABLE `crmuser_pl2` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `data_exchange_operation`
+--
+
+DROP TABLE IF EXISTS `data_exchange_operation`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `data_exchange_operation` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `version` bigint(20) NOT NULL,
+ `val` varchar(255) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `val` (`val`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `data_exchange_operation`
+--
+
+LOCK TABLES `data_exchange_operation` WRITE;
+/*!40000 ALTER TABLE `data_exchange_operation` DISABLE KEYS */;
+INSERT INTO `data_exchange_operation` VALUES (1,0,'Import'),(2,0,'Export');
+/*!40000 ALTER TABLE `data_exchange_operation` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `data_exchange_status`
+--
+
+DROP TABLE IF EXISTS `data_exchange_status`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `data_exchange_status` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `version` bigint(20) NOT NULL,
+ `val` varchar(255) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `val` (`val`)
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `data_exchange_status`
+--
+
+LOCK TABLES `data_exchange_status` WRITE;
+/*!40000 ALTER TABLE `data_exchange_status` DISABLE KEYS */;
+INSERT INTO `data_exchange_status` VALUES (1,0,'Pending'),(2,0,'Abort'),(3,0,'Completed'),(4,0,'Cancelled');
+/*!40000 ALTER TABLE `data_exchange_status` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `data_exchange_teample`
+--
+
+DROP TABLE IF EXISTS `data_exchange_teample`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `data_exchange_teample` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(255) NOT NULL,
+ `template` longtext NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `name` (`name`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `data_exchange_teample`
+--
+
+LOCK TABLES `data_exchange_teample` WRITE;
+/*!40000 ALTER TABLE `data_exchange_teample` DISABLE KEYS */;
+INSERT INTO `data_exchange_teample` VALUES (1,'Account Full Import Template 1.0','\r\n\r\n 1000 \r\n Account \r\n BdmCode \r\n account.csv \r\n crm_mysql \r\n \r\n 记录行ID \r\n String \r\n BdmCode \r\n \r\n \r\n \r\n 年诊疗人数 \r\n Integer \r\n NumOfTreatPerYear \r\n \r\n\r\n \r\n 成立时间 \r\n Date \r\n DateOfEstablish \r\n m/d/yy \r\n \r\n \r\n\r\n \r\n 客户名称 \r\n String \r\n Name \r\n \r\n\r\n \r\n 医院行政级别 \r\n Lookup \r\n AdministrativLevel \r\n AccountAdministrativLevelPl \r\n Val \r\n Id \r\n \r\n\r\n \r\n 医院分级 \r\n Lookup \r\n Grade \r\n AccountGradePl \r\n Val \r\n Id \r\n \r\n\r\n \r\n 医院类型 \r\n Lookup \r\n HospitalType \r\n AccountTypePl \r\n Val \r\n Id \r\n \r\n\r\n \r\n 地方军队医院 \r\n Lookup \r\n LocalOrArmy \r\n AccountLocalOrArmyPl \r\n Val \r\n Id \r\n \r\n\r\n \r\n 综合专科医院 \r\n Lookup \r\n ComprehensiveOrSpecialized \r\n AccountComprehensiveOrSpecializedPl \r\n Val \r\n Id \r\n \r\n\r\n \r\n 重点医院 \r\n Lookup \r\n KeyType \r\n AccountPointPl \r\n Val \r\n Id \r\n \r\n\r\n \r\n 状态 \r\n Lookup \r\n Status \r\n AccountStatusPl \r\n Val \r\n Id \r\n \r\n\r\n \r\n 法人 \r\n String \r\n DutyOfficer \r\n \r\n\r\n \r\n 医生数量 \r\n Integer \r\n NumOfDoctors \r\n \r\n\r\n \r\n 助理医师人数 \r\n Integer \r\n NumOfAssistantDoctors \r\n \r\n \r\n \r\n 员工总数 \r\n Integer \r\n NumOfStaff \r\n \r\n\r\n \r\n 门诊人数 \r\n Integer \r\n NumOfOutpatient \r\n \r\n\r\n \r\n 总病床数 \r\n Integer \r\n TotalNumOfSickbed \r\n \r\n\r\n \r\n 麻醉科医生数 \r\n Integer \r\n NumOfAnesthesiaDoctor \r\n \r\n\r\n \r\n 疼痛学组医生数 \r\n Integer \r\n NumOfPainDoctor \r\n \r\n\r\n \r\n 手术量年 \r\n Integer \r\n NumOfSurgeryPerYear \r\n \r\n\r\n \r\n 手术间 \r\n Integer \r\n NumOfSurgeryRoom \r\n \r\n\r\n \r\n 阿片类用药量 \r\n Integer \r\n NumOfUsingOpiatesMedicine \r\n \r\n\r\n \r\n 阿片类注射剂量 \r\n Integer \r\n NumOfUsingOpiatesInjection \r\n \r\n\r\n \r\n 注册资金 \r\n Integer \r\n RegisteredCapital \r\n \r\n\r\n \r\n 主要电话号码 \r\n String \r\n Tel \r\n \r\n\r\n \r\n 主要传真号码 \r\n String \r\n Fax \r\n \r\n\r\n \r\n 市场分类 \r\n Lookup \r\n MarketClassification \r\n AccountMarketClassificationPl \r\n Val \r\n Id \r\n \r\n\r\n \r\n 医院省份 \r\n String \r\n Province \r\n \r\n\r\n \r\n 医院区县 \r\n String \r\n Districts \r\n \r\n \r\n \r\n 医院详细地址 \r\n String \r\n Address \r\n \r\n ');
+/*!40000 ALTER TABLE `data_exchange_teample` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `dealeraccount`
+--
+
+DROP TABLE IF EXISTS `dealeraccount`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `dealeraccount` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `name` varchar(255) NOT NULL,
+ `address` varchar(255) DEFAULT NULL,
+ `tele` varchar(255) DEFAULT NULL,
+ `status` mediumint(9) DEFAULT NULL,
+ `pl1` mediumint(9) DEFAULT NULL,
+ `pl2` mediumint(9) DEFAULT NULL,
+ `whenadded` datetime DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=89 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `dealeraccount`
+--
+
+LOCK TABLES `dealeraccount` WRITE;
+/*!40000 ALTER TABLE `dealeraccount` DISABLE KEYS */;
+INSERT INTO `dealeraccount` VALUES (1,'经销商0','北京市朝阳区望京东路0号','1381199260',1,1,1,NULL),(2,'经销商1','北京市朝阳区望京东路1号','1381199261',2,2,2,NULL),(3,'经销商2','北京市朝阳区望京东路2号','1381199262',1,3,3,NULL),(4,'经销商3','北京市朝阳区望京东路3号','1381199263',2,1,4,NULL),(5,'经销商4','北京市朝阳区望京东路4号','1381199264',1,2,5,NULL),(6,'经销商5','北京市朝阳区望京东路5号','1381199265',2,3,6,NULL),(7,'经销商6','北京市朝阳区望京东路6号','1381199266',1,1,7,NULL),(8,'经销商7','北京市朝阳区望京东路7号','1381199267',2,2,1,NULL),(9,'经销商8','北京市朝阳区望京东路8号','1381199268',1,3,2,NULL),(10,'经销商9','北京市朝阳区望京东路9号','1381199269',2,1,3,NULL),(11,'经销商10','北京市朝阳区望京东路10号','13811992610',1,2,4,NULL),(12,'经销商11','北京市朝阳区望京东路11号','13811992611',2,3,5,NULL),(13,'经销商12','北京市朝阳区望京东路12号','13811992612',1,1,6,NULL),(14,'经销商13','北京市朝阳区望京东路13号','13811992613',2,2,7,NULL),(15,'经销商14','北京市朝阳区望京东路14号','13811992614',1,3,1,NULL),(16,'经销商15','北京市朝阳区望京东路15号','13811992615',2,1,2,NULL),(17,'经销商16','北京市朝阳区望京东路16号','13811992616',1,2,3,NULL),(18,'经销商17','北京市朝阳区望京东路17号','13811992617',2,3,4,NULL),(19,'经销商18','北京市朝阳区望京东路18号','13811992618',1,1,5,NULL),(20,'经销商19','北京市朝阳区望京东路19号','13811992619',2,2,6,NULL),(21,'经销商20','北京市朝阳区望京东路20号','13811992620',1,3,7,NULL),(22,'经销商21','北京市朝阳区望京东路21号','13811992621',2,1,1,NULL),(23,'经销商22','北京市朝阳区望京东路22号','13811992622',1,2,2,NULL),(24,'经销商23','北京市朝阳区望京东路23号','13811992623',2,3,3,NULL),(25,'经销商24','北京市朝阳区望京东路24号','13811992624',1,1,4,NULL),(26,'经销商25','北京市朝阳区望京东路25号','13811992625',2,2,5,NULL),(27,'经销商26','北京市朝阳区望京东路26号','13811992626',1,3,6,NULL),(28,'经销商27','北京市朝阳区望京东路27号','13811992627',2,1,7,NULL),(29,'经销商28','北京市朝阳区望京东路28号','13811992628',1,2,1,NULL),(30,'经销商29','北京市朝阳区望京东路29号','13811992629',2,3,2,NULL),(31,'经销商30','北京市朝阳区望京东路30号','13811992630',1,1,3,NULL),(32,'经销商31','北京市朝阳区望京东路31号','13811992631',2,2,4,NULL),(33,'经销商32','北京市朝阳区望京东路32号','13811992632',1,3,5,NULL),(34,'经销商33','北京市朝阳区望京东路33号','13811992633',2,1,6,NULL),(35,'经销商34','北京市朝阳区望京东路34号','13811992634',1,2,7,NULL),(36,'经销商35','北京市朝阳区望京东路35号','13811992635',2,3,1,NULL),(37,'经销商36','北京市朝阳区望京东路36号','13811992636',1,1,2,NULL),(38,'经销商37','北京市朝阳区望京东路37号','13811992637',2,2,3,NULL),(39,'经销商38','北京市朝阳区望京东路38号','13811992638',1,3,4,NULL),(40,'经销商39','北京市朝阳区望京东路39号','13811992639',2,1,5,NULL),(41,'经销商40','北京市朝阳区望京东路40号','13811992640',1,2,6,NULL),(42,'经销商41','北京市朝阳区望京东路41号','13811992641',2,3,7,NULL),(43,'经销商42','北京市朝阳区望京东路42号','13811992642',1,1,1,NULL),(44,'经销商43','北京市朝阳区望京东路43号','13811992643',2,2,2,NULL),(45,'经销商44','北京市朝阳区望京东路44号','13811992644',1,3,3,NULL),(46,'经销商45','北京市朝阳区望京东路45号','13811992645',2,1,4,NULL),(47,'经销商46','北京市朝阳区望京东路46号','13811992646',1,2,5,NULL),(48,'经销商47','北京市朝阳区望京东路47号','13811992647',2,3,6,NULL),(49,'经销商48','北京市朝阳区望京东路48号','13811992648',1,1,7,NULL),(50,'经销商49','北京市朝阳区望京东路49号','13811992649',2,2,1,NULL),(51,'经销商50','北京市朝阳区望京东路50号','13811992650',1,3,2,NULL),(52,'经销商51','北京市朝阳区望京东路51号','13811992651',2,1,3,NULL),(53,'经销商52','北京市朝阳区望京东路52号','13811992652',1,2,4,NULL),(54,'经销商53','北京市朝阳区望京东路53号','13811992653',2,3,5,NULL),(55,'经销商54','北京市朝阳区望京东路54号','13811992654',1,1,6,NULL),(56,'经销商55','北京市朝阳区望京东路55号','13811992655',2,2,7,NULL),(57,'经销商56','北京市朝阳区望京东路56号','13811992656',1,3,1,NULL),(58,'经销商57','北京市朝阳区望京东路57号','13811992657',2,1,2,NULL),(59,'经销商58','北京市朝阳区望京东路58号','13811992658',1,2,3,NULL),(60,'经销商59','北京市朝阳区望京东路59号','13811992659',2,3,4,NULL),(61,'经销商60','北京市朝阳区望京东路60号','13811992660',1,1,5,NULL),(62,'经销商61','北京市朝阳区望京东路61号','13811992661',2,2,6,NULL),(63,'经销商62','北京市朝阳区望京东路62号','13811992662',1,3,7,NULL),(64,'经销商63','北京市朝阳区望京东路63号','13811992663',2,1,1,NULL),(65,'经销商64','北京市朝阳区望京东路64号','13811992664',1,2,2,NULL),(66,'经销商65','北京市朝阳区望京东路65号','13811992665',2,3,3,NULL),(67,'经销商66','北京市朝阳区望京东路66号','13811992666',1,1,4,NULL),(68,'经销商67','北京市朝阳区望京东路67号','13811992667',2,2,5,NULL),(69,'经销商68','北京市朝阳区望京东路68号','13811992668',1,3,6,NULL),(70,'经销商69','北京市朝阳区望京东路69号','13811992669',2,1,7,NULL),(71,'经销商70','北京市朝阳区望京东路70号','13811992670',1,2,1,NULL),(72,'经销商71','北京市朝阳区望京东路71号','13811992671',2,3,2,NULL),(73,'经销商72','北京市朝阳区望京东路72号','13811992672',1,1,3,NULL),(74,'经销商73','北京市朝阳区望京东路73号','13811992673',2,2,4,NULL),(75,'经销商74','北京市朝阳区望京东路74号','13811992674',1,3,5,NULL),(76,'经销商75','北京市朝阳区望京东路75号','13811992675',2,1,6,NULL),(77,'经销商76','北京市朝阳区望京东路76号','13811992676',1,2,7,NULL),(78,'经销商77','北京市朝阳区望京东路77号','13811992677',2,3,1,NULL),(79,'经销商78','北京市朝阳区望京东路78号','13811992678',1,1,2,NULL),(80,'经销商79','北京市朝阳区望京东路79号','13811992679',2,2,3,NULL),(81,'经销商80','北京市朝阳区望京东路80号','13811992680',1,3,4,NULL),(82,'经销商81','北京市朝阳区望京东路81号','13811992681',2,1,5,NULL),(83,'经销商82','北京市朝阳区望京东路82号','13811992682',1,2,6,NULL),(84,'经销商83','北京市朝阳区望京东路83号','13811992683',2,3,7,NULL),(85,'经销商84','北京市朝阳区望京东路84号','13811992684',1,1,1,NULL),(86,'经销商85','北京市朝阳区望京东路85号','13811992685',2,2,2,NULL),(87,'经销商86','北京市朝阳区望京东路86号','13811992686',1,3,3,NULL),(88,'经销商87','北京市朝阳区望京东路87号','13811992687',2,1,4,NULL);
+/*!40000 ALTER TABLE `dealeraccount` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `dealercontact`
+--
+
+DROP TABLE IF EXISTS `dealercontact`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `dealercontact` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `name` varchar(255) NOT NULL,
+ `sex` mediumint(9) DEFAULT NULL,
+ `tel_work` varchar(255) DEFAULT NULL,
+ `dealerAccountId` mediumint(9) NOT NULL,
+ `status` mediumint(9) DEFAULT NULL,
+ `pl1` mediumint(9) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `dealercontact`
+--
+
+LOCK TABLES `dealercontact` WRITE;
+/*!40000 ALTER TABLE `dealercontact` DISABLE KEYS */;
+/*!40000 ALTER TABLE `dealercontact` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `dl`
+--
+
+DROP TABLE IF EXISTS `dl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `dl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `deviceName` varchar(255) DEFAULT NULL,
+ `appId` mediumint(9) DEFAULT NULL,
+ `dlDate` datetime DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=2000 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `dl`
+--
+
+LOCK TABLES `dl` WRITE;
+/*!40000 ALTER TABLE `dl` DISABLE KEYS */;
+INSERT INTO `dl` VALUES (1,'N2',2,'2013-10-09 14:42:28'),(2,'N3',3,'2013-10-20 15:42:28'),(3,'N1',4,'2013-10-04 16:42:28'),(4,'N2',5,'2013-10-28 17:42:28'),(5,'N3',6,'2013-10-06 18:42:28'),(6,'N1',7,'2013-10-23 19:42:28'),(7,'N2',8,'2013-10-03 20:42:28'),(8,'N3',9,'2013-10-18 21:42:28'),(9,'N1',10,'2013-10-22 22:42:28'),(10,'N2',1,'2013-10-13 23:42:28'),(11,'N3',2,'2013-10-06 00:42:28'),(12,'N1',3,'2013-10-18 01:42:28'),(13,'N2',4,'2013-10-13 02:42:28'),(14,'N3',5,'2013-10-19 03:42:28'),(15,'N1',6,'2013-10-11 04:42:28'),(16,'N2',7,'2013-10-02 05:42:28'),(17,'N3',8,'2013-10-09 06:42:28'),(18,'N1',9,'2013-10-27 07:42:28'),(19,'N2',10,'2013-10-24 08:42:28'),(20,'N3',1,'2013-10-24 09:42:28'),(21,'N1',2,'2013-10-21 10:42:28'),(22,'N2',3,'2013-10-15 13:42:28'),(23,'N3',4,'2013-10-24 14:42:28'),(24,'N1',5,'2013-10-13 15:42:28'),(25,'N2',6,'2013-10-01 16:42:28'),(26,'N3',7,'2013-10-25 17:42:28'),(27,'N1',8,'2013-10-06 18:42:28'),(28,'N2',9,'2013-10-04 19:42:28'),(29,'N3',10,'2013-10-05 20:42:28'),(30,'N1',1,'2013-10-28 21:42:28'),(31,'N2',2,'2013-10-09 22:42:28'),(32,'N3',3,'2013-10-29 23:42:28'),(33,'N1',4,'2013-10-12 00:42:28'),(34,'N2',5,'2013-10-04 01:42:28'),(35,'N3',6,'2013-10-12 02:42:28'),(36,'N1',7,'2013-10-03 03:42:28'),(37,'N2',8,'2013-10-19 04:42:28'),(38,'N3',9,'2013-10-04 05:42:28'),(39,'N1',10,'2013-10-16 06:42:28'),(40,'N2',1,'2013-10-11 07:42:28'),(41,'N3',2,'2013-10-12 08:42:28'),(42,'N1',3,'2013-10-18 09:42:28'),(43,'N2',4,'2013-10-11 10:42:28'),(44,'N3',5,'2013-10-21 13:42:28'),(45,'N1',6,'2013-10-11 14:42:28'),(46,'N2',7,'2013-10-21 15:42:28'),(47,'N3',8,'2013-10-21 16:42:28'),(48,'N1',9,'2013-10-16 17:42:28'),(49,'N2',10,'2013-10-22 18:42:28'),(50,'N3',1,'2013-10-13 19:42:28'),(51,'N1',2,'2013-10-29 20:42:28'),(52,'N2',3,'2013-10-02 21:42:28'),(53,'N3',4,'2013-10-07 22:42:28'),(54,'N1',5,'2013-10-19 23:42:28'),(55,'N2',6,'2013-10-20 00:42:28'),(56,'N3',7,'2013-10-04 01:42:28'),(57,'N1',8,'2013-10-18 02:42:28'),(58,'N2',9,'2013-10-30 03:42:28'),(59,'N3',10,'2013-10-22 04:42:28'),(60,'N1',1,'2013-10-10 05:42:28'),(61,'N2',2,'2013-10-08 06:42:28'),(62,'N3',3,'2013-10-09 07:42:28'),(63,'N1',4,'2013-10-08 08:42:28'),(64,'N2',5,'2013-10-16 09:42:28'),(65,'N3',6,'2013-10-19 10:42:28'),(66,'N1',7,'2013-10-06 13:42:28'),(67,'N2',8,'2013-10-02 14:42:28'),(68,'N3',9,'2013-10-10 15:42:28'),(69,'N1',10,'2013-10-15 16:42:28'),(70,'N2',1,'2013-10-18 17:42:28'),(71,'N3',2,'2013-10-23 18:42:28'),(72,'N1',3,'2013-10-21 19:42:28'),(73,'N2',4,'2013-10-04 20:42:28'),(74,'N3',5,'2013-10-17 21:42:28'),(75,'N1',6,'2013-10-16 22:42:28'),(76,'N2',7,'2013-10-01 23:42:28'),(77,'N3',8,'2013-10-06 00:42:28'),(78,'N1',9,'2013-10-12 01:42:28'),(79,'N2',10,'2013-10-11 02:42:28'),(80,'N3',1,'2013-10-12 03:42:28'),(81,'N1',2,'2013-10-15 04:42:28'),(82,'N2',3,'2013-10-24 05:42:28'),(83,'N3',4,'2013-10-04 06:42:28'),(84,'N1',5,'2013-10-25 07:42:28'),(85,'N2',6,'2013-10-25 08:42:28'),(86,'N3',7,'2013-10-18 09:42:28'),(87,'N1',8,'2013-10-21 10:42:28'),(88,'N2',9,'2013-10-15 13:42:28'),(89,'N3',10,'2013-10-14 14:42:28'),(90,'N1',1,'2013-10-29 15:42:28'),(91,'N2',2,'2013-10-07 16:42:28'),(92,'N3',3,'2013-10-17 17:42:28'),(93,'N1',4,'2013-10-14 18:42:28'),(94,'N2',5,'2013-10-27 19:42:28'),(95,'N3',6,'2013-10-20 20:42:28'),(96,'N1',7,'2013-10-04 21:42:28'),(97,'N2',8,'2013-10-05 22:42:28'),(98,'N3',9,'2013-10-20 23:42:28'),(99,'N1',10,'2013-10-08 00:42:28'),(100,'N2',1,'2013-10-24 01:42:28'),(101,'N3',2,'2013-10-24 02:42:28'),(102,'N1',3,'2013-10-04 03:42:28'),(103,'N2',4,'2013-10-30 04:42:28'),(104,'N3',5,'2013-10-05 05:42:28'),(105,'N1',6,'2013-10-22 06:42:28'),(106,'N2',7,'2013-10-02 07:42:28'),(107,'N3',8,'2013-10-22 08:42:28'),(108,'N1',9,'2013-10-24 09:42:28'),(109,'N2',10,'2013-10-24 10:42:28'),(110,'N3',1,'2013-10-08 13:42:28'),(111,'N1',2,'2013-10-18 14:42:28'),(112,'N2',3,'2013-10-02 15:42:28'),(113,'N3',4,'2013-10-21 16:42:28'),(114,'N1',5,'2013-10-08 17:42:28'),(115,'N2',6,'2013-10-12 18:42:28'),(116,'N3',7,'2013-10-09 19:42:28'),(117,'N1',8,'2013-10-23 20:42:28'),(118,'N2',9,'2013-10-21 21:42:28'),(119,'N3',10,'2013-10-24 22:42:28'),(120,'N1',1,'2013-10-19 23:42:28'),(121,'N2',2,'2013-10-18 00:42:28'),(122,'N3',3,'2013-10-08 01:42:28'),(123,'N1',4,'2013-10-11 02:42:28'),(124,'N2',5,'2013-10-13 03:42:28'),(125,'N3',6,'2013-10-03 04:42:28'),(126,'N1',7,'2013-10-15 05:42:28'),(127,'N2',8,'2013-10-23 06:42:28'),(128,'N3',9,'2013-10-30 07:42:28'),(129,'N1',10,'2013-10-12 08:42:28'),(130,'N2',1,'2013-10-06 09:42:28'),(131,'N3',2,'2013-10-09 10:42:28'),(132,'N1',3,'2013-10-04 13:42:28'),(133,'N2',4,'2013-10-03 14:42:28'),(134,'N3',5,'2013-10-14 15:42:28'),(135,'N1',6,'2013-10-17 16:42:28'),(136,'N2',7,'2013-10-22 17:42:28'),(137,'N3',8,'2013-10-04 18:42:28'),(138,'N1',9,'2013-10-19 19:42:28'),(139,'N2',10,'2013-10-07 20:42:28'),(140,'N3',1,'2013-10-28 21:42:28'),(141,'N1',2,'2013-10-05 22:42:28'),(142,'N2',3,'2013-10-27 23:42:28'),(143,'N3',4,'2013-10-28 00:42:28'),(144,'N1',5,'2013-10-20 01:42:28'),(145,'N2',6,'2013-10-30 02:42:28'),(146,'N3',7,'2013-10-25 03:42:28'),(147,'N1',8,'2013-10-25 04:42:28'),(148,'N2',9,'2013-10-02 05:42:28'),(149,'N3',10,'2013-10-06 06:42:28'),(150,'N1',1,'2013-10-24 07:42:28'),(151,'N2',2,'2013-10-29 08:42:28'),(152,'N3',3,'2013-10-23 09:42:28'),(153,'N1',4,'2013-10-13 10:42:28'),(154,'N2',5,'2013-10-16 13:42:28'),(155,'N3',6,'2013-10-06 14:42:28'),(156,'N1',7,'2013-10-22 15:42:28'),(157,'N2',8,'2013-10-19 16:42:28'),(158,'N3',9,'2013-10-29 17:42:28'),(159,'N1',10,'2013-10-25 18:42:28'),(160,'N2',1,'2013-10-13 19:42:28'),(161,'N3',2,'2013-10-10 20:42:28'),(162,'N1',3,'2013-10-13 21:42:28'),(163,'N2',4,'2013-10-28 22:42:28'),(164,'N3',5,'2013-10-09 23:42:28'),(165,'N1',6,'2013-10-09 00:42:28'),(166,'N2',7,'2013-10-02 01:42:28'),(167,'N3',8,'2013-10-13 02:42:28'),(168,'N1',9,'2013-10-23 03:42:28'),(169,'N2',10,'2013-10-29 04:42:28'),(170,'N3',1,'2013-10-15 05:42:28'),(171,'N1',2,'2013-10-27 06:42:28'),(172,'N2',3,'2013-10-02 07:42:28'),(173,'N3',4,'2013-10-16 08:42:28'),(174,'N1',5,'2013-10-03 09:42:28'),(175,'N2',6,'2013-10-04 10:42:28'),(176,'N3',7,'2013-10-04 13:42:28'),(177,'N1',8,'2013-10-21 14:42:28'),(178,'N2',9,'2013-10-06 15:42:28'),(179,'N3',10,'2013-10-11 16:42:28'),(180,'N1',1,'2013-10-24 17:42:28'),(181,'N2',2,'2013-10-07 18:42:28'),(182,'N3',3,'2013-10-05 19:42:28'),(183,'N1',4,'2013-10-26 20:42:28'),(184,'N2',5,'2013-10-22 21:42:28'),(185,'N3',6,'2013-10-13 22:42:28'),(186,'N1',7,'2013-10-05 23:42:28'),(187,'N2',8,'2013-10-22 00:42:28'),(188,'N3',9,'2013-10-03 01:42:28'),(189,'N1',10,'2013-10-07 02:42:28'),(190,'N2',1,'2013-10-15 03:42:28'),(191,'N3',2,'2013-10-07 04:42:28'),(192,'N1',3,'2013-10-11 05:42:28'),(193,'N2',4,'2013-10-24 06:42:28'),(194,'N3',5,'2013-10-29 07:42:28'),(195,'N1',6,'2013-10-15 08:42:28'),(196,'N2',7,'2013-10-12 09:42:28'),(197,'N3',8,'2013-10-26 10:42:28'),(198,'N1',9,'2013-10-04 13:42:28'),(199,'N2',10,'2013-10-07 14:42:28'),(200,'N3',1,'2013-10-20 15:42:28'),(201,'N1',2,'2013-10-23 16:42:28'),(202,'N2',3,'2013-10-16 17:42:28'),(203,'N3',4,'2013-10-02 18:42:28'),(204,'N1',5,'2013-10-23 19:42:28'),(205,'N2',6,'2013-10-08 20:42:28'),(206,'N3',7,'2013-10-02 21:42:28'),(207,'N1',8,'2013-10-21 22:42:28'),(208,'N2',9,'2013-10-18 23:42:28'),(209,'N3',10,'2013-10-11 00:42:28'),(210,'N1',1,'2013-10-23 01:42:28'),(211,'N2',2,'2013-10-29 02:42:28'),(212,'N3',3,'2013-10-18 03:42:28'),(213,'N1',4,'2013-10-06 04:42:28'),(214,'N2',5,'2013-10-16 05:42:28'),(215,'N3',6,'2013-10-11 06:42:28'),(216,'N1',7,'2013-10-22 07:42:28'),(217,'N2',8,'2013-10-23 08:42:28'),(218,'N3',9,'2013-10-25 09:42:28'),(219,'N1',10,'2013-10-28 10:42:28'),(220,'N2',1,'2013-10-04 13:42:28'),(221,'N3',2,'2013-10-14 14:42:28'),(222,'N1',3,'2013-10-14 15:42:28'),(223,'N2',4,'2013-10-13 16:42:28'),(224,'N3',5,'2013-10-17 17:42:28'),(225,'N1',6,'2013-10-12 18:42:28'),(226,'N2',7,'2013-10-15 19:42:28'),(227,'N3',8,'2013-10-29 20:42:28'),(228,'N1',9,'2013-10-21 21:42:28'),(229,'N2',10,'2013-10-08 22:42:28'),(230,'N3',1,'2013-10-24 23:42:28'),(231,'N1',2,'2013-10-08 00:42:28'),(232,'N2',3,'2013-10-06 01:42:28'),(233,'N3',4,'2013-10-26 02:42:28'),(234,'N1',5,'2013-10-20 03:42:28'),(235,'N2',6,'2013-10-07 04:42:28'),(236,'N3',7,'2013-10-22 05:42:28'),(237,'N1',8,'2013-10-21 06:42:28'),(238,'N2',9,'2013-10-29 07:42:28'),(239,'N3',10,'2013-10-28 08:42:28'),(240,'N1',1,'2013-10-10 09:42:28'),(241,'N2',2,'2013-10-14 10:42:28'),(242,'N3',3,'2013-10-01 13:42:28'),(243,'N1',4,'2013-10-10 14:42:28'),(244,'N2',5,'2013-10-18 15:42:28'),(245,'N3',6,'2013-10-08 16:42:28'),(246,'N1',7,'2013-10-22 17:42:28'),(247,'N2',8,'2013-10-05 18:42:28'),(248,'N3',9,'2013-10-21 19:42:28'),(249,'N1',10,'2013-10-23 20:42:28'),(250,'N2',1,'2013-10-11 21:42:28'),(251,'N3',2,'2013-10-10 22:42:28'),(252,'N1',3,'2013-10-17 23:42:28'),(253,'N2',4,'2013-10-23 00:42:28'),(254,'N3',5,'2013-10-06 01:42:28'),(255,'N1',6,'2013-10-17 02:42:28'),(256,'N2',7,'2013-10-03 03:42:28'),(257,'N3',8,'2013-10-27 04:42:28'),(258,'N1',9,'2013-10-10 05:42:28'),(259,'N2',10,'2013-10-29 06:42:28'),(260,'N3',1,'2013-10-09 07:42:28'),(261,'N1',2,'2013-10-22 08:42:28'),(262,'N2',3,'2013-10-23 09:42:28'),(263,'N3',4,'2013-10-08 10:42:28'),(264,'N1',5,'2013-10-20 13:42:28'),(265,'N2',6,'2013-10-02 14:42:28'),(266,'N3',7,'2013-10-08 15:42:28'),(267,'N1',8,'2013-10-15 16:42:28'),(268,'N2',9,'2013-10-05 17:42:28'),(269,'N3',10,'2013-10-18 18:42:28'),(270,'N1',1,'2013-10-11 19:42:28'),(271,'N2',2,'2013-10-12 20:42:28'),(272,'N3',3,'2013-10-09 21:42:28'),(273,'N1',4,'2013-10-11 22:42:28'),(274,'N2',5,'2013-10-04 23:42:28'),(275,'N3',6,'2013-10-16 00:42:28'),(276,'N1',7,'2013-10-08 01:42:28'),(277,'N2',8,'2013-10-03 02:42:28'),(278,'N3',9,'2013-10-30 03:42:28'),(279,'N1',10,'2013-10-05 04:42:28'),(280,'N2',1,'2013-10-25 05:42:28'),(281,'N3',2,'2013-10-12 06:42:28'),(282,'N1',3,'2013-10-02 07:42:28'),(283,'N2',4,'2013-10-04 08:42:28'),(284,'N3',5,'2013-10-09 09:42:28'),(285,'N1',6,'2013-10-12 10:42:28'),(286,'N2',7,'2013-10-16 13:42:28'),(287,'N3',8,'2013-10-21 14:42:28'),(288,'N1',9,'2013-10-20 15:42:28'),(289,'N2',10,'2013-10-23 16:42:28'),(290,'N3',1,'2013-10-04 17:42:28'),(291,'N1',2,'2013-10-14 18:42:28'),(292,'N2',3,'2013-10-06 19:42:28'),(293,'N3',4,'2013-10-20 20:42:28'),(294,'N1',5,'2013-10-21 21:42:28'),(295,'N2',6,'2013-10-14 22:42:28'),(296,'N3',7,'2013-10-24 23:42:28'),(297,'N1',8,'2013-10-04 00:42:28'),(298,'N2',9,'2013-10-02 01:42:28'),(299,'N3',10,'2013-10-28 02:42:28'),(300,'N1',1,'2013-10-09 03:42:28'),(301,'N2',2,'2013-10-10 04:42:28'),(302,'N3',3,'2013-10-28 05:42:28'),(303,'N1',4,'2013-10-20 06:42:28'),(304,'N2',5,'2013-10-26 07:42:28'),(305,'N3',6,'2013-10-27 08:42:28'),(306,'N1',7,'2013-10-28 09:42:28'),(307,'N2',8,'2013-10-04 10:42:28'),(308,'N3',9,'2013-10-07 13:42:28'),(309,'N1',10,'2013-10-27 14:42:28'),(310,'N2',1,'2013-10-06 15:42:28'),(311,'N3',2,'2013-10-13 16:42:28'),(312,'N1',3,'2013-10-07 17:42:28'),(313,'N2',4,'2013-10-06 18:42:28'),(314,'N3',5,'2013-10-26 19:42:28'),(315,'N1',6,'2013-10-22 20:42:28'),(316,'N2',7,'2013-10-08 21:42:28'),(317,'N3',8,'2013-10-02 22:42:28'),(318,'N1',9,'2013-10-20 23:42:28'),(319,'N2',10,'2013-10-02 00:42:28'),(320,'N3',1,'2013-10-22 01:42:28'),(321,'N1',2,'2013-10-13 02:42:28'),(322,'N2',3,'2013-10-25 03:42:28'),(323,'N3',4,'2013-10-28 04:42:28'),(324,'N1',5,'2013-10-26 05:42:28'),(325,'N2',6,'2013-10-20 06:42:28'),(326,'N3',7,'2013-10-28 07:42:28'),(327,'N1',8,'2013-10-16 08:42:28'),(328,'N2',9,'2013-10-22 09:42:28'),(329,'N3',10,'2013-10-26 10:42:28'),(330,'N1',1,'2013-10-03 13:42:28'),(331,'N2',2,'2013-10-08 14:42:28'),(332,'N3',3,'2013-10-21 15:42:28'),(333,'N1',4,'2013-10-22 16:42:28'),(334,'N2',5,'2013-10-22 17:42:28'),(335,'N3',6,'2013-10-12 18:42:28'),(336,'N1',7,'2013-10-25 19:42:28'),(337,'N2',8,'2013-10-07 20:42:28'),(338,'N3',9,'2013-10-19 21:42:28'),(339,'N1',10,'2013-10-06 22:42:28'),(340,'N2',1,'2013-10-04 23:42:28'),(341,'N3',2,'2013-10-27 00:42:28'),(342,'N1',3,'2013-10-16 01:42:28'),(343,'N2',4,'2013-10-28 02:42:28'),(344,'N3',5,'2013-10-03 03:42:28'),(345,'N1',6,'2013-10-05 04:42:28'),(346,'N2',7,'2013-10-14 05:42:28'),(347,'N3',8,'2013-10-23 06:42:28'),(348,'N1',9,'2013-10-23 07:42:28'),(349,'N2',10,'2013-10-08 08:42:28'),(350,'N3',1,'2013-10-22 09:42:28'),(351,'N1',2,'2013-10-27 10:42:28'),(352,'N2',3,'2013-10-11 13:42:28'),(353,'N3',4,'2013-10-22 14:42:28'),(354,'N1',5,'2013-10-01 15:42:28'),(355,'N2',6,'2013-10-25 16:42:28'),(356,'N3',7,'2013-10-21 17:42:28'),(357,'N1',8,'2013-10-27 18:42:28'),(358,'N2',9,'2013-10-23 19:42:28'),(359,'N3',10,'2013-10-09 20:42:28'),(360,'N1',1,'2013-10-16 21:42:28'),(361,'N2',2,'2013-10-08 22:42:28'),(362,'N3',3,'2013-10-01 23:42:28'),(363,'N1',4,'2013-10-25 00:42:28'),(364,'N2',5,'2013-10-02 01:42:28'),(365,'N3',6,'2013-10-06 02:42:28'),(366,'N1',7,'2013-10-10 03:42:28'),(367,'N2',8,'2013-10-12 04:42:28'),(368,'N3',9,'2013-10-17 05:42:28'),(369,'N1',10,'2013-10-12 06:42:28'),(370,'N2',1,'2013-10-26 07:42:28'),(371,'N3',2,'2013-10-12 08:42:28'),(372,'N1',3,'2013-10-11 09:42:28'),(373,'N2',4,'2013-10-18 10:42:28'),(374,'N3',5,'2013-10-13 13:42:28'),(375,'N1',6,'2013-10-12 14:42:28'),(376,'N2',7,'2013-10-26 15:42:28'),(377,'N3',8,'2013-10-08 16:42:28'),(378,'N1',9,'2013-10-18 17:42:28'),(379,'N2',10,'2013-10-02 18:42:28'),(380,'N3',1,'2013-10-11 19:42:28'),(381,'N1',2,'2013-10-15 20:42:28'),(382,'N2',3,'2013-10-15 21:42:28'),(383,'N3',4,'2013-10-23 22:42:28'),(384,'N1',5,'2013-10-17 23:42:28'),(385,'N2',6,'2013-10-03 00:42:28'),(386,'N3',7,'2013-10-06 01:42:28'),(387,'N1',8,'2013-10-06 02:42:28'),(388,'N2',9,'2013-10-26 03:42:28'),(389,'N3',10,'2013-10-26 04:42:28'),(390,'N1',1,'2013-10-03 05:42:28'),(391,'N2',2,'2013-10-23 06:42:28'),(392,'N3',3,'2013-10-18 07:42:28'),(393,'N1',4,'2013-10-03 08:42:28'),(394,'N2',5,'2013-10-26 09:42:28'),(395,'N3',6,'2013-10-26 10:42:28'),(396,'N1',7,'2013-10-26 13:42:28'),(397,'N2',8,'2013-10-18 14:42:28'),(398,'N3',9,'2013-10-14 15:42:28'),(399,'N1',10,'2013-10-09 16:42:28'),(400,'N2',1,'2013-10-13 17:42:28'),(401,'N3',2,'2013-10-12 18:42:28'),(402,'N1',3,'2013-10-12 19:42:28'),(403,'N2',4,'2013-10-27 20:42:28'),(404,'N3',5,'2013-10-16 21:42:28'),(405,'N1',6,'2013-10-19 22:42:28'),(406,'N2',7,'2013-10-21 23:42:28'),(407,'N3',8,'2013-10-04 00:42:28'),(408,'N1',9,'2013-10-26 01:42:28'),(409,'N2',10,'2013-10-25 02:42:28'),(410,'N3',1,'2013-10-26 03:42:28'),(411,'N1',2,'2013-10-25 04:42:28'),(412,'N2',3,'2013-10-25 05:42:28'),(413,'N3',4,'2013-10-21 06:42:28'),(414,'N1',5,'2013-10-03 07:42:28'),(415,'N2',6,'2013-10-21 08:42:28'),(416,'N3',7,'2013-10-07 09:42:28'),(417,'N1',8,'2013-10-12 10:42:28'),(418,'N2',9,'2013-10-20 13:42:28'),(419,'N3',10,'2013-10-13 14:42:28'),(420,'N1',1,'2013-10-20 15:42:28'),(421,'N2',2,'2013-10-05 16:42:28'),(422,'N3',3,'2013-10-27 17:42:28'),(423,'N1',4,'2013-10-11 18:42:28'),(424,'N2',5,'2013-10-06 19:42:28'),(425,'N3',6,'2013-10-01 20:42:28'),(426,'N1',7,'2013-10-10 21:42:28'),(427,'N2',8,'2013-10-20 22:42:28'),(428,'N3',9,'2013-10-27 23:42:28'),(429,'N1',10,'2013-10-03 00:42:28'),(430,'N2',1,'2013-10-29 01:42:28'),(431,'N3',2,'2013-10-03 02:42:28'),(432,'N1',3,'2013-10-17 03:42:28'),(433,'N2',4,'2013-10-17 04:42:28'),(434,'N3',5,'2013-10-26 05:42:28'),(435,'N1',6,'2013-10-12 06:42:28'),(436,'N2',7,'2013-10-21 07:42:28'),(437,'N3',8,'2013-10-04 08:42:28'),(438,'N1',9,'2013-10-28 09:42:28'),(439,'N2',10,'2013-10-13 10:42:28'),(440,'N3',1,'2013-10-02 13:42:28'),(441,'N1',2,'2013-10-16 14:42:28'),(442,'N2',3,'2013-10-15 15:42:28'),(443,'N3',4,'2013-10-17 16:42:28'),(444,'N1',5,'2013-10-19 17:42:28'),(445,'N2',6,'2013-10-21 18:42:28'),(446,'N3',7,'2013-10-23 19:42:28'),(447,'N1',8,'2013-10-05 20:42:28'),(448,'N2',9,'2013-10-10 21:42:28'),(449,'N3',10,'2013-10-12 22:42:28'),(450,'N1',1,'2013-10-12 23:42:28'),(451,'N2',2,'2013-10-18 00:42:28'),(452,'N3',3,'2013-10-16 01:42:28'),(453,'N1',4,'2013-10-20 02:42:28'),(454,'N2',5,'2013-10-20 03:42:28'),(455,'N3',6,'2013-10-05 04:42:28'),(456,'N1',7,'2013-10-14 05:42:28'),(457,'N2',8,'2013-10-16 06:42:28'),(458,'N3',9,'2013-10-13 07:42:28'),(459,'N1',10,'2013-10-27 08:42:28'),(460,'N2',1,'2013-10-20 09:42:28'),(461,'N3',2,'2013-10-17 10:42:28'),(462,'N1',3,'2013-10-19 13:42:28'),(463,'N2',4,'2013-10-10 14:42:28'),(464,'N3',5,'2013-10-25 15:42:28'),(465,'N1',6,'2013-10-24 16:42:28'),(466,'N2',7,'2013-10-03 17:42:28'),(467,'N3',8,'2013-10-08 18:42:28'),(468,'N1',9,'2013-10-19 19:42:28'),(469,'N2',10,'2013-10-07 20:42:28'),(470,'N3',1,'2013-10-28 21:42:28'),(471,'N1',2,'2013-10-04 22:42:28'),(472,'N2',3,'2013-10-24 23:42:28'),(473,'N3',4,'2013-10-09 00:42:28'),(474,'N1',5,'2013-10-20 01:42:28'),(475,'N2',6,'2013-10-17 02:42:28'),(476,'N3',7,'2013-10-09 03:42:28'),(477,'N1',8,'2013-10-03 04:42:28'),(478,'N2',9,'2013-10-13 05:42:28'),(479,'N3',10,'2013-10-03 06:42:28'),(480,'N1',1,'2013-10-25 07:42:28'),(481,'N2',2,'2013-10-20 08:42:28'),(482,'N3',3,'2013-10-15 09:42:28'),(483,'N1',4,'2013-10-24 10:42:28'),(484,'N2',5,'2013-10-29 13:42:28'),(485,'N3',6,'2013-10-04 14:42:28'),(486,'N1',7,'2013-10-09 15:42:28'),(487,'N2',8,'2013-10-20 16:42:28'),(488,'N3',9,'2013-10-15 17:42:28'),(489,'N1',10,'2013-10-01 18:42:28'),(490,'N2',1,'2013-10-03 19:42:28'),(491,'N3',2,'2013-10-22 20:42:28'),(492,'N1',3,'2013-10-13 21:42:28'),(493,'N2',4,'2013-10-19 22:42:28'),(494,'N3',5,'2013-10-20 23:42:28'),(495,'N1',6,'2013-10-05 00:42:28'),(496,'N2',7,'2013-10-02 01:42:28'),(497,'N3',8,'2013-10-17 02:42:28'),(498,'N1',9,'2013-10-06 03:42:28'),(499,'N2',10,'2013-10-07 04:42:28'),(500,'N3',1,'2013-10-24 05:42:28'),(501,'N1',2,'2013-10-21 06:42:28'),(502,'N2',3,'2013-10-29 07:42:28'),(503,'N3',4,'2013-10-21 08:42:28'),(504,'N1',5,'2013-10-22 09:42:28'),(505,'N2',6,'2013-10-21 10:42:28'),(506,'N3',7,'2013-10-24 13:42:28'),(507,'N1',8,'2013-10-07 14:42:28'),(508,'N2',9,'2013-10-09 15:42:28'),(509,'N3',10,'2013-10-11 16:42:28'),(510,'N1',1,'2013-10-19 17:42:28'),(511,'N2',2,'2013-10-12 18:42:28'),(512,'N3',3,'2013-10-03 19:42:28'),(513,'N1',4,'2013-10-25 20:42:28'),(514,'N2',5,'2013-10-04 21:42:28'),(515,'N3',6,'2013-10-18 22:42:28'),(516,'N1',7,'2013-10-08 23:42:28'),(517,'N2',8,'2013-10-17 00:42:28'),(518,'N3',9,'2013-10-20 01:42:28'),(519,'N1',10,'2013-10-22 02:42:28'),(520,'N2',1,'2013-10-24 03:42:28'),(521,'N3',2,'2013-10-07 04:42:28'),(522,'N1',3,'2013-10-19 05:42:28'),(523,'N2',4,'2013-10-28 06:42:28'),(524,'N3',5,'2013-10-10 07:42:28'),(525,'N1',6,'2013-10-10 08:42:28'),(526,'N2',7,'2013-10-10 09:42:28'),(527,'N3',8,'2013-10-30 10:42:28'),(528,'N1',9,'2013-10-11 13:42:28'),(529,'N2',10,'2013-10-22 14:42:28'),(530,'N3',1,'2013-10-12 15:42:28'),(531,'N1',2,'2013-10-02 16:42:28'),(532,'N2',3,'2013-10-07 17:42:28'),(533,'N3',4,'2013-10-16 18:42:28'),(534,'N1',5,'2013-10-15 19:42:28'),(535,'N2',6,'2013-10-15 20:42:28'),(536,'N3',7,'2013-10-13 21:42:28'),(537,'N1',8,'2013-10-11 22:42:28'),(538,'N2',9,'2013-10-09 23:42:28'),(539,'N3',10,'2013-10-07 00:42:28'),(540,'N1',1,'2013-10-05 01:42:28'),(541,'N2',2,'2013-10-10 02:42:28'),(542,'N3',3,'2013-10-21 03:42:28'),(543,'N1',4,'2013-10-15 04:42:28'),(544,'N2',5,'2013-10-12 05:42:28'),(545,'N3',6,'2013-10-16 06:42:28'),(546,'N1',7,'2013-10-04 07:42:28'),(547,'N2',8,'2013-10-12 08:42:28'),(548,'N3',9,'2013-10-20 09:42:28'),(549,'N1',10,'2013-10-12 10:42:28'),(550,'N2',1,'2013-10-17 13:42:28'),(551,'N3',2,'2013-10-22 14:42:28'),(552,'N1',3,'2013-10-26 15:42:28'),(553,'N2',4,'2013-10-29 16:42:28'),(554,'N3',5,'2013-10-12 17:42:28'),(555,'N1',6,'2013-10-13 18:42:28'),(556,'N2',7,'2013-10-06 19:42:28'),(557,'N3',8,'2013-10-18 20:42:28'),(558,'N1',9,'2013-10-12 21:42:28'),(559,'N2',10,'2013-10-02 22:42:28'),(560,'N3',1,'2013-10-03 23:42:28'),(561,'N1',2,'2013-10-27 00:42:28'),(562,'N2',3,'2013-10-23 01:42:28'),(563,'N3',4,'2013-10-17 02:42:28'),(564,'N1',5,'2013-10-23 03:42:28'),(565,'N2',6,'2013-10-03 04:42:28'),(566,'N3',7,'2013-10-26 05:42:28'),(567,'N1',8,'2013-10-05 06:42:28'),(568,'N2',9,'2013-10-06 07:42:28'),(569,'N3',10,'2013-10-09 08:42:28'),(570,'N1',1,'2013-10-15 09:42:28'),(571,'N2',2,'2013-10-07 10:42:28'),(572,'N3',3,'2013-10-21 13:42:28'),(573,'N1',4,'2013-10-16 14:42:28'),(574,'N2',5,'2013-10-13 15:42:28'),(575,'N3',6,'2013-10-04 16:42:28'),(576,'N1',7,'2013-10-26 17:42:28'),(577,'N2',8,'2013-10-24 18:42:28'),(578,'N3',9,'2013-10-27 19:42:28'),(579,'N1',10,'2013-10-25 20:42:28'),(580,'N2',1,'2013-10-16 21:42:28'),(581,'N3',2,'2013-10-08 22:42:28'),(582,'N1',3,'2013-10-15 23:42:28'),(583,'N2',4,'2013-10-29 00:42:28'),(584,'N3',5,'2013-10-06 01:42:28'),(585,'N1',6,'2013-10-04 02:42:28'),(586,'N2',7,'2013-10-28 03:42:28'),(587,'N3',8,'2013-10-25 04:42:28'),(588,'N1',9,'2013-10-10 05:42:28'),(589,'N2',10,'2013-10-07 06:42:28'),(590,'N3',1,'2013-10-27 07:42:28'),(591,'N1',2,'2013-10-19 08:42:28'),(592,'N2',3,'2013-10-19 09:42:28'),(593,'N3',4,'2013-10-29 10:42:28'),(594,'N1',5,'2013-10-10 13:42:28'),(595,'N2',6,'2013-10-27 14:42:28'),(596,'N3',7,'2013-10-19 15:42:28'),(597,'N1',8,'2013-10-10 16:42:28'),(598,'N2',9,'2013-10-24 17:42:28'),(599,'N3',10,'2013-10-28 18:42:28'),(600,'N1',1,'2013-10-29 19:42:28'),(601,'N2',2,'2013-10-03 20:42:28'),(602,'N3',3,'2013-10-15 21:42:28'),(603,'N1',4,'2013-10-14 22:42:28'),(604,'N2',5,'2013-10-17 23:42:28'),(605,'N3',6,'2013-10-07 00:42:28'),(606,'N1',7,'2013-10-09 01:42:28'),(607,'N2',8,'2013-10-17 02:42:28'),(608,'N3',9,'2013-10-18 03:42:28'),(609,'N1',10,'2013-10-24 04:42:28'),(610,'N2',1,'2013-10-25 05:42:28'),(611,'N3',2,'2013-10-05 06:42:28'),(612,'N1',3,'2013-10-16 07:42:28'),(613,'N2',4,'2013-10-04 08:42:28'),(614,'N3',5,'2013-10-08 09:42:28'),(615,'N1',6,'2013-10-13 10:42:28'),(616,'N2',7,'2013-10-06 13:42:28'),(617,'N3',8,'2013-10-20 14:42:28'),(618,'N1',9,'2013-10-08 15:42:28'),(619,'N2',10,'2013-10-19 16:42:28'),(620,'N3',1,'2013-10-26 17:42:28'),(621,'N1',2,'2013-10-16 18:42:28'),(622,'N2',3,'2013-10-18 19:42:28'),(623,'N3',4,'2013-10-24 20:42:28'),(624,'N1',5,'2013-10-13 21:42:28'),(625,'N2',6,'2013-10-17 22:42:28'),(626,'N3',7,'2013-10-10 23:42:28'),(627,'N1',8,'2013-10-03 00:42:28'),(628,'N2',9,'2013-10-03 01:42:28'),(629,'N3',10,'2013-10-14 02:42:28'),(630,'N1',1,'2013-10-11 03:42:28'),(631,'N2',2,'2013-10-22 04:42:28'),(632,'N3',3,'2013-10-26 05:42:28'),(633,'N1',4,'2013-10-05 06:42:28'),(634,'N2',5,'2013-10-09 07:42:28'),(635,'N3',6,'2013-10-10 08:42:28'),(636,'N1',7,'2013-10-07 09:42:28'),(637,'N2',8,'2013-10-14 10:42:28'),(638,'N3',9,'2013-10-29 13:42:28'),(639,'N1',10,'2013-10-27 14:42:28'),(640,'N2',1,'2013-10-22 15:42:28'),(641,'N3',2,'2013-10-19 16:42:28'),(642,'N1',3,'2013-10-17 17:42:28'),(643,'N2',4,'2013-10-19 18:42:28'),(644,'N3',5,'2013-10-19 19:42:28'),(645,'N1',6,'2013-10-25 20:42:28'),(646,'N2',7,'2013-10-22 21:42:28'),(647,'N3',8,'2013-10-11 22:42:28'),(648,'N1',9,'2013-10-26 23:42:28'),(649,'N2',10,'2013-10-10 00:42:28'),(650,'N3',1,'2013-10-13 01:42:28'),(651,'N1',2,'2013-10-08 02:42:28'),(652,'N2',3,'2013-10-30 03:42:28'),(653,'N3',4,'2013-10-29 04:42:28'),(654,'N1',5,'2013-10-12 05:42:28'),(655,'N2',6,'2013-10-23 06:42:28'),(656,'N3',7,'2013-10-05 07:42:28'),(657,'N1',8,'2013-10-21 08:42:28'),(658,'N2',9,'2013-10-08 09:42:28'),(659,'N3',10,'2013-10-23 10:42:28'),(660,'N1',1,'2013-10-13 13:42:28'),(661,'N2',2,'2013-10-16 14:42:28'),(662,'N3',3,'2013-10-26 15:42:28'),(663,'N1',4,'2013-10-01 16:42:28'),(664,'N2',5,'2013-10-09 17:42:28'),(665,'N3',6,'2013-10-14 18:42:28'),(666,'N1',7,'2013-10-15 19:42:28'),(667,'N2',8,'2013-10-29 20:42:28'),(668,'N3',9,'2013-10-15 21:42:28'),(669,'N1',10,'2013-10-07 22:42:28'),(670,'N2',1,'2013-10-03 23:42:28'),(671,'N3',2,'2013-10-20 00:42:28'),(672,'N1',3,'2013-10-12 01:42:28'),(673,'N2',4,'2013-10-13 02:42:28'),(674,'N3',5,'2013-10-23 03:42:28'),(675,'N1',6,'2013-10-25 04:42:28'),(676,'N2',7,'2013-10-07 05:42:28'),(677,'N3',8,'2013-10-11 06:42:28'),(678,'N1',9,'2013-10-24 07:42:28'),(679,'N2',10,'2013-10-07 08:42:28'),(680,'N3',1,'2013-10-14 09:42:28'),(681,'N1',2,'2013-10-03 10:42:28'),(682,'N2',3,'2013-10-07 13:42:28'),(683,'N3',4,'2013-10-15 14:42:28'),(684,'N1',5,'2013-10-28 15:42:28'),(685,'N2',6,'2013-10-05 16:42:28'),(686,'N3',7,'2013-10-11 17:42:28'),(687,'N1',8,'2013-10-15 18:42:28'),(688,'N2',9,'2013-10-09 19:42:28'),(689,'N3',10,'2013-10-04 20:42:28'),(690,'N1',1,'2013-10-27 21:42:28'),(691,'N2',2,'2013-10-02 22:42:28'),(692,'N3',3,'2013-10-10 23:42:28'),(693,'N1',4,'2013-10-18 00:42:28'),(694,'N2',5,'2013-10-22 01:42:28'),(695,'N3',6,'2013-10-04 02:42:28'),(696,'N1',7,'2013-10-04 03:42:28'),(697,'N2',8,'2013-10-05 04:42:28'),(698,'N3',9,'2013-10-08 05:42:28'),(699,'N1',10,'2013-10-23 06:42:28'),(700,'N2',1,'2013-10-24 07:42:28'),(701,'N3',2,'2013-10-17 08:42:28'),(702,'N1',3,'2013-10-03 09:42:28'),(703,'N2',4,'2013-10-23 10:42:28'),(704,'N3',5,'2013-10-08 13:42:28'),(705,'N1',6,'2013-10-23 14:42:28'),(706,'N2',7,'2013-10-07 15:42:28'),(707,'N3',8,'2013-10-13 16:42:28'),(708,'N1',9,'2013-10-13 17:42:28'),(709,'N2',10,'2013-10-17 18:42:28'),(710,'N3',1,'2013-10-01 19:42:28'),(711,'N1',2,'2013-10-28 20:42:28'),(712,'N2',3,'2013-10-27 21:42:28'),(713,'N3',4,'2013-10-02 22:42:28'),(714,'N1',5,'2013-10-08 23:42:28'),(715,'N2',6,'2013-10-09 00:42:28'),(716,'N3',7,'2013-10-13 01:42:28'),(717,'N1',8,'2013-10-28 02:42:28'),(718,'N2',9,'2013-10-19 03:42:28'),(719,'N3',10,'2013-10-24 04:42:28'),(720,'N1',1,'2013-10-12 05:42:28'),(721,'N2',2,'2013-10-22 06:42:28'),(722,'N3',3,'2013-10-14 07:42:28'),(723,'N1',4,'2013-10-09 08:42:28'),(724,'N2',5,'2013-10-09 09:42:28'),(725,'N3',6,'2013-10-30 10:42:28'),(726,'N1',7,'2013-10-15 13:42:28'),(727,'N2',8,'2013-10-23 14:42:28'),(728,'N3',9,'2013-10-14 15:42:28'),(729,'N1',10,'2013-10-22 16:42:28'),(730,'N2',1,'2013-10-12 17:42:28'),(731,'N3',2,'2013-10-02 18:42:28'),(732,'N1',3,'2013-10-18 19:42:28'),(733,'N2',4,'2013-10-20 20:42:28'),(734,'N3',5,'2013-10-05 21:42:28'),(735,'N1',6,'2013-10-10 22:42:28'),(736,'N2',7,'2013-10-21 23:42:28'),(737,'N3',8,'2013-10-08 00:42:28'),(738,'N1',9,'2013-10-02 01:42:28'),(739,'N2',10,'2013-10-23 02:42:28'),(740,'N3',1,'2013-10-24 03:42:28'),(741,'N1',2,'2013-10-27 04:42:28'),(742,'N2',3,'2013-10-05 05:42:28'),(743,'N3',4,'2013-10-29 06:42:28'),(744,'N1',5,'2013-10-21 07:42:28'),(745,'N2',6,'2013-10-05 08:42:28'),(746,'N3',7,'2013-10-12 09:42:28'),(747,'N1',8,'2013-10-22 10:42:28'),(748,'N2',9,'2013-10-13 13:42:28'),(749,'N3',10,'2013-10-05 14:42:28'),(750,'N1',1,'2013-10-25 15:42:28'),(751,'N2',2,'2013-10-21 16:42:28'),(752,'N3',3,'2013-10-01 17:42:28'),(753,'N1',4,'2013-10-16 18:42:28'),(754,'N2',5,'2013-10-24 19:42:28'),(755,'N3',6,'2013-10-25 20:42:28'),(756,'N1',7,'2013-10-03 21:42:28'),(757,'N2',8,'2013-10-23 22:42:28'),(758,'N3',9,'2013-10-09 23:42:28'),(759,'N1',10,'2013-10-29 00:42:28'),(760,'N2',1,'2013-10-30 01:42:28'),(761,'N3',2,'2013-10-11 02:42:28'),(762,'N1',3,'2013-10-26 03:42:28'),(763,'N2',4,'2013-10-13 04:42:28'),(764,'N3',5,'2013-10-05 05:42:28'),(765,'N1',6,'2013-10-23 06:42:28'),(766,'N2',7,'2013-10-13 07:42:28'),(767,'N3',8,'2013-10-18 08:42:28'),(768,'N1',9,'2013-10-12 09:42:28'),(769,'N2',10,'2013-10-17 10:42:28'),(770,'N3',1,'2013-10-29 13:42:28'),(771,'N1',2,'2013-10-13 14:42:28'),(772,'N2',3,'2013-10-05 15:42:28'),(773,'N3',4,'2013-10-01 16:42:28'),(774,'N1',5,'2013-10-15 17:42:28'),(775,'N2',6,'2013-10-23 18:42:28'),(776,'N3',7,'2013-10-16 19:42:28'),(777,'N1',8,'2013-10-23 20:42:28'),(778,'N2',9,'2013-10-26 21:42:28'),(779,'N3',10,'2013-10-29 22:42:28'),(780,'N1',1,'2013-10-02 23:42:28'),(781,'N2',2,'2013-10-30 00:42:28'),(782,'N3',3,'2013-10-19 01:42:28'),(783,'N1',4,'2013-10-17 02:42:28'),(784,'N2',5,'2013-10-12 03:42:28'),(785,'N3',6,'2013-10-12 04:42:28'),(786,'N1',7,'2013-10-07 05:42:28'),(787,'N2',8,'2013-10-20 06:42:28'),(788,'N3',9,'2013-10-15 07:42:28'),(789,'N1',10,'2013-10-22 08:42:28'),(790,'N2',1,'2013-10-17 09:42:28'),(791,'N3',2,'2013-10-04 10:42:28'),(792,'N1',3,'2013-10-18 13:42:28'),(793,'N2',4,'2013-10-10 14:42:28'),(794,'N3',5,'2013-10-12 15:42:28'),(795,'N1',6,'2013-10-26 16:42:28'),(796,'N2',7,'2013-10-25 17:42:28'),(797,'N3',8,'2013-10-21 18:42:28'),(798,'N1',9,'2013-10-18 19:42:28'),(799,'N2',10,'2013-10-25 20:42:28'),(800,'N3',1,'2013-10-10 21:42:28'),(801,'N1',2,'2013-10-07 22:42:28'),(802,'N2',3,'2013-10-09 23:42:28'),(803,'N3',4,'2013-10-07 00:42:28'),(804,'N1',5,'2013-10-19 01:42:28'),(805,'N2',6,'2013-10-15 02:42:28'),(806,'N3',7,'2013-10-24 03:42:28'),(807,'N1',8,'2013-10-11 04:42:28'),(808,'N2',9,'2013-10-22 05:42:28'),(809,'N3',10,'2013-10-08 06:42:28'),(810,'N1',1,'2013-10-23 07:42:28'),(811,'N2',2,'2013-10-08 08:42:28'),(812,'N3',3,'2013-10-24 09:42:28'),(813,'N1',4,'2013-10-12 10:42:28'),(814,'N2',5,'2013-10-15 13:42:28'),(815,'N3',6,'2013-10-07 14:42:28'),(816,'N1',7,'2013-10-01 15:42:28'),(817,'N2',8,'2013-10-12 16:42:28'),(818,'N3',9,'2013-10-04 17:42:28'),(819,'N1',10,'2013-10-14 18:42:28'),(820,'N2',1,'2013-10-17 19:42:28'),(821,'N3',2,'2013-10-27 20:42:28'),(822,'N1',3,'2013-10-16 21:42:28'),(823,'N2',4,'2013-10-25 22:42:28'),(824,'N3',5,'2013-10-29 23:42:28'),(825,'N1',6,'2013-10-29 00:42:28'),(826,'N2',7,'2013-10-11 01:42:28'),(827,'N3',8,'2013-10-16 02:42:28'),(828,'N1',9,'2013-10-04 03:42:28'),(829,'N2',10,'2013-10-09 04:42:28'),(830,'N3',1,'2013-10-04 05:42:28'),(831,'N1',2,'2013-10-28 06:42:28'),(832,'N2',3,'2013-10-11 07:42:28'),(833,'N3',4,'2013-10-15 08:42:28'),(834,'N1',5,'2013-10-25 09:42:28'),(835,'N2',6,'2013-10-06 10:42:28'),(836,'N3',7,'2013-10-06 13:42:28'),(837,'N1',8,'2013-10-06 14:42:28'),(838,'N2',9,'2013-10-05 15:42:28'),(839,'N3',10,'2013-10-14 16:42:28'),(840,'N1',1,'2013-10-10 17:42:28'),(841,'N2',2,'2013-10-02 18:42:28'),(842,'N3',3,'2013-10-08 19:42:28'),(843,'N1',4,'2013-10-24 20:42:28'),(844,'N2',5,'2013-10-19 21:42:28'),(845,'N3',6,'2013-10-19 22:42:28'),(846,'N1',7,'2013-10-25 23:42:28'),(847,'N2',8,'2013-10-21 00:42:28'),(848,'N3',9,'2013-10-18 01:42:28'),(849,'N1',10,'2013-10-14 02:42:28'),(850,'N2',1,'2013-10-07 03:42:28'),(851,'N3',2,'2013-10-26 04:42:28'),(852,'N1',3,'2013-10-04 05:42:28'),(853,'N2',4,'2013-10-23 06:42:28'),(854,'N3',5,'2013-10-04 07:42:28'),(855,'N1',6,'2013-10-12 08:42:28'),(856,'N2',7,'2013-10-25 09:42:28'),(857,'N3',8,'2013-10-24 10:42:28'),(858,'N1',9,'2013-10-02 13:42:28'),(859,'N2',10,'2013-10-11 14:42:28'),(860,'N3',1,'2013-10-13 15:42:28'),(861,'N1',2,'2013-10-09 16:42:28'),(862,'N2',3,'2013-10-03 17:42:28'),(863,'N3',4,'2013-10-24 18:42:28'),(864,'N1',5,'2013-10-17 19:42:28'),(865,'N2',6,'2013-10-11 20:42:28'),(866,'N3',7,'2013-10-25 21:42:28'),(867,'N1',8,'2013-10-29 22:42:28'),(868,'N2',9,'2013-10-01 23:42:28'),(869,'N3',10,'2013-10-17 00:42:28'),(870,'N1',1,'2013-10-07 01:42:28'),(871,'N2',2,'2013-10-12 02:42:28'),(872,'N3',3,'2013-10-29 03:42:28'),(873,'N1',4,'2013-10-23 04:42:28'),(874,'N2',5,'2013-10-20 05:42:28'),(875,'N3',6,'2013-10-21 06:42:28'),(876,'N1',7,'2013-10-14 07:42:28'),(877,'N2',8,'2013-10-22 08:42:28'),(878,'N3',9,'2013-10-13 09:42:28'),(879,'N1',10,'2013-10-17 10:42:28'),(880,'N2',1,'2013-10-13 13:42:28'),(881,'N3',2,'2013-10-27 14:42:28'),(882,'N1',3,'2013-10-27 15:42:28'),(883,'N2',4,'2013-10-01 16:42:28'),(884,'N3',5,'2013-10-15 17:42:28'),(885,'N1',6,'2013-10-17 18:42:28'),(886,'N2',7,'2013-10-12 19:42:28'),(887,'N3',8,'2013-10-12 20:42:28'),(888,'N1',9,'2013-10-25 21:42:28'),(889,'N2',10,'2013-10-14 22:42:28'),(890,'N3',1,'2013-10-29 23:42:28'),(891,'N1',2,'2013-10-08 00:42:28'),(892,'N2',3,'2013-10-20 01:42:28'),(893,'N3',4,'2013-10-18 02:42:28'),(894,'N1',5,'2013-10-29 03:42:28'),(895,'N2',6,'2013-10-11 04:42:28'),(896,'N3',7,'2013-10-11 05:42:28'),(897,'N1',8,'2013-10-06 06:42:28'),(898,'N2',9,'2013-10-04 07:42:28'),(899,'N3',10,'2013-10-27 08:42:28'),(900,'N1',1,'2013-10-25 09:42:28'),(901,'N2',2,'2013-10-13 10:42:28'),(902,'N3',3,'2013-10-28 13:42:28'),(903,'N1',4,'2013-10-23 14:42:28'),(904,'N2',5,'2013-10-20 15:42:28'),(905,'N3',6,'2013-10-21 16:42:28'),(906,'N1',7,'2013-10-08 17:42:28'),(907,'N2',8,'2013-10-07 18:42:28'),(908,'N3',9,'2013-10-29 19:42:28'),(909,'N1',10,'2013-10-01 20:42:28'),(910,'N2',1,'2013-10-15 21:42:28'),(911,'N3',2,'2013-10-08 22:42:28'),(912,'N1',3,'2013-10-18 23:42:28'),(913,'N2',4,'2013-10-16 00:42:28'),(914,'N3',5,'2013-10-24 01:42:28'),(915,'N1',6,'2013-10-10 02:42:28'),(916,'N2',7,'2013-10-17 03:42:28'),(917,'N3',8,'2013-10-11 04:42:28'),(918,'N1',9,'2013-10-03 05:42:28'),(919,'N2',10,'2013-10-30 06:42:28'),(920,'N3',1,'2013-10-23 07:42:28'),(921,'N1',2,'2013-10-28 08:42:28'),(922,'N2',3,'2013-10-22 09:42:28'),(923,'N3',4,'2013-10-14 10:42:28'),(924,'N1',5,'2013-10-17 13:42:28'),(925,'N2',6,'2013-10-11 14:42:28'),(926,'N3',7,'2013-10-03 15:42:28'),(927,'N1',8,'2013-10-17 16:42:28'),(928,'N2',9,'2013-10-05 17:42:28'),(929,'N3',10,'2013-10-25 18:42:28'),(930,'N1',1,'2013-10-26 19:42:28'),(931,'N2',2,'2013-10-01 20:42:28'),(932,'N3',3,'2013-10-08 21:42:28'),(933,'N1',4,'2013-10-17 22:42:28'),(934,'N2',5,'2013-10-01 23:42:28'),(935,'N3',6,'2013-10-27 00:42:28'),(936,'N1',7,'2013-10-03 01:42:28'),(937,'N2',8,'2013-10-13 02:42:28'),(938,'N3',9,'2013-10-25 03:42:28'),(939,'N1',10,'2013-10-02 04:42:28'),(940,'N2',1,'2013-10-29 05:42:28'),(941,'N3',2,'2013-10-11 06:42:28'),(942,'N1',3,'2013-10-12 07:42:28'),(943,'N2',4,'2013-10-09 08:42:28'),(944,'N3',5,'2013-10-02 09:42:28'),(945,'N1',6,'2013-10-26 10:42:28'),(946,'N2',7,'2013-10-19 13:42:28'),(947,'N3',8,'2013-10-12 14:42:28'),(948,'N1',9,'2013-10-26 15:42:28'),(949,'N2',10,'2013-10-26 16:42:28'),(950,'N3',1,'2013-10-18 17:42:28'),(951,'N1',2,'2013-10-04 18:42:28'),(952,'N2',3,'2013-10-12 19:42:28'),(953,'N3',4,'2013-10-17 20:42:28'),(954,'N1',5,'2013-10-12 21:42:28'),(955,'N2',6,'2013-10-29 22:42:28'),(956,'N3',7,'2013-10-19 23:42:28'),(957,'N1',8,'2013-10-22 00:42:28'),(958,'N2',9,'2013-10-21 01:42:28'),(959,'N3',10,'2013-10-28 02:42:28'),(960,'N1',1,'2013-10-08 03:42:28'),(961,'N2',2,'2013-10-09 04:42:28'),(962,'N3',3,'2013-10-23 05:42:28'),(963,'N1',4,'2013-10-07 06:42:28'),(964,'N2',5,'2013-10-04 07:42:28'),(965,'N3',6,'2013-10-14 08:42:28'),(966,'N1',7,'2013-10-08 09:42:28'),(967,'N2',8,'2013-10-03 10:42:28'),(968,'N3',9,'2013-10-22 13:42:28'),(969,'N1',10,'2013-10-25 14:42:28'),(970,'N2',1,'2013-10-27 15:42:28'),(971,'N3',2,'2013-10-06 16:42:28'),(972,'N1',3,'2013-10-19 17:42:28'),(973,'N2',4,'2013-10-28 18:42:28'),(974,'N3',5,'2013-10-21 19:42:28'),(975,'N1',6,'2013-10-12 20:42:28'),(976,'N2',7,'2013-10-29 21:42:28'),(977,'N3',8,'2013-10-18 22:42:28'),(978,'N1',9,'2013-10-07 23:42:28'),(979,'N2',10,'2013-10-14 00:42:28'),(980,'N3',1,'2013-10-10 01:42:28'),(981,'N1',2,'2013-10-27 02:42:28'),(982,'N2',3,'2013-10-05 03:42:28'),(983,'N3',4,'2013-10-27 04:42:28'),(984,'N1',5,'2013-10-16 05:42:28'),(985,'N2',6,'2013-10-27 06:42:28'),(986,'N3',7,'2013-10-17 07:42:28'),(987,'N1',8,'2013-10-24 08:42:28'),(988,'N2',9,'2013-10-06 09:42:28'),(989,'N3',10,'2013-10-22 10:42:28'),(990,'N1',1,'2013-10-04 13:42:28'),(991,'N2',2,'2013-10-26 14:42:28'),(992,'N3',3,'2013-10-27 15:42:28'),(993,'N1',4,'2013-10-28 16:42:28'),(994,'N2',5,'2013-10-28 17:42:28'),(995,'N3',6,'2013-10-21 18:42:28'),(996,'N1',7,'2013-10-03 19:42:28'),(997,'N2',8,'2013-10-26 20:42:28'),(998,'N3',9,'2013-10-10 21:42:28'),(999,'N1',10,'2013-10-05 22:42:28'),(1000,'N2',1,'2013-10-27 23:42:28'),(1001,'N3',2,'2013-10-07 00:42:28'),(1002,'N1',3,'2013-10-25 01:42:28'),(1003,'N2',4,'2013-10-27 02:42:28'),(1004,'N3',5,'2013-10-13 03:42:28'),(1005,'N1',6,'2013-10-13 04:42:28'),(1006,'N2',7,'2013-10-15 05:42:28'),(1007,'N3',8,'2013-10-23 06:42:28'),(1008,'N1',9,'2013-10-26 07:42:28'),(1009,'N2',10,'2013-10-21 08:42:28'),(1010,'N3',1,'2013-10-05 09:42:28'),(1011,'N1',2,'2013-10-21 10:42:28'),(1012,'N2',3,'2013-10-22 13:42:28'),(1013,'N3',4,'2013-10-21 14:42:28'),(1014,'N1',5,'2013-10-29 15:42:28'),(1015,'N2',6,'2013-10-22 16:42:28'),(1016,'N3',7,'2013-10-08 17:42:28'),(1017,'N1',8,'2013-10-07 18:42:28'),(1018,'N2',9,'2013-10-22 19:42:28'),(1019,'N3',10,'2013-10-07 20:42:28'),(1020,'N1',1,'2013-10-16 21:42:28'),(1021,'N2',2,'2013-10-03 22:42:28'),(1022,'N3',3,'2013-10-06 23:42:28'),(1023,'N1',4,'2013-10-26 00:42:28'),(1024,'N2',5,'2013-10-18 01:42:28'),(1025,'N3',6,'2013-10-21 02:42:28'),(1026,'N1',7,'2013-10-20 03:42:28'),(1027,'N2',8,'2013-10-17 04:42:28'),(1028,'N3',9,'2013-10-16 05:42:28'),(1029,'N1',10,'2013-10-14 06:42:28'),(1030,'N2',1,'2013-10-29 07:42:28'),(1031,'N3',2,'2013-10-27 08:42:28'),(1032,'N1',3,'2013-10-10 09:42:28'),(1033,'N2',4,'2013-10-25 10:42:28'),(1034,'N3',5,'2013-10-17 13:42:28'),(1035,'N1',6,'2013-10-23 14:42:28'),(1036,'N2',7,'2013-10-24 15:42:28'),(1037,'N3',8,'2013-10-27 16:42:28'),(1038,'N1',9,'2013-10-28 17:42:28'),(1039,'N2',10,'2013-10-18 18:42:28'),(1040,'N3',1,'2013-10-01 19:42:28'),(1041,'N1',2,'2013-10-18 20:42:28'),(1042,'N2',3,'2013-10-26 21:42:28'),(1043,'N3',4,'2013-10-03 22:42:28'),(1044,'N1',5,'2013-10-27 23:42:28'),(1045,'N2',6,'2013-10-29 00:42:28'),(1046,'N3',7,'2013-10-06 01:42:28'),(1047,'N1',8,'2013-10-02 02:42:28'),(1048,'N2',9,'2013-10-14 03:42:28'),(1049,'N3',10,'2013-10-02 04:42:28'),(1050,'N1',1,'2013-10-02 05:42:28'),(1051,'N2',2,'2013-10-06 06:42:28'),(1052,'N3',3,'2013-10-22 07:42:28'),(1053,'N1',4,'2013-10-05 08:42:28'),(1054,'N2',5,'2013-10-03 09:42:28'),(1055,'N3',6,'2013-10-10 10:42:28'),(1056,'N1',7,'2013-10-20 13:42:28'),(1057,'N2',8,'2013-10-03 14:42:28'),(1058,'N3',9,'2013-10-29 15:42:28'),(1059,'N1',10,'2013-10-20 16:42:28'),(1060,'N2',1,'2013-10-20 17:42:28'),(1061,'N3',2,'2013-10-23 18:42:28'),(1062,'N1',3,'2013-10-01 19:42:28'),(1063,'N2',4,'2013-10-13 20:42:28'),(1064,'N3',5,'2013-10-07 21:42:28'),(1065,'N1',6,'2013-10-12 22:42:28'),(1066,'N2',7,'2013-10-07 23:42:28'),(1067,'N3',8,'2013-10-10 00:42:28'),(1068,'N1',9,'2013-10-15 01:42:28'),(1069,'N2',10,'2013-10-16 02:42:28'),(1070,'N3',1,'2013-10-05 03:42:28'),(1071,'N1',2,'2013-10-19 04:42:28'),(1072,'N2',3,'2013-10-06 05:42:28'),(1073,'N3',4,'2013-10-16 06:42:28'),(1074,'N1',5,'2013-10-08 07:42:28'),(1075,'N2',6,'2013-10-20 08:42:28'),(1076,'N3',7,'2013-10-29 09:42:28'),(1077,'N1',8,'2013-10-22 10:42:28'),(1078,'N2',9,'2013-10-17 13:42:28'),(1079,'N3',10,'2013-10-24 14:42:28'),(1080,'N1',1,'2013-10-18 15:42:28'),(1081,'N2',2,'2013-10-24 16:42:28'),(1082,'N3',3,'2013-10-04 17:42:28'),(1083,'N1',4,'2013-10-24 18:42:28'),(1084,'N2',5,'2013-10-07 19:42:28'),(1085,'N3',6,'2013-10-18 20:42:28'),(1086,'N1',7,'2013-10-26 21:42:28'),(1087,'N2',8,'2013-10-01 22:42:28'),(1088,'N3',9,'2013-10-04 23:42:28'),(1089,'N1',10,'2013-10-16 00:42:28'),(1090,'N2',1,'2013-10-23 01:42:28'),(1091,'N3',2,'2013-10-25 02:42:28'),(1092,'N1',3,'2013-10-27 03:42:28'),(1093,'N2',4,'2013-10-06 04:42:28'),(1094,'N3',5,'2013-10-02 05:42:28'),(1095,'N1',6,'2013-10-16 06:42:28'),(1096,'N2',7,'2013-10-08 07:42:28'),(1097,'N3',8,'2013-10-12 08:42:28'),(1098,'N1',9,'2013-10-13 09:42:28'),(1099,'N2',10,'2013-10-18 10:42:28'),(1100,'N3',1,'2013-10-29 13:42:28'),(1101,'N1',2,'2013-10-05 14:42:28'),(1102,'N2',3,'2013-10-06 15:42:28'),(1103,'N3',4,'2013-10-13 16:42:28'),(1104,'N1',5,'2013-10-16 17:42:28'),(1105,'N2',6,'2013-10-28 18:42:28'),(1106,'N3',7,'2013-10-23 19:42:28'),(1107,'N1',8,'2013-10-07 20:42:28'),(1108,'N2',9,'2013-10-16 21:42:28'),(1109,'N3',10,'2013-10-13 22:42:28'),(1110,'N1',1,'2013-10-18 23:42:28'),(1111,'N2',2,'2013-10-28 00:42:28'),(1112,'N3',3,'2013-10-24 01:42:28'),(1113,'N1',4,'2013-10-03 02:42:28'),(1114,'N2',5,'2013-10-06 03:42:28'),(1115,'N3',6,'2013-10-06 04:42:28'),(1116,'N1',7,'2013-10-02 05:42:28'),(1117,'N2',8,'2013-10-11 06:42:28'),(1118,'N3',9,'2013-10-13 07:42:28'),(1119,'N1',10,'2013-10-26 08:42:28'),(1120,'N2',1,'2013-10-27 09:42:28'),(1121,'N3',2,'2013-10-02 10:42:28'),(1122,'N1',3,'2013-10-26 13:42:28'),(1123,'N2',4,'2013-10-05 14:42:28'),(1124,'N3',5,'2013-10-12 15:42:28'),(1125,'N1',6,'2013-10-17 16:42:28'),(1126,'N2',7,'2013-10-29 17:42:28'),(1127,'N3',8,'2013-10-12 18:42:28'),(1128,'N1',9,'2013-10-13 19:42:28'),(1129,'N2',10,'2013-10-19 20:42:28'),(1130,'N3',1,'2013-10-29 21:42:28'),(1131,'N1',2,'2013-10-04 22:42:28'),(1132,'N2',3,'2013-10-01 23:42:28'),(1133,'N3',4,'2013-10-11 00:42:28'),(1134,'N1',5,'2013-10-15 01:42:28'),(1135,'N2',6,'2013-10-09 02:42:28'),(1136,'N3',7,'2013-10-30 03:42:28'),(1137,'N1',8,'2013-10-08 04:42:28'),(1138,'N2',9,'2013-10-25 05:42:28'),(1139,'N3',10,'2013-10-15 06:42:28'),(1140,'N1',1,'2013-10-02 07:42:28'),(1141,'N2',2,'2013-10-05 08:42:28'),(1142,'N3',3,'2013-10-05 09:42:28'),(1143,'N1',4,'2013-10-08 10:42:28'),(1144,'N2',5,'2013-10-01 13:42:28'),(1145,'N3',6,'2013-10-26 14:42:28'),(1146,'N1',7,'2013-10-21 15:42:28'),(1147,'N2',8,'2013-10-16 16:42:28'),(1148,'N3',9,'2013-10-26 17:42:28'),(1149,'N1',10,'2013-10-18 18:42:28'),(1150,'N2',1,'2013-10-27 19:42:28'),(1151,'N3',2,'2013-10-13 20:42:28'),(1152,'N1',3,'2013-10-22 21:42:28'),(1153,'N2',4,'2013-10-29 22:42:28'),(1154,'N3',5,'2013-10-16 23:42:28'),(1155,'N1',6,'2013-10-23 00:42:28'),(1156,'N2',7,'2013-10-02 01:42:28'),(1157,'N3',8,'2013-10-23 02:42:28'),(1158,'N1',9,'2013-10-14 03:42:28'),(1159,'N2',10,'2013-10-14 04:42:28'),(1160,'N3',1,'2013-10-19 05:42:28'),(1161,'N1',2,'2013-10-16 06:42:28'),(1162,'N2',3,'2013-10-14 07:42:28'),(1163,'N3',4,'2013-10-11 08:42:28'),(1164,'N1',5,'2013-10-27 09:42:28'),(1165,'N2',6,'2013-10-20 10:42:28'),(1166,'N3',7,'2013-10-10 13:42:28'),(1167,'N1',8,'2013-10-01 14:42:28'),(1168,'N2',9,'2013-10-18 15:42:28'),(1169,'N3',10,'2013-10-26 16:42:28'),(1170,'N1',1,'2013-10-16 17:42:28'),(1171,'N2',2,'2013-10-08 18:42:28'),(1172,'N3',3,'2013-10-27 19:42:28'),(1173,'N1',4,'2013-10-12 20:42:28'),(1174,'N2',5,'2013-10-17 21:42:28'),(1175,'N3',6,'2013-10-08 22:42:28'),(1176,'N1',7,'2013-10-19 23:42:28'),(1177,'N2',8,'2013-10-05 00:42:28'),(1178,'N3',9,'2013-10-22 01:42:28'),(1179,'N1',10,'2013-10-15 02:42:28'),(1180,'N2',1,'2013-10-29 03:42:28'),(1181,'N3',2,'2013-10-05 04:42:28'),(1182,'N1',3,'2013-10-17 05:42:28'),(1183,'N2',4,'2013-10-15 06:42:28'),(1184,'N3',5,'2013-10-17 07:42:28'),(1185,'N1',6,'2013-10-18 08:42:28'),(1186,'N2',7,'2013-10-15 09:42:28'),(1187,'N3',8,'2013-10-19 10:42:28'),(1188,'N1',9,'2013-10-16 13:42:28'),(1189,'N2',10,'2013-10-17 14:42:28'),(1190,'N3',1,'2013-10-16 15:42:28'),(1191,'N1',2,'2013-10-21 16:42:28'),(1192,'N2',3,'2013-10-11 17:42:28'),(1193,'N3',4,'2013-10-27 18:42:28'),(1194,'N1',5,'2013-10-21 19:42:28'),(1195,'N2',6,'2013-10-17 20:42:28'),(1196,'N3',7,'2013-10-01 21:42:28'),(1197,'N1',8,'2013-10-26 22:42:28'),(1198,'N2',9,'2013-10-20 23:42:28'),(1199,'N3',10,'2013-10-13 00:42:28'),(1200,'N1',1,'2013-10-06 01:42:28'),(1201,'N2',2,'2013-10-14 02:42:28'),(1202,'N3',3,'2013-10-08 03:42:28'),(1203,'N1',4,'2013-10-03 04:42:28'),(1204,'N2',5,'2013-10-23 05:42:28'),(1205,'N3',6,'2013-10-05 06:42:28'),(1206,'N1',7,'2013-10-09 07:42:28'),(1207,'N2',8,'2013-10-26 08:42:28'),(1208,'N3',9,'2013-10-09 09:42:28'),(1209,'N1',10,'2013-10-17 10:42:28'),(1210,'N2',1,'2013-10-06 13:42:28'),(1211,'N3',2,'2013-10-22 14:42:28'),(1212,'N1',3,'2013-10-17 15:42:28'),(1213,'N2',4,'2013-10-03 16:42:28'),(1214,'N3',5,'2013-10-16 17:42:28'),(1215,'N1',6,'2013-10-25 18:42:28'),(1216,'N2',7,'2013-10-08 19:42:28'),(1217,'N3',8,'2013-10-20 20:42:28'),(1218,'N1',9,'2013-10-06 21:42:28'),(1219,'N2',10,'2013-10-17 22:42:28'),(1220,'N3',1,'2013-10-19 23:42:28'),(1221,'N1',2,'2013-10-27 00:42:28'),(1222,'N2',3,'2013-10-22 01:42:28'),(1223,'N3',4,'2013-10-29 02:42:28'),(1224,'N1',5,'2013-10-13 03:42:28'),(1225,'N2',6,'2013-10-22 04:42:28'),(1226,'N3',7,'2013-10-03 05:42:28'),(1227,'N1',8,'2013-10-11 06:42:28'),(1228,'N2',9,'2013-10-06 07:42:28'),(1229,'N3',10,'2013-10-07 08:42:28'),(1230,'N1',1,'2013-10-11 09:42:28'),(1231,'N2',2,'2013-10-17 10:42:28'),(1232,'N3',3,'2013-10-12 13:42:28'),(1233,'N1',4,'2013-10-11 14:42:28'),(1234,'N2',5,'2013-10-28 15:42:28'),(1235,'N3',6,'2013-10-22 16:42:28'),(1236,'N1',7,'2013-10-28 17:42:28'),(1237,'N2',8,'2013-10-07 18:42:28'),(1238,'N3',9,'2013-10-06 19:42:28'),(1239,'N1',10,'2013-10-11 20:42:28'),(1240,'N2',1,'2013-10-18 21:42:28'),(1241,'N3',2,'2013-10-19 22:42:28'),(1242,'N1',3,'2013-10-17 23:42:28'),(1243,'N2',4,'2013-10-22 00:42:28'),(1244,'N3',5,'2013-10-09 01:42:28'),(1245,'N1',6,'2013-10-13 02:42:28'),(1246,'N2',7,'2013-10-05 03:42:28'),(1247,'N3',8,'2013-10-16 04:42:28'),(1248,'N1',9,'2013-10-28 05:42:28'),(1249,'N2',10,'2013-10-30 06:42:28'),(1250,'N3',1,'2013-10-02 07:42:28'),(1251,'N1',2,'2013-10-06 08:42:28'),(1252,'N2',3,'2013-10-05 09:42:28'),(1253,'N3',4,'2013-10-07 10:42:28'),(1254,'N1',5,'2013-10-13 13:42:28'),(1255,'N2',6,'2013-10-18 14:42:28'),(1256,'N3',7,'2013-10-07 15:42:28'),(1257,'N1',8,'2013-10-17 16:42:28'),(1258,'N2',9,'2013-10-24 17:42:28'),(1259,'N3',10,'2013-10-22 18:42:28'),(1260,'N1',1,'2013-10-08 19:42:28'),(1261,'N2',2,'2013-10-15 20:42:28'),(1262,'N3',3,'2013-10-02 21:42:28'),(1263,'N1',4,'2013-10-18 22:42:28'),(1264,'N2',5,'2013-10-27 23:42:28'),(1265,'N3',6,'2013-10-16 00:42:28'),(1266,'N1',7,'2013-10-13 01:42:28'),(1267,'N2',8,'2013-10-21 02:42:28'),(1268,'N3',9,'2013-10-08 03:42:28'),(1269,'N1',10,'2013-10-20 04:42:28'),(1270,'N2',1,'2013-10-24 05:42:28'),(1271,'N3',2,'2013-10-26 06:42:28'),(1272,'N1',3,'2013-10-02 07:42:28'),(1273,'N2',4,'2013-10-07 08:42:28'),(1274,'N3',5,'2013-10-29 09:42:28'),(1275,'N1',6,'2013-10-26 10:42:28'),(1276,'N2',7,'2013-10-05 13:42:28'),(1277,'N3',8,'2013-10-14 14:42:28'),(1278,'N1',9,'2013-10-10 15:42:28'),(1279,'N2',10,'2013-10-05 16:42:28'),(1280,'N3',1,'2013-10-03 17:42:28'),(1281,'N1',2,'2013-10-12 18:42:28'),(1282,'N2',3,'2013-10-26 19:42:28'),(1283,'N3',4,'2013-10-16 20:42:28'),(1284,'N1',5,'2013-10-02 21:42:28'),(1285,'N2',6,'2013-10-28 22:42:28'),(1286,'N3',7,'2013-10-03 23:42:28'),(1287,'N1',8,'2013-10-17 00:42:28'),(1288,'N2',9,'2013-10-04 01:42:28'),(1289,'N3',10,'2013-10-25 02:42:28'),(1290,'N1',1,'2013-10-07 03:42:28'),(1291,'N2',2,'2013-10-07 04:42:28'),(1292,'N3',3,'2013-10-05 05:42:28'),(1293,'N1',4,'2013-10-12 06:42:28'),(1294,'N2',5,'2013-10-17 07:42:28'),(1295,'N3',6,'2013-10-26 08:42:28'),(1296,'N1',7,'2013-10-29 09:42:28'),(1297,'N2',8,'2013-10-08 10:42:28'),(1298,'N3',9,'2013-10-02 13:42:28'),(1299,'N1',10,'2013-10-25 14:42:28'),(1300,'N2',1,'2013-10-23 15:42:28'),(1301,'N3',2,'2013-10-20 16:42:28'),(1302,'N1',3,'2013-10-01 17:42:28'),(1303,'N2',4,'2013-10-21 18:42:28'),(1304,'N3',5,'2013-10-20 19:42:28'),(1305,'N1',6,'2013-10-16 20:42:28'),(1306,'N2',7,'2013-10-29 21:42:28'),(1307,'N3',8,'2013-10-21 22:42:28'),(1308,'N1',9,'2013-10-13 23:42:28'),(1309,'N2',10,'2013-10-30 00:42:28'),(1310,'N3',1,'2013-10-08 01:42:28'),(1311,'N1',2,'2013-10-13 02:42:28'),(1312,'N2',3,'2013-10-10 03:42:28'),(1313,'N3',4,'2013-10-22 04:42:28'),(1314,'N1',5,'2013-10-16 05:42:28'),(1315,'N2',6,'2013-10-07 06:42:28'),(1316,'N3',7,'2013-10-20 07:42:28'),(1317,'N1',8,'2013-10-27 08:42:28'),(1318,'N2',9,'2013-10-14 09:42:28'),(1319,'N3',10,'2013-10-12 10:42:28'),(1320,'N1',1,'2013-10-03 13:42:28'),(1321,'N2',2,'2013-10-15 14:42:28'),(1322,'N3',3,'2013-10-27 15:42:28'),(1323,'N1',4,'2013-10-09 16:42:28'),(1324,'N2',5,'2013-10-02 17:42:28'),(1325,'N3',6,'2013-10-25 18:42:28'),(1326,'N1',7,'2013-10-19 19:42:28'),(1327,'N2',8,'2013-10-24 20:42:28'),(1328,'N3',9,'2013-10-23 21:42:28'),(1329,'N1',10,'2013-10-18 22:42:28'),(1330,'N2',1,'2013-10-11 23:42:28'),(1331,'N3',2,'2013-10-17 00:42:28'),(1332,'N1',3,'2013-10-14 01:42:28'),(1333,'N2',4,'2013-10-14 02:42:28'),(1334,'N3',5,'2013-10-27 03:42:28'),(1335,'N1',6,'2013-10-13 04:42:28'),(1336,'N2',7,'2013-10-22 05:42:28'),(1337,'N3',8,'2013-10-23 06:42:28'),(1338,'N1',9,'2013-10-14 07:42:28'),(1339,'N2',10,'2013-10-25 08:42:28'),(1340,'N3',1,'2013-10-05 09:42:28'),(1341,'N1',2,'2013-10-28 10:42:28'),(1342,'N2',3,'2013-10-13 13:42:28'),(1343,'N3',4,'2013-10-04 14:42:28'),(1344,'N1',5,'2013-10-03 15:42:28'),(1345,'N2',6,'2013-10-10 16:42:28'),(1346,'N3',7,'2013-10-02 17:42:28'),(1347,'N1',8,'2013-10-10 18:42:28'),(1348,'N2',9,'2013-10-28 19:42:28'),(1349,'N3',10,'2013-10-22 20:42:28'),(1350,'N1',1,'2013-10-26 21:42:28'),(1351,'N2',2,'2013-10-19 22:42:28'),(1352,'N3',3,'2013-10-19 23:42:28'),(1353,'N1',4,'2013-10-04 00:42:28'),(1354,'N2',5,'2013-10-17 01:42:28'),(1355,'N3',6,'2013-10-05 02:42:28'),(1356,'N1',7,'2013-10-21 03:42:28'),(1357,'N2',8,'2013-10-21 04:42:28'),(1358,'N3',9,'2013-10-03 05:42:28'),(1359,'N1',10,'2013-10-26 06:42:28'),(1360,'N2',1,'2013-10-30 07:42:28'),(1361,'N3',2,'2013-10-03 08:42:28'),(1362,'N1',3,'2013-10-17 09:42:28'),(1363,'N2',4,'2013-10-28 10:42:28'),(1364,'N3',5,'2013-10-08 13:42:28'),(1365,'N1',6,'2013-10-23 14:42:28'),(1366,'N2',7,'2013-10-01 15:42:28'),(1367,'N3',8,'2013-10-16 16:42:28'),(1368,'N1',9,'2013-10-26 17:42:28'),(1369,'N2',10,'2013-10-06 18:42:28'),(1370,'N3',1,'2013-10-23 19:42:28'),(1371,'N1',2,'2013-10-04 20:42:28'),(1372,'N2',3,'2013-10-09 21:42:28'),(1373,'N3',4,'2013-10-28 22:42:28'),(1374,'N1',5,'2013-10-21 23:42:28'),(1375,'N2',6,'2013-10-03 00:42:28'),(1376,'N3',7,'2013-10-25 01:42:28'),(1377,'N1',8,'2013-10-18 02:42:28'),(1378,'N2',9,'2013-10-22 03:42:28'),(1379,'N3',10,'2013-10-28 04:42:28'),(1380,'N1',1,'2013-10-30 05:42:28'),(1381,'N2',2,'2013-10-07 06:42:28'),(1382,'N3',3,'2013-10-14 07:42:28'),(1383,'N1',4,'2013-10-27 08:42:28'),(1384,'N2',5,'2013-10-30 09:42:28'),(1385,'N3',6,'2013-10-29 10:42:28'),(1386,'N1',7,'2013-10-07 13:42:28'),(1387,'N2',8,'2013-10-21 14:42:28'),(1388,'N3',9,'2013-10-06 15:42:28'),(1389,'N1',10,'2013-10-27 16:42:28'),(1390,'N2',1,'2013-10-03 17:42:28'),(1391,'N3',2,'2013-10-25 18:42:28'),(1392,'N1',3,'2013-10-09 19:42:28'),(1393,'N2',4,'2013-10-24 20:42:28'),(1394,'N3',5,'2013-10-09 21:42:28'),(1395,'N1',6,'2013-10-06 22:42:28'),(1396,'N2',7,'2013-10-04 23:42:28'),(1397,'N3',8,'2013-10-06 00:42:28'),(1398,'N1',9,'2013-10-18 01:42:28'),(1399,'N2',10,'2013-10-06 02:42:28'),(1400,'N3',1,'2013-10-08 03:42:28'),(1401,'N1',2,'2013-10-15 04:42:28'),(1402,'N2',3,'2013-10-09 05:42:28'),(1403,'N3',4,'2013-10-20 06:42:28'),(1404,'N1',5,'2013-10-07 07:42:28'),(1405,'N2',6,'2013-10-04 08:42:28'),(1406,'N3',7,'2013-10-29 09:42:28'),(1407,'N1',8,'2013-10-22 10:42:28'),(1408,'N2',9,'2013-10-11 13:42:28'),(1409,'N3',10,'2013-10-28 14:42:28'),(1410,'N1',1,'2013-10-22 15:42:28'),(1411,'N2',2,'2013-10-21 16:42:28'),(1412,'N3',3,'2013-10-06 17:42:28'),(1413,'N1',4,'2013-10-26 18:42:28'),(1414,'N2',5,'2013-10-18 19:42:28'),(1415,'N3',6,'2013-10-01 20:42:28'),(1416,'N1',7,'2013-10-07 21:42:28'),(1417,'N2',8,'2013-10-11 22:42:28'),(1418,'N3',9,'2013-10-27 23:42:28'),(1419,'N1',10,'2013-10-20 00:42:28'),(1420,'N2',1,'2013-10-27 01:42:28'),(1421,'N3',2,'2013-10-15 02:42:28'),(1422,'N1',3,'2013-10-26 03:42:28'),(1423,'N2',4,'2013-10-08 04:42:28'),(1424,'N3',5,'2013-10-17 05:42:28'),(1425,'N1',6,'2013-10-10 06:42:28'),(1426,'N2',7,'2013-10-30 07:42:28'),(1427,'N3',8,'2013-10-26 08:42:28'),(1428,'N1',9,'2013-10-28 09:42:28'),(1429,'N2',10,'2013-10-02 10:42:28'),(1430,'N3',1,'2013-10-08 13:42:28'),(1431,'N1',2,'2013-10-08 14:42:28'),(1432,'N2',3,'2013-10-05 15:42:28'),(1433,'N3',4,'2013-10-11 16:42:28'),(1434,'N1',5,'2013-10-24 17:42:28'),(1435,'N2',6,'2013-10-03 18:42:28'),(1436,'N3',7,'2013-10-28 19:42:28'),(1437,'N1',8,'2013-10-13 20:42:28'),(1438,'N2',9,'2013-10-12 21:42:28'),(1439,'N3',10,'2013-10-14 22:42:28'),(1440,'N1',1,'2013-10-09 23:42:28'),(1441,'N2',2,'2013-10-24 00:42:28'),(1442,'N3',3,'2013-10-22 01:42:28'),(1443,'N1',4,'2013-10-24 02:42:28'),(1444,'N2',5,'2013-10-30 03:42:28'),(1445,'N3',6,'2013-10-28 04:42:28'),(1446,'N1',7,'2013-10-24 05:42:28'),(1447,'N2',8,'2013-10-04 06:42:28'),(1448,'N3',9,'2013-10-13 07:42:28'),(1449,'N1',10,'2013-10-21 08:42:28'),(1450,'N2',1,'2013-10-16 09:42:28'),(1451,'N3',2,'2013-10-03 10:42:28'),(1452,'N1',3,'2013-10-19 13:42:28'),(1453,'N2',4,'2013-10-05 14:42:28'),(1454,'N3',5,'2013-10-11 15:42:28'),(1455,'N1',6,'2013-10-02 16:42:28'),(1456,'N2',7,'2013-10-24 17:42:28'),(1457,'N3',8,'2013-10-01 18:42:28'),(1458,'N1',9,'2013-10-27 19:42:28'),(1459,'N2',10,'2013-10-06 20:42:28'),(1460,'N3',1,'2013-10-15 21:42:28'),(1461,'N1',2,'2013-10-10 22:42:28'),(1462,'N2',3,'2013-10-25 23:42:28'),(1463,'N3',4,'2013-10-22 00:42:28'),(1464,'N1',5,'2013-10-23 01:42:28'),(1465,'N2',6,'2013-10-09 02:42:28'),(1466,'N3',7,'2013-10-21 03:42:28'),(1467,'N1',8,'2013-10-04 04:42:28'),(1468,'N2',9,'2013-10-08 05:42:28'),(1469,'N3',10,'2013-10-13 06:42:28'),(1470,'N1',1,'2013-10-04 07:42:28'),(1471,'N2',2,'2013-10-25 08:42:28'),(1472,'N3',3,'2013-10-03 09:42:28'),(1473,'N1',4,'2013-10-05 10:42:28'),(1474,'N2',5,'2013-10-27 13:42:28'),(1475,'N3',6,'2013-10-02 14:42:28'),(1476,'N1',7,'2013-10-19 15:42:28'),(1477,'N2',8,'2013-10-15 16:42:28'),(1478,'N3',9,'2013-10-15 17:42:28'),(1479,'N1',10,'2013-10-08 18:42:28'),(1480,'N2',1,'2013-10-29 19:42:28'),(1481,'N3',2,'2013-10-26 20:42:28'),(1482,'N1',3,'2013-10-15 21:42:28'),(1483,'N2',4,'2013-10-28 22:42:28'),(1484,'N3',5,'2013-10-28 23:42:28'),(1485,'N1',6,'2013-10-30 00:42:28'),(1486,'N2',7,'2013-10-09 01:42:28'),(1487,'N3',8,'2013-10-24 02:42:28'),(1488,'N1',9,'2013-10-29 03:42:28'),(1489,'N2',10,'2013-10-11 04:42:28'),(1490,'N3',1,'2013-10-04 05:42:28'),(1491,'N1',2,'2013-10-29 06:42:28'),(1492,'N2',3,'2013-10-20 07:42:28'),(1493,'N3',4,'2013-10-11 08:42:28'),(1494,'N1',5,'2013-10-24 09:42:28'),(1495,'N2',6,'2013-10-06 10:42:28'),(1496,'N3',7,'2013-10-05 13:42:28'),(1497,'N1',8,'2013-10-15 14:42:28'),(1498,'N2',9,'2013-10-02 15:42:28'),(1499,'N3',10,'2013-10-15 16:42:28'),(1500,'N1',1,'2013-10-15 17:42:28'),(1501,'N2',2,'2013-10-25 18:42:28'),(1502,'N3',3,'2013-10-16 19:42:28'),(1503,'N1',4,'2013-10-05 20:42:28'),(1504,'N2',5,'2013-10-24 21:42:28'),(1505,'N3',6,'2013-10-26 22:42:28'),(1506,'N1',7,'2013-10-03 23:42:28'),(1507,'N2',8,'2013-10-06 00:42:28'),(1508,'N3',9,'2013-10-13 01:42:28'),(1509,'N1',10,'2013-10-28 02:42:28'),(1510,'N2',1,'2013-10-16 03:42:28'),(1511,'N3',2,'2013-10-22 04:42:28'),(1512,'N1',3,'2013-10-11 05:42:28'),(1513,'N2',4,'2013-10-03 06:42:28'),(1514,'N3',5,'2013-10-22 07:42:28'),(1515,'N1',6,'2013-10-14 08:42:28'),(1516,'N2',7,'2013-10-07 09:42:28'),(1517,'N3',8,'2013-10-15 10:42:28'),(1518,'N1',9,'2013-10-20 13:42:28'),(1519,'N2',10,'2013-10-20 14:42:28'),(1520,'N3',1,'2013-10-08 15:42:28'),(1521,'N1',2,'2013-10-29 16:42:28'),(1522,'N2',3,'2013-10-25 17:42:28'),(1523,'N3',4,'2013-10-15 18:42:28'),(1524,'N1',5,'2013-10-06 19:42:28'),(1525,'N2',6,'2013-10-15 20:42:28'),(1526,'N3',7,'2013-10-29 21:42:28'),(1527,'N1',8,'2013-10-09 22:42:28'),(1528,'N2',9,'2013-10-17 23:42:28'),(1529,'N3',10,'2013-10-15 00:42:28'),(1530,'N1',1,'2013-10-25 01:42:28'),(1531,'N2',2,'2013-10-30 02:42:28'),(1532,'N3',3,'2013-10-03 03:42:28'),(1533,'N1',4,'2013-10-27 04:42:28'),(1534,'N2',5,'2013-10-20 05:42:28'),(1535,'N3',6,'2013-10-18 06:42:28'),(1536,'N1',7,'2013-10-03 07:42:28'),(1537,'N2',8,'2013-10-06 08:42:28'),(1538,'N3',9,'2013-10-16 09:42:28'),(1539,'N1',10,'2013-10-24 10:42:28'),(1540,'N2',1,'2013-10-25 13:42:28'),(1541,'N3',2,'2013-10-15 14:42:28'),(1542,'N1',3,'2013-10-17 15:42:28'),(1543,'N2',4,'2013-10-13 16:42:28'),(1544,'N3',5,'2013-10-23 17:42:28'),(1545,'N1',6,'2013-10-15 18:42:28'),(1546,'N2',7,'2013-10-08 19:42:28'),(1547,'N3',8,'2013-10-18 20:42:28'),(1548,'N1',9,'2013-10-27 21:42:28'),(1549,'N2',10,'2013-10-13 22:42:28'),(1550,'N3',1,'2013-10-03 23:42:28'),(1551,'N1',2,'2013-10-04 00:42:28'),(1552,'N2',3,'2013-10-16 01:42:28'),(1553,'N3',4,'2013-10-14 02:42:28'),(1554,'N1',5,'2013-10-05 03:42:28'),(1555,'N2',6,'2013-10-03 04:42:28'),(1556,'N3',7,'2013-10-18 05:42:28'),(1557,'N1',8,'2013-10-30 06:42:28'),(1558,'N2',9,'2013-10-05 07:42:28'),(1559,'N3',10,'2013-10-21 08:42:28'),(1560,'N1',1,'2013-10-30 09:42:28'),(1561,'N2',2,'2013-10-15 10:42:28'),(1562,'N3',3,'2013-10-29 13:42:28'),(1563,'N1',4,'2013-10-23 14:42:28'),(1564,'N2',5,'2013-10-25 15:42:28'),(1565,'N3',6,'2013-10-20 16:42:28'),(1566,'N1',7,'2013-10-27 17:42:28'),(1567,'N2',8,'2013-10-26 18:42:28'),(1568,'N3',9,'2013-10-23 19:42:28'),(1569,'N1',10,'2013-10-27 20:42:28'),(1570,'N2',1,'2013-10-03 21:42:28'),(1571,'N3',2,'2013-10-22 22:42:28'),(1572,'N1',3,'2013-10-18 23:42:28'),(1573,'N2',4,'2013-10-10 00:42:28'),(1574,'N3',5,'2013-10-23 01:42:28'),(1575,'N1',6,'2013-10-18 02:42:28'),(1576,'N2',7,'2013-10-24 03:42:28'),(1577,'N3',8,'2013-10-27 04:42:28'),(1578,'N1',9,'2013-10-02 05:42:28'),(1579,'N2',10,'2013-10-15 06:42:28'),(1580,'N3',1,'2013-10-18 07:42:28'),(1581,'N1',2,'2013-10-04 08:42:28'),(1582,'N2',3,'2013-10-29 09:42:28'),(1583,'N3',4,'2013-10-16 10:42:28'),(1584,'N1',5,'2013-10-29 13:42:28'),(1585,'N2',6,'2013-10-16 14:42:28'),(1586,'N3',7,'2013-10-21 15:42:28'),(1587,'N1',8,'2013-10-05 16:42:28'),(1588,'N2',9,'2013-10-22 17:42:28'),(1589,'N3',10,'2013-10-03 18:42:28'),(1590,'N1',1,'2013-10-26 19:42:28'),(1591,'N2',2,'2013-10-06 20:42:28'),(1592,'N3',3,'2013-10-22 21:42:28'),(1593,'N1',4,'2013-10-03 22:42:28'),(1594,'N2',5,'2013-10-27 23:42:28'),(1595,'N3',6,'2013-10-27 00:42:28'),(1596,'N1',7,'2013-10-04 01:42:28'),(1597,'N2',8,'2013-10-13 02:42:28'),(1598,'N3',9,'2013-10-30 03:42:28'),(1599,'N1',10,'2013-10-04 04:42:28'),(1600,'N2',1,'2013-10-25 05:42:28'),(1601,'N3',2,'2013-10-25 06:42:28'),(1602,'N1',3,'2013-10-30 07:42:28'),(1603,'N2',4,'2013-10-30 08:42:28'),(1604,'N3',5,'2013-10-30 09:42:28'),(1605,'N1',6,'2013-10-16 10:42:28'),(1606,'N2',7,'2013-10-29 13:42:28'),(1607,'N3',8,'2013-10-18 14:42:28'),(1608,'N1',9,'2013-10-04 15:42:28'),(1609,'N2',10,'2013-10-18 16:42:28'),(1610,'N3',1,'2013-10-28 17:42:28'),(1611,'N1',2,'2013-10-01 18:42:28'),(1612,'N2',3,'2013-10-13 19:42:28'),(1613,'N3',4,'2013-10-02 20:42:28'),(1614,'N1',5,'2013-10-28 21:42:28'),(1615,'N2',6,'2013-10-02 22:42:28'),(1616,'N3',7,'2013-10-06 23:42:28'),(1617,'N1',8,'2013-10-24 00:42:28'),(1618,'N2',9,'2013-10-30 01:42:28'),(1619,'N3',10,'2013-10-14 02:42:28'),(1620,'N1',1,'2013-10-25 03:42:28'),(1621,'N2',2,'2013-10-27 04:42:28'),(1622,'N3',3,'2013-10-19 05:42:28'),(1623,'N1',4,'2013-10-09 06:42:28'),(1624,'N2',5,'2013-10-28 07:42:28'),(1625,'N3',6,'2013-10-23 08:42:28'),(1626,'N1',7,'2013-10-29 09:42:28'),(1627,'N2',8,'2013-10-10 10:42:28'),(1628,'N3',9,'2013-10-13 13:42:28'),(1629,'N1',10,'2013-10-21 14:42:28'),(1630,'N2',1,'2013-10-06 15:42:28'),(1631,'N3',2,'2013-10-27 16:42:28'),(1632,'N1',3,'2013-10-14 17:42:28'),(1633,'N2',4,'2013-10-10 18:42:28'),(1634,'N3',5,'2013-10-05 19:42:28'),(1635,'N1',6,'2013-10-05 20:42:28'),(1636,'N2',7,'2013-10-12 21:42:28'),(1637,'N3',8,'2013-10-14 22:42:28'),(1638,'N1',9,'2013-10-24 23:42:28'),(1639,'N2',10,'2013-10-09 00:42:28'),(1640,'N3',1,'2013-10-24 01:42:28'),(1641,'N1',2,'2013-10-19 02:42:28'),(1642,'N2',3,'2013-10-07 03:42:28'),(1643,'N3',4,'2013-10-28 04:42:28'),(1644,'N1',5,'2013-10-25 05:42:28'),(1645,'N2',6,'2013-10-28 06:42:28'),(1646,'N3',7,'2013-10-03 07:42:28'),(1647,'N1',8,'2013-10-11 08:42:28'),(1648,'N2',9,'2013-10-13 09:42:28'),(1649,'N3',10,'2013-10-11 10:42:28'),(1650,'N1',1,'2013-10-16 13:42:28'),(1651,'N2',2,'2013-10-20 14:42:28'),(1652,'N3',3,'2013-10-20 15:42:28'),(1653,'N1',4,'2013-10-16 16:42:28'),(1654,'N2',5,'2013-10-08 17:42:28'),(1655,'N3',6,'2013-10-06 18:42:28'),(1656,'N1',7,'2013-10-03 19:42:28'),(1657,'N2',8,'2013-10-17 20:42:28'),(1658,'N3',9,'2013-10-16 21:42:28'),(1659,'N1',10,'2013-10-18 22:42:28'),(1660,'N2',1,'2013-10-07 23:42:28'),(1661,'N3',2,'2013-10-13 00:42:28'),(1662,'N1',3,'2013-10-19 01:42:28'),(1663,'N2',4,'2013-10-25 02:42:28'),(1664,'N3',5,'2013-10-07 03:42:28'),(1665,'N1',6,'2013-10-09 04:42:28'),(1666,'N2',7,'2013-10-16 05:42:28'),(1667,'N3',8,'2013-10-29 06:42:28'),(1668,'N1',9,'2013-10-15 07:42:28'),(1669,'N2',10,'2013-10-27 08:42:28'),(1670,'N3',1,'2013-10-13 09:42:28'),(1671,'N1',2,'2013-10-07 10:42:28'),(1672,'N2',3,'2013-10-21 13:42:28'),(1673,'N3',4,'2013-10-07 14:42:28'),(1674,'N1',5,'2013-10-21 15:42:28'),(1675,'N2',6,'2013-10-28 16:42:28'),(1676,'N3',7,'2013-10-15 17:42:28'),(1677,'N1',8,'2013-10-01 18:42:28'),(1678,'N2',9,'2013-10-16 19:42:28'),(1679,'N3',10,'2013-10-08 20:42:28'),(1680,'N1',1,'2013-10-20 21:42:28'),(1681,'N2',2,'2013-10-19 22:42:28'),(1682,'N3',3,'2013-10-17 23:42:28'),(1683,'N1',4,'2013-10-04 00:42:28'),(1684,'N2',5,'2013-10-07 01:42:28'),(1685,'N3',6,'2013-10-11 02:42:28'),(1686,'N1',7,'2013-10-15 03:42:28'),(1687,'N2',8,'2013-10-19 04:42:28'),(1688,'N3',9,'2013-10-11 05:42:28'),(1689,'N1',10,'2013-10-14 06:42:28'),(1690,'N2',1,'2013-10-07 07:42:28'),(1691,'N3',2,'2013-10-26 08:42:28'),(1692,'N1',3,'2013-10-03 09:42:28'),(1693,'N2',4,'2013-10-03 10:42:28'),(1694,'N3',5,'2013-10-06 13:42:28'),(1695,'N1',6,'2013-10-25 14:42:28'),(1696,'N2',7,'2013-10-26 15:42:28'),(1697,'N3',8,'2013-10-03 16:42:28'),(1698,'N1',9,'2013-10-29 17:42:28'),(1699,'N2',10,'2013-10-12 18:42:28'),(1700,'N3',1,'2013-10-23 19:42:28'),(1701,'N1',2,'2013-10-02 20:42:28'),(1702,'N2',3,'2013-10-20 21:42:28'),(1703,'N3',4,'2013-10-16 22:42:28'),(1704,'N1',5,'2013-10-01 23:42:28'),(1705,'N2',6,'2013-10-11 00:42:28'),(1706,'N3',7,'2013-10-27 01:42:28'),(1707,'N1',8,'2013-10-05 02:42:28'),(1708,'N2',9,'2013-10-13 03:42:28'),(1709,'N3',10,'2013-10-10 04:42:28'),(1710,'N1',1,'2013-10-06 05:42:28'),(1711,'N2',2,'2013-10-16 06:42:28'),(1712,'N3',3,'2013-10-30 07:42:28'),(1713,'N1',4,'2013-10-05 08:42:28'),(1714,'N2',5,'2013-10-02 09:42:28'),(1715,'N3',6,'2013-10-22 10:42:28'),(1716,'N1',7,'2013-10-04 13:42:28'),(1717,'N2',8,'2013-10-11 14:42:28'),(1718,'N3',9,'2013-10-29 15:42:28'),(1719,'N1',10,'2013-10-10 16:42:28'),(1720,'N2',1,'2013-10-19 17:42:28'),(1721,'N3',2,'2013-10-05 18:42:28'),(1722,'N1',3,'2013-10-02 19:42:28'),(1723,'N2',4,'2013-10-20 20:42:28'),(1724,'N3',5,'2013-10-18 21:42:28'),(1725,'N1',6,'2013-10-09 22:42:28'),(1726,'N2',7,'2013-10-09 23:42:28'),(1727,'N3',8,'2013-10-09 00:42:28'),(1728,'N1',9,'2013-10-05 01:42:28'),(1729,'N2',10,'2013-10-07 02:42:28'),(1730,'N3',1,'2013-10-07 03:42:28'),(1731,'N1',2,'2013-10-19 04:42:28'),(1732,'N2',3,'2013-10-23 05:42:28'),(1733,'N3',4,'2013-10-23 06:42:28'),(1734,'N1',5,'2013-10-05 07:42:28'),(1735,'N2',6,'2013-10-24 08:42:28'),(1736,'N3',7,'2013-10-14 09:42:28'),(1737,'N1',8,'2013-10-29 10:42:28'),(1738,'N2',9,'2013-10-01 13:42:28'),(1739,'N3',10,'2013-10-28 14:42:28'),(1740,'N1',1,'2013-10-12 15:42:28'),(1741,'N2',2,'2013-10-18 16:42:28'),(1742,'N3',3,'2013-10-27 17:42:28'),(1743,'N1',4,'2013-10-22 18:42:28'),(1744,'N2',5,'2013-10-25 19:42:28'),(1745,'N3',6,'2013-10-06 20:42:28'),(1746,'N1',7,'2013-10-06 21:42:28'),(1747,'N2',8,'2013-10-10 22:42:28'),(1748,'N3',9,'2013-10-01 23:42:28'),(1749,'N1',10,'2013-10-09 00:42:28'),(1750,'N2',1,'2013-10-09 01:42:28'),(1751,'N3',2,'2013-10-12 02:42:28'),(1752,'N1',3,'2013-10-12 03:42:28'),(1753,'N2',4,'2013-10-09 04:42:28'),(1754,'N3',5,'2013-10-14 05:42:28'),(1755,'N1',6,'2013-10-13 06:42:28'),(1756,'N2',7,'2013-10-21 07:42:28'),(1757,'N3',8,'2013-10-03 08:42:28'),(1758,'N1',9,'2013-10-09 09:42:28'),(1759,'N2',10,'2013-10-28 10:42:28'),(1760,'N3',1,'2013-10-19 13:42:28'),(1761,'N1',2,'2013-10-20 14:42:28'),(1762,'N2',3,'2013-10-27 15:42:28'),(1763,'N3',4,'2013-10-16 16:42:28'),(1764,'N1',5,'2013-10-20 17:42:28'),(1765,'N2',6,'2013-10-28 18:42:28'),(1766,'N3',7,'2013-10-05 19:42:28'),(1767,'N1',8,'2013-10-02 20:42:28'),(1768,'N2',9,'2013-10-23 21:42:28'),(1769,'N3',10,'2013-10-22 22:42:28'),(1770,'N1',1,'2013-10-28 23:42:28'),(1771,'N2',2,'2013-10-21 00:42:28'),(1772,'N3',3,'2013-10-24 01:42:28'),(1773,'N1',4,'2013-10-05 02:42:28'),(1774,'N2',5,'2013-10-25 03:42:28'),(1775,'N3',6,'2013-10-18 04:42:28'),(1776,'N1',7,'2013-10-25 05:42:28'),(1777,'N2',8,'2013-10-18 06:42:28'),(1778,'N3',9,'2013-10-23 07:42:28'),(1779,'N1',10,'2013-10-14 08:42:28'),(1780,'N2',1,'2013-10-19 09:42:28'),(1781,'N3',2,'2013-10-05 10:42:28'),(1782,'N1',3,'2013-10-12 13:42:28'),(1783,'N2',4,'2013-10-07 14:42:28'),(1784,'N3',5,'2013-10-25 15:42:28'),(1785,'N1',6,'2013-10-19 16:42:28'),(1786,'N2',7,'2013-10-23 17:42:28'),(1787,'N3',8,'2013-10-27 18:42:28'),(1788,'N1',9,'2013-10-13 19:42:28'),(1789,'N2',10,'2013-10-07 20:42:28'),(1790,'N3',1,'2013-10-13 21:42:28'),(1791,'N1',2,'2013-10-09 22:42:28'),(1792,'N2',3,'2013-10-13 23:42:28'),(1793,'N3',4,'2013-10-28 00:42:28'),(1794,'N1',5,'2013-10-12 01:42:28'),(1795,'N2',6,'2013-10-07 02:42:28'),(1796,'N3',7,'2013-10-08 03:42:28'),(1797,'N1',8,'2013-10-05 04:42:28'),(1798,'N2',9,'2013-10-15 05:42:28'),(1799,'N3',10,'2013-10-13 06:42:28'),(1800,'N1',1,'2013-10-03 07:42:28'),(1801,'N2',2,'2013-10-05 08:42:28'),(1802,'N3',3,'2013-10-10 09:42:28'),(1803,'N1',4,'2013-10-06 10:42:28'),(1804,'N2',5,'2013-10-10 13:42:28'),(1805,'N3',6,'2013-10-04 14:42:28'),(1806,'N1',7,'2013-10-26 15:42:28'),(1807,'N2',8,'2013-10-11 16:42:28'),(1808,'N3',9,'2013-10-21 17:42:28'),(1809,'N1',10,'2013-10-21 18:42:28'),(1810,'N2',1,'2013-10-19 19:42:28'),(1811,'N3',2,'2013-10-13 20:42:28'),(1812,'N1',3,'2013-10-02 21:42:28'),(1813,'N2',4,'2013-10-02 22:42:28'),(1814,'N3',5,'2013-10-05 23:42:28'),(1815,'N1',6,'2013-10-18 00:42:28'),(1816,'N2',7,'2013-10-22 01:42:28'),(1817,'N3',8,'2013-10-21 02:42:28'),(1818,'N1',9,'2013-10-26 03:42:28'),(1819,'N2',10,'2013-10-11 04:42:28'),(1820,'N3',1,'2013-10-05 05:42:28'),(1821,'N1',2,'2013-10-13 06:42:28'),(1822,'N2',3,'2013-10-11 07:42:28'),(1823,'N3',4,'2013-10-18 08:42:28'),(1824,'N1',5,'2013-10-18 09:42:28'),(1825,'N2',6,'2013-10-05 10:42:28'),(1826,'N3',7,'2013-10-05 13:42:28'),(1827,'N1',8,'2013-10-01 14:42:28'),(1828,'N2',9,'2013-10-25 15:42:28'),(1829,'N3',10,'2013-10-14 16:42:28'),(1830,'N1',1,'2013-10-04 17:42:28'),(1831,'N2',2,'2013-10-20 18:42:28'),(1832,'N3',3,'2013-10-14 19:42:28'),(1833,'N1',4,'2013-10-08 20:42:28'),(1834,'N2',5,'2013-10-18 21:42:28'),(1835,'N3',6,'2013-10-22 22:42:28'),(1836,'N1',7,'2013-10-09 23:42:28'),(1837,'N2',8,'2013-10-27 00:42:28'),(1838,'N3',9,'2013-10-16 01:42:28'),(1839,'N1',10,'2013-10-18 02:42:28'),(1840,'N2',1,'2013-10-18 03:42:28'),(1841,'N3',2,'2013-10-17 04:42:28'),(1842,'N1',3,'2013-10-19 05:42:28'),(1843,'N2',4,'2013-10-07 06:42:28'),(1844,'N3',5,'2013-10-28 07:42:28'),(1845,'N1',6,'2013-10-15 08:42:28'),(1846,'N2',7,'2013-10-15 09:42:28'),(1847,'N3',8,'2013-10-24 10:42:28'),(1848,'N1',9,'2013-10-27 13:42:28'),(1849,'N2',10,'2013-10-16 14:42:28'),(1850,'N3',1,'2013-10-07 15:42:28'),(1851,'N1',2,'2013-10-02 16:42:28'),(1852,'N2',3,'2013-10-20 17:42:28'),(1853,'N3',4,'2013-10-04 18:42:28'),(1854,'N1',5,'2013-10-06 19:42:28'),(1855,'N2',6,'2013-10-26 20:42:28'),(1856,'N3',7,'2013-10-22 21:42:28'),(1857,'N1',8,'2013-10-06 22:42:28'),(1858,'N2',9,'2013-10-28 23:42:28'),(1859,'N3',10,'2013-10-19 00:42:28'),(1860,'N1',1,'2013-10-28 01:42:28'),(1861,'N2',2,'2013-10-25 02:42:28'),(1862,'N3',3,'2013-10-04 03:42:28'),(1863,'N1',4,'2013-10-08 04:42:28'),(1864,'N2',5,'2013-10-30 05:42:28'),(1865,'N3',6,'2013-10-23 06:42:28'),(1866,'N1',7,'2013-10-30 07:42:28'),(1867,'N2',8,'2013-10-17 08:42:28'),(1868,'N3',9,'2013-10-07 09:42:28'),(1869,'N1',10,'2013-10-30 10:42:28'),(1870,'N2',1,'2013-10-02 13:42:28'),(1871,'N3',2,'2013-10-09 14:42:28'),(1872,'N1',3,'2013-10-07 15:42:28'),(1873,'N2',4,'2013-10-16 16:42:28'),(1874,'N3',5,'2013-10-18 17:42:28'),(1875,'N1',6,'2013-10-28 18:42:28'),(1876,'N2',7,'2013-10-02 19:42:28'),(1877,'N3',8,'2013-10-26 20:42:28'),(1878,'N1',9,'2013-10-02 21:42:28'),(1879,'N2',10,'2013-10-08 22:42:28'),(1880,'N3',1,'2013-10-14 23:42:28'),(1881,'N1',2,'2013-10-24 00:42:28'),(1882,'N2',3,'2013-10-21 01:42:28'),(1883,'N3',4,'2013-10-07 02:42:28'),(1884,'N1',5,'2013-10-28 03:42:28'),(1885,'N2',6,'2013-10-05 04:42:28'),(1886,'N3',7,'2013-10-16 05:42:28'),(1887,'N1',8,'2013-10-04 06:42:28'),(1888,'N2',9,'2013-10-20 07:42:28'),(1889,'N3',10,'2013-10-30 08:42:28'),(1890,'N1',1,'2013-10-04 09:42:28'),(1891,'N2',2,'2013-10-15 10:42:28'),(1892,'N3',3,'2013-10-17 13:42:28'),(1893,'N1',4,'2013-10-08 14:42:28'),(1894,'N2',5,'2013-10-29 15:42:28'),(1895,'N3',6,'2013-10-06 16:42:28'),(1896,'N1',7,'2013-10-21 17:42:28'),(1897,'N2',8,'2013-10-29 18:42:28'),(1898,'N3',9,'2013-10-24 19:42:28'),(1899,'N1',10,'2013-10-23 20:42:28'),(1900,'N2',1,'2013-10-29 21:42:28'),(1901,'N3',2,'2013-10-21 22:42:28'),(1902,'N1',3,'2013-10-20 23:42:28'),(1903,'N2',4,'2013-10-25 00:42:28'),(1904,'N3',5,'2013-10-04 01:42:28'),(1905,'N1',6,'2013-10-27 02:42:28'),(1906,'N2',7,'2013-10-27 03:42:28'),(1907,'N3',8,'2013-10-03 04:42:28'),(1908,'N1',9,'2013-10-24 05:42:28'),(1909,'N2',10,'2013-10-05 06:42:28'),(1910,'N3',1,'2013-10-08 07:42:28'),(1911,'N1',2,'2013-10-18 08:42:28'),(1912,'N2',3,'2013-10-30 09:42:28'),(1913,'N3',4,'2013-10-04 10:42:28'),(1914,'N1',5,'2013-10-14 13:42:28'),(1915,'N2',6,'2013-10-02 14:42:28'),(1916,'N3',7,'2013-10-25 15:42:28'),(1917,'N1',8,'2013-10-27 16:42:28'),(1918,'N2',9,'2013-10-29 17:42:28'),(1919,'N3',10,'2013-10-16 18:42:29'),(1920,'N1',1,'2013-10-02 19:42:29'),(1921,'N2',2,'2013-10-15 20:42:29'),(1922,'N3',3,'2013-10-20 21:42:29'),(1923,'N1',4,'2013-10-06 22:42:29'),(1924,'N2',5,'2013-10-08 23:42:29'),(1925,'N3',6,'2013-10-17 00:42:29'),(1926,'N1',7,'2013-10-05 01:42:29'),(1927,'N2',8,'2013-10-29 02:42:29'),(1928,'N3',9,'2013-10-04 03:42:29'),(1929,'N1',10,'2013-10-16 04:42:29'),(1930,'N2',1,'2013-10-26 05:42:29'),(1931,'N3',2,'2013-10-20 06:42:29'),(1932,'N1',3,'2013-10-17 07:42:29'),(1933,'N2',4,'2013-10-24 08:42:29'),(1934,'N3',5,'2013-10-11 09:42:29'),(1935,'N1',6,'2013-10-23 10:42:29'),(1936,'N2',7,'2013-10-28 13:42:29'),(1937,'N3',8,'2013-10-03 14:42:29'),(1938,'N1',9,'2013-10-27 15:42:29'),(1939,'N2',10,'2013-10-13 16:42:29'),(1940,'N3',1,'2013-10-18 17:42:29'),(1941,'N1',2,'2013-10-13 18:42:29'),(1942,'N2',3,'2013-10-03 19:42:29'),(1943,'N3',4,'2013-10-29 20:42:29'),(1944,'N1',5,'2013-10-26 21:42:29'),(1945,'N2',6,'2013-10-12 22:42:29'),(1946,'N3',7,'2013-10-07 23:42:29'),(1947,'N1',8,'2013-10-04 00:42:29'),(1948,'N2',9,'2013-10-04 01:42:29'),(1949,'N3',10,'2013-10-22 02:42:29'),(1950,'N1',1,'2013-10-30 03:42:29'),(1951,'N2',2,'2013-10-04 04:42:29'),(1952,'N3',3,'2013-10-21 05:42:29'),(1953,'N1',4,'2013-10-18 06:42:29'),(1954,'N2',5,'2013-10-20 07:42:29'),(1955,'N3',6,'2013-10-28 08:42:29'),(1956,'N1',7,'2013-10-13 09:42:29'),(1957,'N2',8,'2013-10-11 10:42:29'),(1958,'N3',9,'2013-10-22 13:42:29'),(1959,'N1',10,'2013-10-21 14:42:29'),(1960,'N2',1,'2013-10-25 15:42:29'),(1961,'N3',2,'2013-10-23 16:42:29'),(1962,'N1',3,'2013-10-15 17:42:29'),(1963,'N2',4,'2013-10-01 18:42:29'),(1964,'N3',5,'2013-10-07 19:42:29'),(1965,'N1',6,'2013-10-11 20:42:29'),(1966,'N2',7,'2013-10-06 21:42:29'),(1967,'N3',8,'2013-10-07 22:42:29'),(1968,'N1',9,'2013-10-11 23:42:29'),(1969,'N2',10,'2013-10-20 00:42:29'),(1970,'N3',1,'2013-10-23 01:42:29'),(1971,'N1',2,'2013-10-05 02:42:29'),(1972,'N2',3,'2013-10-22 03:42:29'),(1973,'N3',4,'2013-10-03 04:42:29'),(1974,'N1',5,'2013-10-27 05:42:29'),(1975,'N2',6,'2013-10-13 06:42:29'),(1976,'N3',7,'2013-10-18 07:42:29'),(1977,'N1',8,'2013-10-08 08:42:29'),(1978,'N2',9,'2013-10-15 09:42:29'),(1979,'N3',10,'2013-10-26 10:42:29'),(1980,'N1',1,'2013-10-26 13:42:29'),(1981,'N2',2,'2013-10-12 14:42:29'),(1982,'N3',3,'2013-10-18 15:42:29'),(1983,'N1',4,'2013-10-22 16:42:29'),(1984,'N2',5,'2013-10-19 17:42:29'),(1985,'N3',6,'2013-10-24 18:42:29'),(1986,'N1',7,'2013-10-11 19:42:29'),(1987,'N2',8,'2013-10-28 20:42:29'),(1988,'N3',9,'2013-10-29 21:42:29'),(1989,'N1',10,'2013-10-27 22:42:29'),(1990,'N2',1,'2013-10-16 23:42:29'),(1991,'N3',2,'2013-10-16 00:42:29'),(1992,'N1',3,'2013-10-15 01:42:29'),(1993,'N2',4,'2013-10-28 02:42:29'),(1994,'N3',5,'2013-10-12 03:42:29'),(1995,'N1',6,'2013-10-28 04:42:29'),(1996,'N2',7,'2013-10-04 05:42:29'),(1997,'N3',8,'2013-10-08 06:42:29'),(1998,'N1',9,'2013-10-05 07:42:29'),(1999,'N2',10,'2013-10-12 08:42:29');
+/*!40000 ALTER TABLE `dl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `externalMeeting`
+--
+
+DROP TABLE IF EXISTS `externalMeeting`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `externalMeeting` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `crmuserId` mediumint(9) NOT NULL,
+ `endtime` bigint(20) DEFAULT NULL,
+ `starttime` bigint(20) NOT NULL DEFAULT '0',
+ `title` varchar(128) DEFAULT NULL,
+ `contactIds` varchar(512) DEFAULT NULL,
+ `status` mediumint(9) DEFAULT NULL,
+ `activity_type` mediumint(9) DEFAULT NULL,
+ `coachId` mediumint(9) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `externalMeeting`
+--
+
+LOCK TABLES `externalMeeting` WRITE;
+/*!40000 ALTER TABLE `externalMeeting` DISABLE KEYS */;
+/*!40000 ALTER TABLE `externalMeeting` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `importMetaInfo`
+--
+
+DROP TABLE IF EXISTS `importMetaInfo`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `importMetaInfo` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `name` varchar(255) NOT NULL,
+ `entity_name` varchar(255) DEFAULT NULL,
+ `importfilename` varchar(255) DEFAULT NULL,
+ `logfilename` varchar(255) DEFAULT NULL,
+ `whenadded` datetime DEFAULT NULL,
+ `modifier` varchar(255) DEFAULT NULL,
+ `modify_datetime` datetime DEFAULT NULL,
+ `num_of_total_record` mediumint(9) DEFAULT NULL,
+ `num_of_imported` mediumint(9) DEFAULT NULL,
+ `num_of_failed` mediumint(9) DEFAULT NULL,
+ `status` mediumint(9) DEFAULT NULL,
+ `result` mediumint(9) DEFAULT NULL,
+ `num_of_updated` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `importMetaInfo`
+--
+
+LOCK TABLES `importMetaInfo` WRITE;
+/*!40000 ALTER TABLE `importMetaInfo` DISABLE KEYS */;
+/*!40000 ALTER TABLE `importMetaInfo` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `importresult`
+--
+
+DROP TABLE IF EXISTS `importresult`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `importresult` (
+ `id` int(11) NOT NULL,
+ `val` varchar(45) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `importresult`
+--
+
+LOCK TABLES `importresult` WRITE;
+/*!40000 ALTER TABLE `importresult` DISABLE KEYS */;
+INSERT INTO `importresult` VALUES (0,'成功'),(1,'失败');
+/*!40000 ALTER TABLE `importresult` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `importstatus`
+--
+
+DROP TABLE IF EXISTS `importstatus`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `importstatus` (
+ `id` int(11) NOT NULL,
+ `val` varchar(45) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `importstatus`
+--
+
+LOCK TABLES `importstatus` WRITE;
+/*!40000 ALTER TABLE `importstatus` DISABLE KEYS */;
+INSERT INTO `importstatus` VALUES (0,'运行'),(1,'已完成');
+/*!40000 ALTER TABLE `importstatus` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `internalMeeting`
+--
+
+DROP TABLE IF EXISTS `internalMeeting`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `internalMeeting` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `crmuserId` mediumint(9) NOT NULL,
+ `endtime` bigint(20) DEFAULT NULL,
+ `starttime` bigint(20) NOT NULL DEFAULT '0',
+ `title` varchar(128) DEFAULT NULL,
+ `contactId` mediumint(9) DEFAULT NULL,
+ `crmusermanagerId` mediumint(9) DEFAULT NULL,
+ `status` mediumint(9) DEFAULT NULL,
+ `activity_type` mediumint(9) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `internalMeeting`
+--
+
+LOCK TABLES `internalMeeting` WRITE;
+/*!40000 ALTER TABLE `internalMeeting` DISABLE KEYS */;
+/*!40000 ALTER TABLE `internalMeeting` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `loginhistory`
+--
+
+DROP TABLE IF EXISTS `loginhistory`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `loginhistory` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `sessionId` varchar(128) DEFAULT NULL,
+ `loginName` varchar(256) DEFAULT NULL,
+ `loginTime` datetime DEFAULT NULL,
+ `logoutTime` datetime DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE,
+ UNIQUE KEY `sessionId` (`sessionId`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `loginhistory`
+--
+
+LOCK TABLES `loginhistory` WRITE;
+/*!40000 ALTER TABLE `loginhistory` DISABLE KEYS */;
+/*!40000 ALTER TABLE `loginhistory` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Temporary table structure for view `parent_position`
+--
+
+DROP TABLE IF EXISTS `parent_position`;
+/*!50001 DROP VIEW IF EXISTS `parent_position`*/;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+/*!50001 CREATE TABLE `parent_position` (
+ `id` tinyint NOT NULL,
+ `name` tinyint NOT NULL,
+ `code` tinyint NOT NULL,
+ `reportto` tinyint NOT NULL,
+ `role` tinyint NOT NULL,
+ `pl1` tinyint NOT NULL,
+ `pl2` tinyint NOT NULL,
+ `pl4` tinyint NOT NULL,
+ `pl5` tinyint NOT NULL,
+ `city` tinyint NOT NULL,
+ `department` tinyint NOT NULL,
+ `whenadded` tinyint NOT NULL,
+ `modifier` tinyint NOT NULL,
+ `modify_datetime` tinyint NOT NULL,
+ `owner` tinyint NOT NULL,
+ `level` tinyint NOT NULL
+) ENGINE=MyISAM */;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Temporary table structure for view `parent_user_info`
+--
+
+DROP TABLE IF EXISTS `parent_user_info`;
+/*!50001 DROP VIEW IF EXISTS `parent_user_info`*/;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+/*!50001 CREATE TABLE `parent_user_info` (
+ `id` tinyint NOT NULL,
+ `name` tinyint NOT NULL,
+ `department` tinyint NOT NULL,
+ `division` tinyint NOT NULL,
+ `cellPhone` tinyint NOT NULL,
+ `email` tinyint NOT NULL,
+ `employeeNumber` tinyint NOT NULL,
+ `photo` tinyint NOT NULL,
+ `jobTitle` tinyint NOT NULL,
+ `pl1` tinyint NOT NULL,
+ `pl2` tinyint NOT NULL,
+ `role` tinyint NOT NULL,
+ `pl4` tinyint NOT NULL,
+ `pl5` tinyint NOT NULL,
+ `sex` tinyint NOT NULL,
+ `loginName` tinyint NOT NULL,
+ `password` tinyint NOT NULL,
+ `sessionKey` tinyint NOT NULL,
+ `lastLoginTime` tinyint NOT NULL,
+ `whenadded` tinyint NOT NULL,
+ `parcel` tinyint NOT NULL,
+ `modifier` tinyint NOT NULL,
+ `modify_datetime` tinyint NOT NULL,
+ `owner` tinyint NOT NULL,
+ `province` tinyint NOT NULL,
+ `city` tinyint NOT NULL,
+ `office_tel` tinyint NOT NULL,
+ `num_of_signIn` tinyint NOT NULL
+) ENGINE=MyISAM */;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Temporary table structure for view `parent_user_position`
+--
+
+DROP TABLE IF EXISTS `parent_user_position`;
+/*!50001 DROP VIEW IF EXISTS `parent_user_position`*/;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+/*!50001 CREATE TABLE `parent_user_position` (
+ `id` tinyint NOT NULL,
+ `userId` tinyint NOT NULL,
+ `positionId` tinyint NOT NULL,
+ `status` tinyint NOT NULL,
+ `createtime` tinyint NOT NULL,
+ `isPrimary` tinyint NOT NULL,
+ `externalId` tinyint NOT NULL,
+ `whenadded` tinyint NOT NULL,
+ `modifier` tinyint NOT NULL,
+ `modify_datetime` tinyint NOT NULL
+) ENGINE=MyISAM */;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `province`
+--
+
+DROP TABLE IF EXISTS `province`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `province` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `val` varchar(20) DEFAULT NULL,
+ `externalId` varchar(20) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `province`
+--
+
+LOCK TABLES `province` WRITE;
+/*!40000 ALTER TABLE `province` DISABLE KEYS */;
+INSERT INTO `province` VALUES (1,'北京','110000'),(2,'天津','120000'),(3,'河北','130000'),(4,'山西','140000'),(5,'内蒙古','150000'),(6,'辽宁','210000'),(7,'吉林','220000'),(8,'黑龙江','230000'),(9,'上海','310000'),(10,'江苏','320000'),(11,'浙江','330000'),(12,'安徽','340000'),(13,'福建','350000'),(14,'江西','360000'),(15,'山东','370000'),(16,'河南','410000'),(17,'湖北','420000'),(18,'湖南','430000'),(19,'广东','440000'),(20,'广西','450000'),(21,'海南','460000'),(22,'重庆','500000'),(23,'四川','510000'),(24,'贵州','520000'),(25,'云南','530000'),(26,'西藏','540000'),(27,'陕西','610000'),(28,'甘肃','620000'),(29,'青海','630000'),(30,'宁夏','640000'),(31,'新疆','650000'),(32,'台湾','710000'),(33,'香港','810000'),(34,'澳门','820000');
+/*!40000 ALTER TABLE `province` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `province1`
+--
+
+DROP TABLE IF EXISTS `province1`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `province1` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `code` varchar(6) NOT NULL,
+ `val` varchar(20) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM AUTO_INCREMENT=35 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `province1`
+--
+
+LOCK TABLES `province1` WRITE;
+/*!40000 ALTER TABLE `province1` DISABLE KEYS */;
+INSERT INTO `province1` VALUES (1,'110000','北京市'),(2,'120000','天津市'),(3,'130000','河北省'),(4,'140000','山西省'),(5,'150000','内蒙古'),(6,'210000','辽宁省'),(7,'220000','吉林省'),(8,'230000','黑龙江'),(9,'310000','上海市'),(10,'320000','江苏省'),(11,'330000','浙江省'),(12,'340000','安徽省'),(13,'350000','福建省'),(14,'360000','江西省'),(15,'370000','山东省'),(16,'410000','河南省'),(17,'420000','湖北省'),(18,'430000','湖南省'),(19,'440000','广东省'),(20,'450000','广 西'),(21,'460000','海南省'),(22,'500000','重庆市'),(23,'510000','四川省'),(24,'520000','贵州省'),(25,'530000','云南省'),(26,'540000','西 藏'),(27,'610000','陕西省'),(28,'620000','甘肃省'),(29,'630000','青海省'),(30,'640000','宁 夏'),(31,'650000','新 疆'),(32,'710000','台湾省'),(33,'810000','香 港'),(34,'820000','澳 门');
+/*!40000 ALTER TABLE `province1` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `record_type`
+--
+
+DROP TABLE IF EXISTS `record_type`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `record_type` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `version` bigint(20) NOT NULL,
+ `val` varchar(255) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `val` (`val`)
+) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `record_type`
+--
+
+LOCK TABLES `record_type` WRITE;
+/*!40000 ALTER TABLE `record_type` DISABLE KEYS */;
+INSERT INTO `record_type` VALUES (1,0,'Account'),(2,0,'Contact'),(3,0,'Call'),(4,0,'Coaching'),(5,0,'AccuntTeam'),(6,0,'ContactTeam');
+/*!40000 ALTER TABLE `record_type` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `region_level1_pl`
+--
+
+DROP TABLE IF EXISTS `region_level1_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `region_level1_pl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `region_level1_pl`
+--
+
+LOCK TABLES `region_level1_pl` WRITE;
+/*!40000 ALTER TABLE `region_level1_pl` DISABLE KEYS */;
+INSERT INTO `region_level1_pl` VALUES (1,'北中国'),(2,'南中国'),(3,'东中国');
+/*!40000 ALTER TABLE `region_level1_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `region_level2_pl`
+--
+
+DROP TABLE IF EXISTS `region_level2_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `region_level2_pl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `region_level2_pl`
+--
+
+LOCK TABLES `region_level2_pl` WRITE;
+/*!40000 ALTER TABLE `region_level2_pl` DISABLE KEYS */;
+INSERT INTO `region_level2_pl` VALUES (1,'华北'),(2,'西北'),(3,'东北'),(4,'西南'),(5,'华南'),(6,'华中'),(7,'华东');
+/*!40000 ALTER TABLE `region_level2_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `role`
+--
+
+DROP TABLE IF EXISTS `role`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `role` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ `name` varchar(45) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `role`
+--
+
+LOCK TABLES `role` WRITE;
+/*!40000 ALTER TABLE `role` DISABLE KEYS */;
+INSERT INTO `role` VALUES (1,'高级用户','全部'),(2,'主管','只读'),(3,'销售代表','只读');
+/*!40000 ALTER TABLE `role` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `sales_visiting_purpose_pl`
+--
+
+DROP TABLE IF EXISTS `sales_visiting_purpose_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `sales_visiting_purpose_pl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `sales_visiting_purpose_pl`
+--
+
+LOCK TABLES `sales_visiting_purpose_pl` WRITE;
+/*!40000 ALTER TABLE `sales_visiting_purpose_pl` DISABLE KEYS */;
+INSERT INTO `sales_visiting_purpose_pl` VALUES (1,'会议安排'),(2,'会议跟进'),(3,'交接工作'),(4,'了解竞争');
+/*!40000 ALTER TABLE `sales_visiting_purpose_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `score1_pl`
+--
+
+DROP TABLE IF EXISTS `score1_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `score1_pl` (
+ `id` int(11) NOT NULL DEFAULT '0',
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `score1_pl`
+--
+
+LOCK TABLES `score1_pl` WRITE;
+/*!40000 ALTER TABLE `score1_pl` DISABLE KEYS */;
+INSERT INTO `score1_pl` VALUES (0,'0'),(1,'1'),(2,'2'),(3,'3'),(4,'4'),(5,'5'),(6,'6'),(7,'7'),(8,'8'),(9,'9'),(10,'10'),(11,'11'),(12,'12'),(13,'13'),(14,'14'),(15,'15');
+/*!40000 ALTER TABLE `score1_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `score2_pl`
+--
+
+DROP TABLE IF EXISTS `score2_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `score2_pl` (
+ `id` int(11) NOT NULL DEFAULT '0',
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `score2_pl`
+--
+
+LOCK TABLES `score2_pl` WRITE;
+/*!40000 ALTER TABLE `score2_pl` DISABLE KEYS */;
+INSERT INTO `score2_pl` VALUES (0,'0'),(1,'1'),(2,'2'),(3,'3'),(4,'4'),(5,'5'),(6,'6'),(7,'7'),(8,'8'),(9,'9'),(10,'10'),(11,'11'),(12,'12'),(13,'13'),(14,'14'),(15,'15'),(16,'16'),(17,'17'),(18,'18'),(19,'19'),(20,'20');
+/*!40000 ALTER TABLE `score2_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `sex_pl`
+--
+
+DROP TABLE IF EXISTS `sex_pl`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `sex_pl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `sex_pl`
+--
+
+LOCK TABLES `sex_pl` WRITE;
+/*!40000 ALTER TABLE `sex_pl` DISABLE KEYS */;
+INSERT INTO `sex_pl` VALUES (1,'男'),(2,'女');
+/*!40000 ALTER TABLE `sex_pl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `test_main`
+--
+
+DROP TABLE IF EXISTS `test_main`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `test_main` (
+ `id` int(11) NOT NULL DEFAULT '0',
+ `value` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `test_main`
+--
+
+LOCK TABLES `test_main` WRITE;
+/*!40000 ALTER TABLE `test_main` DISABLE KEYS */;
+INSERT INTO `test_main` VALUES (1,'ONE'),(2,'TWO');
+/*!40000 ALTER TABLE `test_main` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `test_sub`
+--
+
+DROP TABLE IF EXISTS `test_sub`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `test_sub` (
+ `id` int(11) NOT NULL DEFAULT '0',
+ `main_id` int(11) DEFAULT NULL,
+ `value` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `test_sub`
+--
+
+LOCK TABLES `test_sub` WRITE;
+/*!40000 ALTER TABLE `test_sub` DISABLE KEYS */;
+INSERT INTO `test_sub` VALUES (1,1,'ONEONE'),(2,2,'TWOTWO');
+/*!40000 ALTER TABLE `test_sub` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `user_position`
+--
+
+DROP TABLE IF EXISTS `user_position`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `user_position` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `userId` int(32) DEFAULT NULL,
+ `positionId` int(32) DEFAULT NULL,
+ `status` int(11) DEFAULT NULL,
+ `createtime` datetime DEFAULT NULL,
+ `isPrimary` int(11) DEFAULT NULL,
+ `externalId` varchar(128) DEFAULT NULL,
+ `whenadded` datetime DEFAULT NULL,
+ `modifier` varchar(255) DEFAULT NULL,
+ `modify_datetime` datetime DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `positionId` (`positionId`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `user_position`
+--
+
+LOCK TABLES `user_position` WRITE;
+/*!40000 ALTER TABLE `user_position` DISABLE KEYS */;
+INSERT INTO `user_position` VALUES (1,1,1,NULL,NULL,1,NULL,NULL,NULL,NULL);
+/*!40000 ALTER TABLE `user_position` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Temporary table structure for view `user_position_account`
+--
+
+DROP TABLE IF EXISTS `user_position_account`;
+/*!50001 DROP VIEW IF EXISTS `user_position_account`*/;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+/*!50001 CREATE TABLE `user_position_account` (
+ `id` tinyint NOT NULL,
+ `userName` tinyint NOT NULL,
+ `loginName` tinyint NOT NULL,
+ `email` tinyint NOT NULL,
+ `sex` tinyint NOT NULL,
+ `addTime` tinyint NOT NULL,
+ `positionName` tinyint NOT NULL,
+ `positionCode` tinyint NOT NULL,
+ `reportTo` tinyint NOT NULL,
+ `reporttto` tinyint NOT NULL,
+ `role` tinyint NOT NULL,
+ `regoin1` tinyint NOT NULL,
+ `regoin2` tinyint NOT NULL,
+ `city` tinyint NOT NULL,
+ `accountName` tinyint NOT NULL,
+ `BDMCode` tinyint NOT NULL,
+ `adminLevel` tinyint NOT NULL,
+ `status` tinyint NOT NULL
+) ENGINE=MyISAM */;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Temporary table structure for view `user_position_query`
+--
+
+DROP TABLE IF EXISTS `user_position_query`;
+/*!50001 DROP VIEW IF EXISTS `user_position_query`*/;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+/*!50001 CREATE TABLE `user_position_query` (
+ `user_id` tinyint NOT NULL,
+ `position_id` tinyint NOT NULL,
+ `area` tinyint NOT NULL,
+ `region` tinyint NOT NULL,
+ `province` tinyint NOT NULL,
+ `productLine` tinyint NOT NULL,
+ `position_level` tinyint NOT NULL,
+ `position_name` tinyint NOT NULL,
+ `position_code` tinyint NOT NULL,
+ `delegatePosition` tinyint NOT NULL,
+ `delegateName` tinyint NOT NULL,
+ `manager_position_id` tinyint NOT NULL,
+ `managerPosition` tinyint NOT NULL,
+ `manager_position_name` tinyint NOT NULL,
+ `manager_position_level` tinyint NOT NULL,
+ `manager_employee_number` tinyint NOT NULL,
+ `regionManager` tinyint NOT NULL,
+ `accountName` tinyint NOT NULL,
+ `BDMcode` tinyint NOT NULL
+) ENGINE=MyISAM */;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Table structure for table `userinfo`
+--
+
+DROP TABLE IF EXISTS `userinfo`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `userinfo` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `name` varchar(255) NOT NULL,
+ `department` varchar(255) DEFAULT NULL,
+ `division` varchar(255) DEFAULT NULL,
+ `cellPhone` varchar(255) DEFAULT NULL,
+ `email` varchar(255) DEFAULT NULL,
+ `employeeNumber` varchar(255) DEFAULT NULL,
+ `photo` varchar(255) DEFAULT NULL,
+ `jobTitle` varchar(255) DEFAULT NULL,
+ `pl1` mediumint(9) DEFAULT NULL,
+ `pl2` mediumint(9) DEFAULT NULL,
+ `role` mediumint(9) DEFAULT NULL,
+ `pl4` mediumint(9) DEFAULT NULL,
+ `pl5` mediumint(9) DEFAULT NULL,
+ `sex` mediumint(9) DEFAULT NULL,
+ `loginName` varchar(255) DEFAULT NULL,
+ `password` varchar(255) DEFAULT NULL,
+ `sessionKey` varchar(255) DEFAULT NULL,
+ `lastLoginTime` bigint(20) DEFAULT NULL,
+ `whenadded` datetime DEFAULT NULL,
+ `parcel` varchar(255) DEFAULT NULL,
+ `modifier` varchar(255) DEFAULT NULL,
+ `modify_datetime` datetime DEFAULT NULL,
+ `owner` varchar(255) DEFAULT NULL,
+ `province` int(11) DEFAULT NULL,
+ `city` int(11) DEFAULT NULL,
+ `office_tel` varchar(255) DEFAULT NULL,
+ `num_of_signIn` mediumint(9) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE,
+ UNIQUE KEY `employeeNumber` (`employeeNumber`),
+ UNIQUE KEY `loginName_UNIQUE` (`loginName`)
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `userinfo`
+--
+
+LOCK TABLES `userinfo` WRITE;
+/*!40000 ALTER TABLE `userinfo` DISABLE KEYS */;
+INSERT INTO `userinfo` VALUES (-1,'无',NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,1,NULL,NULL,1,'dummy','827ccb0eea8a706c4c34a16891f84e7b',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(1,'Admin Nam',NULL,NULL,NULL,'tigerzhou@rexen.com.cn',NULL,NULL,NULL,1,NULL,1,NULL,NULL,1,'admin','827ccb0eea8a706c4c34a16891f84e7b',NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,1,NULL,NULL);
+/*!40000 ALTER TABLE `userinfo` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Final view structure for view `activity_alert`
+--
+
+/*!50001 DROP TABLE IF EXISTS `activity_alert`*/;
+/*!50001 DROP VIEW IF EXISTS `activity_alert`*/;
+/*!50001 SET @saved_cs_client = @@character_set_client */;
+/*!50001 SET @saved_cs_results = @@character_set_results */;
+/*!50001 SET @saved_col_connection = @@collation_connection */;
+/*!50001 SET character_set_client = utf8 */;
+/*!50001 SET character_set_results = utf8 */;
+/*!50001 SET collation_connection = utf8_general_ci */;
+/*!50001 CREATE ALGORITHM=UNDEFINED */
+/*!50013 DEFINER=`crm`@`localhost` SQL SECURITY DEFINER */
+/*!50001 VIEW `activity_alert` AS select `act`.`id` AS `id`,(case when ((to_days(curdate()) - to_days(date_format(from_unixtime((`act`.`starttime` / 1000)),'%Y-%m-%d'))) = 0) then '今天' when ((to_days(curdate()) - to_days(date_format(from_unixtime((`act`.`starttime` / 1000)),'%Y-%m-%d'))) = 1) then '昨天' when ((to_days(curdate()) - to_days(date_format(from_unixtime((`act`.`starttime` / 1000)),'%Y-%m-%d'))) = 2) then '前天' when (((to_days(curdate()) - to_days(date_format(from_unixtime((`act`.`starttime` / 1000)),'%Y-%m-%d'))) >= 3) and ((to_days(curdate()) - to_days(date_format(from_unixtime((`act`.`starttime` / 1000)),'%Y-%m-%d'))) < 7)) then '三天以前' when ((to_days(curdate()) - to_days(date_format(from_unixtime((`act`.`starttime` / 1000)),'%Y-%m-%d'))) >= 7) then '七天以前' else '错误' end) AS `time`,`act`.`title` AS `title`,`act`.`owner` AS `name`,`act`.`starttime` AS `times` from `activity` `act` where ((`act`.`status` = 1) and ((to_days(curdate()) - to_days(date_format(from_unixtime((`act`.`starttime` / 1000)),'%Y-%m-%d'))) >= 0)) order by `act`.`starttime` */;
+/*!50001 SET character_set_client = @saved_cs_client */;
+/*!50001 SET character_set_results = @saved_cs_results */;
+/*!50001 SET collation_connection = @saved_col_connection */;
+
+--
+-- Final view structure for view `parent_position`
+--
+
+/*!50001 DROP TABLE IF EXISTS `parent_position`*/;
+/*!50001 DROP VIEW IF EXISTS `parent_position`*/;
+/*!50001 SET @saved_cs_client = @@character_set_client */;
+/*!50001 SET @saved_cs_results = @@character_set_results */;
+/*!50001 SET @saved_col_connection = @@collation_connection */;
+/*!50001 SET character_set_client = utf8 */;
+/*!50001 SET character_set_results = utf8 */;
+/*!50001 SET collation_connection = utf8_general_ci */;
+/*!50001 CREATE ALGORITHM=UNDEFINED */
+/*!50013 DEFINER=`crm`@`localhost` SQL SECURITY DEFINER */
+/*!50001 VIEW `parent_position` AS select `crmuser`.`id` AS `id`,`crmuser`.`name` AS `name`,`crmuser`.`code` AS `code`,`crmuser`.`reportto` AS `reportto`,`crmuser`.`role` AS `role`,`crmuser`.`pl1` AS `pl1`,`crmuser`.`pl2` AS `pl2`,`crmuser`.`pl4` AS `pl4`,`crmuser`.`pl5` AS `pl5`,`crmuser`.`city` AS `city`,`crmuser`.`department` AS `department`,`crmuser`.`whenadded` AS `whenadded`,`crmuser`.`modifier` AS `modifier`,`crmuser`.`modify_datetime` AS `modify_datetime`,`crmuser`.`owner` AS `owner`,`crmuser`.`level` AS `level` from `crmuser` */;
+/*!50001 SET character_set_client = @saved_cs_client */;
+/*!50001 SET character_set_results = @saved_cs_results */;
+/*!50001 SET collation_connection = @saved_col_connection */;
+
+--
+-- Final view structure for view `parent_user_info`
+--
+
+/*!50001 DROP TABLE IF EXISTS `parent_user_info`*/;
+/*!50001 DROP VIEW IF EXISTS `parent_user_info`*/;
+/*!50001 SET @saved_cs_client = @@character_set_client */;
+/*!50001 SET @saved_cs_results = @@character_set_results */;
+/*!50001 SET @saved_col_connection = @@collation_connection */;
+/*!50001 SET character_set_client = utf8 */;
+/*!50001 SET character_set_results = utf8 */;
+/*!50001 SET collation_connection = utf8_general_ci */;
+/*!50001 CREATE ALGORITHM=UNDEFINED */
+/*!50013 DEFINER=`crm`@`localhost` SQL SECURITY DEFINER */
+/*!50001 VIEW `parent_user_info` AS select `userinfo`.`id` AS `id`,`userinfo`.`name` AS `name`,`userinfo`.`department` AS `department`,`userinfo`.`division` AS `division`,`userinfo`.`cellPhone` AS `cellPhone`,`userinfo`.`email` AS `email`,`userinfo`.`employeeNumber` AS `employeeNumber`,`userinfo`.`photo` AS `photo`,`userinfo`.`jobTitle` AS `jobTitle`,`userinfo`.`pl1` AS `pl1`,`userinfo`.`pl2` AS `pl2`,`userinfo`.`role` AS `role`,`userinfo`.`pl4` AS `pl4`,`userinfo`.`pl5` AS `pl5`,`userinfo`.`sex` AS `sex`,`userinfo`.`loginName` AS `loginName`,`userinfo`.`password` AS `password`,`userinfo`.`sessionKey` AS `sessionKey`,`userinfo`.`lastLoginTime` AS `lastLoginTime`,`userinfo`.`whenadded` AS `whenadded`,`userinfo`.`parcel` AS `parcel`,`userinfo`.`modifier` AS `modifier`,`userinfo`.`modify_datetime` AS `modify_datetime`,`userinfo`.`owner` AS `owner`,`userinfo`.`province` AS `province`,`userinfo`.`city` AS `city`,`userinfo`.`office_tel` AS `office_tel`,`userinfo`.`num_of_signIn` AS `num_of_signIn` from `userinfo` */;
+/*!50001 SET character_set_client = @saved_cs_client */;
+/*!50001 SET character_set_results = @saved_cs_results */;
+/*!50001 SET collation_connection = @saved_col_connection */;
+
+--
+-- Final view structure for view `parent_user_position`
+--
+
+/*!50001 DROP TABLE IF EXISTS `parent_user_position`*/;
+/*!50001 DROP VIEW IF EXISTS `parent_user_position`*/;
+/*!50001 SET @saved_cs_client = @@character_set_client */;
+/*!50001 SET @saved_cs_results = @@character_set_results */;
+/*!50001 SET @saved_col_connection = @@collation_connection */;
+/*!50001 SET character_set_client = utf8 */;
+/*!50001 SET character_set_results = utf8 */;
+/*!50001 SET collation_connection = utf8_general_ci */;
+/*!50001 CREATE ALGORITHM=UNDEFINED */
+/*!50013 DEFINER=`crm`@`localhost` SQL SECURITY DEFINER */
+/*!50001 VIEW `parent_user_position` AS select `user_position`.`id` AS `id`,`user_position`.`userId` AS `userId`,`user_position`.`positionId` AS `positionId`,`user_position`.`status` AS `status`,`user_position`.`createtime` AS `createtime`,`user_position`.`isPrimary` AS `isPrimary`,`user_position`.`externalId` AS `externalId`,`user_position`.`whenadded` AS `whenadded`,`user_position`.`modifier` AS `modifier`,`user_position`.`modify_datetime` AS `modify_datetime` from `user_position` */;
+/*!50001 SET character_set_client = @saved_cs_client */;
+/*!50001 SET character_set_results = @saved_cs_results */;
+/*!50001 SET collation_connection = @saved_col_connection */;
+
+--
+-- Final view structure for view `user_position_account`
+--
+
+/*!50001 DROP TABLE IF EXISTS `user_position_account`*/;
+/*!50001 DROP VIEW IF EXISTS `user_position_account`*/;
+/*!50001 SET @saved_cs_client = @@character_set_client */;
+/*!50001 SET @saved_cs_results = @@character_set_results */;
+/*!50001 SET @saved_col_connection = @@collation_connection */;
+/*!50001 SET character_set_client = utf8 */;
+/*!50001 SET character_set_results = utf8 */;
+/*!50001 SET collation_connection = utf8_general_ci */;
+/*!50001 CREATE ALGORITHM=UNDEFINED */
+/*!50013 DEFINER=`crm`@`localhost` SQL SECURITY DEFINER */
+/*!50001 VIEW `user_position_account` AS select `ac`.`id` AS `id`,`u`.`name` AS `userName`,`u`.`loginName` AS `loginName`,`u`.`email` AS `email`,`sp`.`val` AS `sex`,`u`.`whenadded` AS `addTime`,`c`.`name` AS `positionName`,`c`.`code` AS `positionCode`,(select `crm`.`name` from `crmuser` `crm` where (`crm`.`id` = `c`.`reportto`)) AS `reportTo`,(select `c1`.`name` from `crmuser` `c1` where (`c1`.`id` = (select `c2`.`reportto` from `crmuser` `c2` where (`c2`.`id` = `c`.`reportto`)))) AS `reporttto`,`r`.`val` AS `role`,`rlp4`.`val` AS `regoin1`,`rlp5`.`val` AS `regoin2`,`ct`.`val` AS `city`,`a`.`name` AS `accountName`,`a`.`bdm_code` AS `BDMCode`,`aalp`.`val` AS `adminLevel`,`asp`.`val` AS `status` from (((((((((((`userinfo` `u` left join `sex_pl` `sp` on((`u`.`sex` = `sp`.`id`))) left join `user_position` `up` on((`u`.`id` = `up`.`userId`))) left join `crmuser` `c` on((`up`.`positionId` = `c`.`id`))) left join `role` `r` on((`c`.`role` = `r`.`id`))) left join `region_level1_pl` `rlp4` on((`c`.`pl4` = `rlp4`.`id`))) left join `region_level1_pl` `rlp5` on((`c`.`pl5` = `rlp5`.`id`))) left join `city` `ct` on((`c`.`city` = `ct`.`id`))) left join `accountcrmuser` `ac` on((`c`.`id` = `ac`.`crmuserId`))) left join `account` `a` on((`ac`.`accountId` = `a`.`id`))) left join `account_status_pl` `asp` on((`a`.`status` = `asp`.`id`))) left join `account_administrativ_level_pl` `aalp` on((`a`.`administrativ_level` = `aalp`.`id`))) where (`up`.`status` = 1) order by `ac`.`id` */;
+/*!50001 SET character_set_client = @saved_cs_client */;
+/*!50001 SET character_set_results = @saved_cs_results */;
+/*!50001 SET collation_connection = @saved_col_connection */;
+
+--
+-- Final view structure for view `user_position_query`
+--
+
+/*!50001 DROP TABLE IF EXISTS `user_position_query`*/;
+/*!50001 DROP VIEW IF EXISTS `user_position_query`*/;
+/*!50001 SET @saved_cs_client = @@character_set_client */;
+/*!50001 SET @saved_cs_results = @@character_set_results */;
+/*!50001 SET @saved_col_connection = @@collation_connection */;
+/*!50001 SET character_set_client = utf8 */;
+/*!50001 SET character_set_results = utf8 */;
+/*!50001 SET collation_connection = utf8_general_ci */;
+/*!50001 CREATE ALGORITHM=UNDEFINED */
+/*!50013 DEFINER=`crm`@`localhost` SQL SECURITY DEFINER */
+/*!50001 VIEW `user_position_query` AS select `user_position`.`userId` AS `user_id`,`user_position`.`positionId` AS `position_id`,`region_level1_pl`.`val` AS `area`,`region_level2_pl`.`val` AS `region`,`province`.`val` AS `province`,`crmuser_pl2`.`val` AS `productLine`,`crmuser`.`level` AS `position_level`,`crmuser`.`name` AS `position_name`,`crmuser`.`code` AS `position_code`,`userinfo`.`employeeNumber` AS `delegatePosition`,`userinfo`.`name` AS `delegateName`,`parent_position`.`id` AS `manager_position_id`,`parent_position`.`code` AS `managerPosition`,`parent_position`.`name` AS `manager_position_name`,`parent_position`.`level` AS `manager_position_level`,`parent_user_info`.`employeeNumber` AS `manager_employee_number`,`parent_user_info`.`name` AS `regionManager`,`account`.`name` AS `accountName`,`account`.`bdm_code` AS `BDMcode` from (((((((((((`user_position` left join `crmuser` on((`user_position`.`positionId` = `crmuser`.`id`))) left join `userinfo` on((`user_position`.`userId` = `userinfo`.`id`))) left join `parent_position` on((`crmuser`.`reportto` = `parent_position`.`id`))) left join `parent_user_position` on((`parent_position`.`id` = `parent_user_position`.`positionId`))) left join `parent_user_info` on((`parent_user_position`.`userId` = `parent_user_info`.`id`))) join `accountcrmuser` on((`user_position`.`positionId` = `accountcrmuser`.`crmuserId`))) join `account` on((`accountcrmuser`.`accountId` = `account`.`id`))) left join `region_level1_pl` on((`crmuser`.`pl4` = `region_level1_pl`.`id`))) left join `region_level2_pl` on((`crmuser`.`pl5` = `region_level2_pl`.`id`))) left join `province` on((`account`.`province` = `province`.`id`))) left join `crmuser_pl2` on((`crmuser_pl2`.`id` = `crmuser`.`pl2`))) */;
+/*!50001 SET character_set_client = @saved_cs_client */;
+/*!50001 SET character_set_results = @saved_cs_results */;
+/*!50001 SET collation_connection = @saved_col_connection */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+-- Dump completed on 2013-11-26 23:55:19
diff --git a/crm/src/main/db/grant.sql b/crm/src/main/db/grant.sql
new file mode 100644
index 0000000..bb4a3fd
--- /dev/null
+++ b/crm/src/main/db/grant.sql
@@ -0,0 +1,4 @@
+GRANT ALL ON crmdb.* TO 'crm' IDENTIFIED BY '';
+GRANT ALL ON crmdb.* TO 'crm'@'localhost' IDENTIFIED BY '';
+GRANT SELECT ON mysql.proc TO 'crm' IDENTIFIED BY '';
+GRANT SELECT ON mysql.proc TO 'crm'@'localhost' IDENTIFIED BY '';
diff --git a/crm/src/main/db/load.sql b/crm/src/main/db/load.sql
new file mode 100644
index 0000000..ceb1d92
--- /dev/null
+++ b/crm/src/main/db/load.sql
@@ -0,0 +1,575 @@
+drop table if exists boolean_pl;
+CREATE TABLE boolean_pl
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+INSERT INTO boolean_pl (val) VALUES('是');
+INSERT INTO boolean_pl (val) VALUES('否');
+
+-- 医院行政级别
+drop table if exists account_administrativ_level_pl;
+CREATE TABLE account_administrativ_level_pl
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+INSERT INTO account_administrativ_level_pl (val) VALUES('一级');
+INSERT INTO account_administrativ_level_pl (val) VALUES('一级甲等');
+INSERT INTO account_administrativ_level_pl (val) VALUES('一级乙等');
+INSERT INTO account_administrativ_level_pl (val) VALUES('一级丙等');
+INSERT INTO account_administrativ_level_pl (val) VALUES('二级');
+INSERT INTO account_administrativ_level_pl (val) VALUES('二级甲等');
+INSERT INTO account_administrativ_level_pl (val) VALUES('二级乙等');
+INSERT INTO account_administrativ_level_pl (val) VALUES('二级丙等');
+INSERT INTO account_administrativ_level_pl (val) VALUES('三级');
+INSERT INTO account_administrativ_level_pl (val) VALUES('三级甲等');
+INSERT INTO account_administrativ_level_pl (val) VALUES('三级乙等');
+INSERT INTO account_administrativ_level_pl (val) VALUES('三级丙等');
+INSERT INTO account_administrativ_level_pl (val) VALUES('未评级未评等');
+
+-- 医院分级
+drop table if exists account_grade_pl;
+CREATE TABLE account_grade_pl
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+INSERT INTO account_grade_pl (val) VALUES('A');
+INSERT INTO account_grade_pl (val) VALUES('B');
+INSERT INTO account_grade_pl (val) VALUES('C');
+INSERT INTO account_grade_pl (val) VALUES('D');
+
+
+-- 医院状态
+drop table if exists account_status_pl;
+CREATE TABLE account_status_pl
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+INSERT INTO account_status_pl (val) VALUES ('无效');
+INSERT INTO account_status_pl (val) VALUES('有效');
+
+
+drop table if exists account_local_or_army_pl;
+CREATE TABLE account_local_or_army_pl
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+INSERT INTO account_local_or_army_pl (val) VALUES ('地方医院');
+INSERT INTO account_local_or_army_pl (val) VALUES('部队医院');
+
+drop table if exists account_comprehensive_or_specialized_pl;
+CREATE TABLE account_comprehensive_or_specialized_pl
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+INSERT INTO account_comprehensive_or_specialized_pl (val) VALUES ('综合医院');
+INSERT INTO account_comprehensive_or_specialized_pl (val) VALUES('专科医院');
+
+
+drop table if exists account_market_classification_pl;
+CREATE TABLE account_market_classification_pl
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+INSERT INTO account_market_classification_pl (val) VALUES ('战略城市');
+INSERT INTO account_market_classification_pl (val) VALUES('一级城市');
+INSERT INTO account_market_classification_pl (val) VALUES('二级城市');
+INSERT INTO account_market_classification_pl (val) VALUES('三级城市');
+INSERT INTO account_market_classification_pl (val) VALUES('四级城市');
+
+drop table if exists account_type_pl;
+CREATE TABLE account_type_pl
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+INSERT INTO account_type_pl (val) VALUES ('癌痛目标医院');
+INSERT INTO account_type_pl (val) VALUES('慢痛目标医院');
+INSERT INTO account_type_pl (val) VALUES('奥诺美目标医院');
+INSERT INTO account_type_pl (val) VALUES('非目标医院');
+
+drop table if exists account_point_pl;
+CREATE TABLE account_point_pl
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+INSERT INTO account_point_pl (val) VALUES ('癌痛重点医院');
+INSERT INTO account_point_pl (val) VALUES('慢痛重点医院');
+INSERT INTO account_point_pl (val) VALUES('奥诺美重点医院');
+INSERT INTO account_point_pl (val) VALUES('非重点医院');
+
+
+--activity related picklist
+-- 类型
+drop table if exists activity_event_type_pl;
+CREATE TABLE activity_event_type_pl
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+INSERT INTO activity_event_type_pl (val) VALUES('拜访');
+INSERT INTO activity_event_type_pl (val) VALUES('辅导');
+
+-- 活动状态;
+drop table if exists activity_status_pl;
+CREATE TABLE activity_status_pl
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+INSERT INTO activity_status_pl (val) VALUES('计划');
+INSERT INTO activity_status_pl (val) VALUES('完成');
+INSERT INTO activity_status_pl (val) VALUES('取消');
+
+drop table if exists activity_activity_types_pl;
+CREATE TABLE activity_activity_types_pl
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+INSERT INTO activity_activity_types_pl (val) VALUES('专业化拜访');
+INSERT INTO activity_activity_types_pl (val) VALUES('事务性拜访');
+
+drop table if exists activity_visiting_purpose_pl;
+CREATE TABLE activity_visiting_purpose_pl
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ activity_type MEDIUMINT,
+ parentId MEDIUMINT,
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+INSERT INTO activity_visiting_purpose_pl (val,activity_type,parentId) VALUES('传递产品知识',1,1);
+INSERT INTO activity_visiting_purpose_pl (val,activity_type,parentId) VALUES('处方观念沟通',1,1);
+INSERT INTO activity_visiting_purpose_pl (val,activity_type,parentId) VALUES('病例沟通',1,1);
+INSERT INTO activity_visiting_purpose_pl (val,activity_type,parentId) VALUES('会议安排',2,2);
+INSERT INTO activity_visiting_purpose_pl (val,activity_type,parentId) VALUES('会议跟进',2,2);
+INSERT INTO activity_visiting_purpose_pl (val,activity_type,parentId) VALUES('交接工作',2,2);
+INSERT INTO activity_visiting_purpose_pl (val,activity_type,parentId) VALUES('了解竞争',2,2);
+
+-- 拜访目的1
+drop table if exists sales_visiting_purpose_pl;
+CREATE TABLE sales_visiting_purpose_pl
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+INSERT INTO sales_visiting_purpose_pl (val) VALUES('会议安排');
+INSERT INTO sales_visiting_purpose_pl (val) VALUES('会议跟进');
+INSERT INTO sales_visiting_purpose_pl (val) VALUES('交接工作');
+INSERT INTO sales_visiting_purpose_pl (val) VALUES('了解竞争');
+
+-- 拜访目的2
+drop table if exists com_visiting_purpose_pl;
+CREATE TABLE com_visiting_purpose_pl
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+INSERT INTO com_visiting_purpose_pl (val) VALUES('处方观念沟通');
+INSERT INTO com_visiting_purpose_pl (val) VALUES('病例沟通');
+
+
+drop table if exists activity_feature_product_pl;
+CREATE TABLE activity_feature_product_pl
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+INSERT INTO activity_feature_product_pl (val) VALUES('美施康定');
+INSERT INTO activity_feature_product_pl (val) VALUES('奥施康定');
+INSERT INTO activity_feature_product_pl (val) VALUES('奇曼丁');
+INSERT INTO activity_feature_product_pl (val) VALUES('若思本');
+INSERT INTO activity_feature_product_pl (val) VALUES('奥诺美');
+
+-- 性别;
+drop table if exists sex_pl;
+CREATE TABLE sex_pl
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+INSERT INTO sex_pl (val) VALUES('男');
+INSERT INTO sex_pl (val) VALUES('女');
+-- 科室
+drop table if exists contact_department_pl;
+CREATE TABLE contact_department_pl
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+INSERT INTO contact_department_pl (val) VALUES('ICU');
+INSERT INTO contact_department_pl (val) VALUES('保健科');
+INSERT INTO contact_department_pl (val) VALUES('采购科');
+INSERT INTO contact_department_pl (val) VALUES('传染科');
+INSERT INTO contact_department_pl (val) VALUES('创伤外科');
+INSERT INTO contact_department_pl (val) VALUES('儿科');
+INSERT INTO contact_department_pl (val) VALUES('耳鼻喉科');
+INSERT INTO contact_department_pl (val) VALUES('方便门诊');
+INSERT INTO contact_department_pl (val) VALUES('放化疗科');
+INSERT INTO contact_department_pl (val) VALUES('放疗科');
+INSERT INTO contact_department_pl (val) VALUES('放射科');
+INSERT INTO contact_department_pl (val) VALUES('风湿科');
+INSERT INTO contact_department_pl (val) VALUES('妇产科');
+INSERT INTO contact_department_pl (val) VALUES('妇科');
+INSERT INTO contact_department_pl (val) VALUES('肝胆外科');
+INSERT INTO contact_department_pl (val) VALUES('感染科');
+INSERT INTO contact_department_pl (val) VALUES('肛肠科');
+INSERT INTO contact_department_pl (val) VALUES('姑息科');
+INSERT INTO contact_department_pl (val) VALUES('骨科');
+INSERT INTO contact_department_pl (val) VALUES('国际医疗科');
+INSERT INTO contact_department_pl (val) VALUES('核医学科');
+INSERT INTO contact_department_pl (val) VALUES('呼吸内科');
+INSERT INTO contact_department_pl (val) VALUES('护理部');
+INSERT INTO contact_department_pl (val) VALUES('急诊科');
+INSERT INTO contact_department_pl (val) VALUES('介入科');
+INSERT INTO contact_department_pl (val) VALUES('康复科');
+INSERT INTO contact_department_pl (val) VALUES('口腔科');
+INSERT INTO contact_department_pl (val) VALUES('老干科');
+INSERT INTO contact_department_pl (val) VALUES('麻醉科');
+INSERT INTO contact_department_pl (val) VALUES('泌尿外科');
+INSERT INTO contact_department_pl (val) VALUES('脑外科');
+INSERT INTO contact_department_pl (val) VALUES('内分泌科');
+INSERT INTO contact_department_pl (val) VALUES('内科');
+INSERT INTO contact_department_pl (val) VALUES('宁养院');
+INSERT INTO contact_department_pl (val) VALUES('皮肤科');
+INSERT INTO contact_department_pl (val) VALUES('普外科');
+INSERT INTO contact_department_pl (val) VALUES('乳腺外科');
+INSERT INTO contact_department_pl (val) VALUES('烧伤整形科');
+INSERT INTO contact_department_pl (val) VALUES('神经科');
+INSERT INTO contact_department_pl (val) VALUES('神经内科');
+INSERT INTO contact_department_pl (val) VALUES('神经外科');
+INSERT INTO contact_department_pl (val) VALUES('肾内科');
+INSERT INTO contact_department_pl (val) VALUES('生物治疗科');
+INSERT INTO contact_department_pl (val) VALUES('特需科');
+INSERT INTO contact_department_pl (val) VALUES('疼痛科');
+INSERT INTO contact_department_pl (val) VALUES('外科');
+INSERT INTO contact_department_pl (val) VALUES('微创科');
+INSERT INTO contact_department_pl (val) VALUES('胃肠外科');
+INSERT INTO contact_department_pl (val) VALUES('消化科');
+INSERT INTO contact_department_pl (val) VALUES('消化内科');
+INSERT INTO contact_department_pl (val) VALUES('消化外科');
+INSERT INTO contact_department_pl (val) VALUES('心内科');
+INSERT INTO contact_department_pl (val) VALUES('心胸外科');
+INSERT INTO contact_department_pl (val) VALUES('血管外科');
+INSERT INTO contact_department_pl (val) VALUES('血透室');
+INSERT INTO contact_department_pl (val) VALUES('血液科');
+INSERT INTO contact_department_pl (val) VALUES('药剂科');
+INSERT INTO contact_department_pl (val) VALUES('医保办');
+INSERT INTO contact_department_pl (val) VALUES('医务科');
+INSERT INTO contact_department_pl (val) VALUES('整形美容科');
+INSERT INTO contact_department_pl (val) VALUES('质控科');
+INSERT INTO contact_department_pl (val) VALUES('中西医结合科');
+INSERT INTO contact_department_pl (val) VALUES('中医科');
+INSERT INTO contact_department_pl (val) VALUES('肿瘤科');
+INSERT INTO contact_department_pl (val) VALUES('肿瘤内科');
+INSERT INTO contact_department_pl (val) VALUES('肿瘤外科');
+INSERT INTO contact_department_pl (val) VALUES('综合科');
+INSERT INTO contact_department_pl (val) VALUES('其他');
+
+-- 行政职务;
+drop table if exists contact_duty_pl;
+CREATE TABLE contact_duty_pl
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+
+INSERT INTO contact_duty_pl (val) VALUES('医生');
+INSERT INTO contact_duty_pl (val) VALUES('副主任');
+INSERT INTO contact_duty_pl (val) VALUES('主任');
+INSERT INTO contact_duty_pl (val) VALUES('副院长');
+INSERT INTO contact_duty_pl (val) VALUES('院长');
+INSERT INTO contact_duty_pl (val) VALUES('院长助理');
+INSERT INTO contact_duty_pl (val) VALUES('副书记');
+INSERT INTO contact_duty_pl (val) VALUES('书记');
+INSERT INTO contact_duty_pl (val) VALUES('护士');
+INSERT INTO contact_duty_pl (val) VALUES('护士长');
+INSERT INTO contact_duty_pl (val) VALUES('库管');
+INSERT INTO contact_duty_pl (val) VALUES('采购');
+INSERT INTO contact_duty_pl (val) VALUES('采购科科长');
+INSERT INTO contact_duty_pl (val) VALUES('药师');
+INSERT INTO contact_duty_pl (val) VALUES('药剂科副主任');
+INSERT INTO contact_duty_pl (val) VALUES('药剂科主任');
+INSERT INTO contact_duty_pl (val) VALUES('医务科副科长');
+INSERT INTO contact_duty_pl (val) VALUES('医务科科长');
+INSERT INTO contact_duty_pl (val) VALUES('医保办主任');
+INSERT INTO contact_duty_pl (val) VALUES('科教科主任');
+INSERT INTO contact_duty_pl (val) VALUES('信息科科长');
+INSERT INTO contact_duty_pl (val) VALUES('其他');
+
+
+-- 专业职务;
+drop table if exists contact_job_title_pl;
+CREATE TABLE contact_job_title_pl
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+INSERT INTO contact_job_title_pl (val) VALUES('住院医师');
+INSERT INTO contact_job_title_pl (val) VALUES('主治医师');
+INSERT INTO contact_job_title_pl (val) VALUES('副主任医师');
+INSERT INTO contact_job_title_pl (val) VALUES('主任医师');
+INSERT INTO contact_job_title_pl (val) VALUES('护士');
+INSERT INTO contact_job_title_pl (val) VALUES('主管护师');
+INSERT INTO contact_job_title_pl (val) VALUES('副主任护士');
+INSERT INTO contact_job_title_pl (val) VALUES('主任护师');
+INSERT INTO contact_job_title_pl (val) VALUES('药师');
+INSERT INTO contact_job_title_pl (val) VALUES('主管药师');
+INSERT INTO contact_job_title_pl (val) VALUES('副主任药师');
+INSERT INTO contact_job_title_pl (val) VALUES('主任药师');
+INSERT INTO contact_job_title_pl (val) VALUES('技师');
+INSERT INTO contact_job_title_pl (val) VALUES('主管技师');
+INSERT INTO contact_job_title_pl (val) VALUES('副主任技师');
+INSERT INTO contact_job_title_pl (val) VALUES('主任技师');
+INSERT INTO contact_job_title_pl (val) VALUES('其他');
+
+-- 状态;
+drop table if exists contact_status_pl;
+CREATE TABLE contact_status_pl
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+INSERT INTO contact_status_pl (val) VALUES('无效');
+INSERT INTO contact_status_pl (val) VALUES('有效');
+
+-- 级别;
+drop table if exists contact_grade_pl;
+CREATE TABLE contact_grade_pl
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+INSERT INTO contact_grade_pl (val) VALUES('A');
+INSERT INTO contact_grade_pl (val) VALUES('B');
+INSERT INTO contact_grade_pl (val) VALUES('C');
+INSERT INTO contact_grade_pl (val) VALUES('D');
+
+drop table if exists contact_market_classification_pl;
+CREATE TABLE contact_market_classification_pl
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+INSERT INTO contact_market_classification_pl (val) VALUES ('战略城市');
+INSERT INTO contact_market_classification_pl (val) VALUES('一级城市');
+INSERT INTO contact_market_classification_pl (val) VALUES('二级城市');
+INSERT INTO contact_market_classification_pl (val) VALUES('三级城市');
+INSERT INTO contact_market_classification_pl (val) VALUES('四级城市');
+
+
+drop table if exists contact_generalization_target_pl;
+CREATE TABLE contact_generalization_target_pl
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+INSERT INTO contact_generalization_target_pl (val) VALUES ('美施康定');
+INSERT INTO contact_generalization_target_pl (val) VALUES('奥施康定');
+INSERT INTO contact_generalization_target_pl (val) VALUES('奇曼丁');
+INSERT INTO contact_generalization_target_pl (val) VALUES('若思本');
+INSERT INTO contact_generalization_target_pl (val) VALUES('奥诺美');
+
+
+-- pick list for crmuser
+-- 状态;
+drop table if exists crmuser_pl1;
+CREATE TABLE crmuser_pl1
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+INSERT INTO `crmuser_pl1` (val) VALUES ('无效');
+INSERT INTO `crmuser_pl1` (val) VALUES ('有效');
+
+-- 产品线;
+drop table if exists crmuser_pl2;
+CREATE TABLE crmuser_pl2
+(
+ id MEDIUMINT NOT NULL,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+-- 产品线;
+INSERT INTO crmuser_pl2 (id,val) VALUES(1,'麻药');
+INSERT INTO crmuser_pl2 (id,val) VALUES(2,'慢痛');
+INSERT INTO crmuser_pl2 (id,val) VALUES(3,'奥诺美');
+INSERT INTO crmuser_pl2 (id,val) VALUES(4,'全部');
+
+
+-- 角色;
+drop table if exists role;
+CREATE TABLE role
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+INSERT INTO `role` (val) VALUES ('管理员');
+INSERT INTO `role` (val) VALUES ('销售经理');
+INSERT INTO `role` (val) VALUES ('销售代表');
+
+-- 一级区域;
+drop table if exists region_level1_pl;
+CREATE TABLE region_level1_pl
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+
+INSERT INTO region_level1_pl (val) VALUES('北中国');
+INSERT INTO region_level1_pl (val) VALUES('南中国');
+INSERT INTO region_level1_pl (val) VALUES('东中国');
+
+-- 二级区域;
+drop table if exists region_level2_pl;
+CREATE TABLE region_level2_pl
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+INSERT INTO region_level2_pl (val) VALUES('华北');
+INSERT INTO region_level2_pl (val) VALUES('西北');
+INSERT INTO region_level2_pl (val) VALUES('东北');
+INSERT INTO region_level2_pl (val) VALUES('西南');
+INSERT INTO region_level2_pl (val) VALUES('华南');
+INSERT INTO region_level2_pl (val) VALUES('华中');
+INSERT INTO region_level2_pl (val) VALUES('华东');
+
+-- END of pick list for crmuser
+
+drop table if exists city;
+CREATE TABLE city
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ name VARCHAR(255) NOT NULL,
+ provinceId VARCHAR(255) NOT NULL,
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+
+drop table if exists province;
+CREATE TABLE province
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ name VARCHAR(255) NOT NULL,
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+
+
+-- 拜访类型
+INSERT INTO activity_types (val) VALUES('拜访');
+INSERT INTO activity_types (val) VALUES('外部会议');
+INSERT INTO activity_types (val) VALUES('内部会议');
+
+
+DROP TABLE IF EXISTS `score1_pl`;
+CREATE TABLE `score1_pl` (
+ `id` int(11) NOT NULL DEFAULT '0',
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+INSERT INTO `score1_pl` VALUES (0,'0'),(1,'1'),(2,'2'),(3,'3'),(4,'4'),(5,'5'),(6,'6'),(7,'7'),(8,'8'),(9,'9'),(10,'10'),(11,'11'),(12,'12'),(13,'13'),(14,'14'),(15,'15');
+
+
+DROP TABLE IF EXISTS `score2_pl`;
+CREATE TABLE `score2_pl` (
+ `id` int(11) NOT NULL DEFAULT '0',
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+INSERT INTO `score2_pl` VALUES (0,'0'),(1,'1'),(2,'2'),(3,'3'),(4,'4'),(5,'5'),(6,'6'),(7,'7'),(8,'8'),(9,'9'),(10,'10'),(11,'11'),(12,'12'),(13,'13'),(14,'14'),(15,'15'),(16,'16'),(17,'17'),(18,'18'),(19,'19'),(20,'20');
+
+
+DROP TABLE IF EXISTS `crmuser_activited`;
+CREATE TABLE `crmdb`.`crmuser_activited` (
+ `id` MEDIUMINT(9) NOT NULL AUTO_INCREMENT,
+ `val` VARCHAR(255) NULL,
+ PRIMARY KEY (`id`)
+ )ENGINE=InnoDB;
+INSERT INTO `crmdb`.`crmuser_activited` (`id`, `val`) VALUES ('1', '已激活');
+INSERT INTO `crmdb`.`crmuser_activited` (`id`, `val`) VALUES ('2', '未激活');
+
+
+DROP TABLE IF EXISTS `area`;
+DROP TABLE IF EXISTS `city`;
+DROP TABLE IF EXISTS `province`;
+
+DROP TABLE IF EXISTS `area`;
+CREATE TABLE `area` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `val` varchar(20) DEFAULT NULL,
+ `externalId` varchar(20) DEFAULT NULL,
+ `parentId` int(11) NOT NULL,
+ PRIMARY KEY (`id`),
+ CONSTRAINT `area_parentid_cons` FOREIGN KEY (`parentId`) REFERENCES `city` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE InnoDB;
+
+DROP TABLE IF EXISTS `city`;
+CREATE TABLE `city` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `val` varchar(20) DEFAULT NULL,
+ `externalId` varchar(20) DEFAULT NULL,
+ `parentId` int(11) NOT NULL,
+ PRIMARY KEY (`id`),
+ CONSTRAINT `city_parentid_cons` FOREIGN KEY (`parentId`) REFERENCES `province` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE InnoDB;
+
+DROP TABLE IF EXISTS `province`;
+CREATE TABLE `province` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `val` varchar(20) DEFAULT NULL,
+ `externalId` varchar(20) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE InnoDB;
+
+
+insert into crmuser (id,name) values(-1,"dummy");
+insert into account (id,name) values(-1,"dummy");
+insert into contact (id,name,accountId) values(-1,"dummy",-1);
+
+
+
+
+
+-- ramdom update table for testing purpose
+UPDATE activity SET contactId = FLOOR(78* RAND()+1);
+INSERT INTO contactcrmuser (contactId,crmuserId) VALUES(FLOOR(78* RAND()+1),20);
+UPDATE crmuser SET loginName = FLOOR(1000000* RAND()+1000);
+UPDATE crmuser SET password = FLOOR(1000000* RAND()+1000);
+UPDATE crmuser SET sessionKey = FLOOR(1000000* RAND()+1000);
+
+
diff --git a/crm/src/main/db/setup.sql b/crm/src/main/db/setup.sql
new file mode 100644
index 0000000..f89b7ba
--- /dev/null
+++ b/crm/src/main/db/setup.sql
@@ -0,0 +1,343 @@
+USE crmdb;
+
+drop table if exists accountcrmuser;
+drop table if exists activitycrmuser;
+drop table if exists contactcrmuser;
+drop table if exists activity;
+drop table if exists contact;
+drop table if exists crmuser;
+drop table if exists account;
+
+drop table if exists account;
+CREATE TABLE account
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ name VARCHAR(255) NOT NULL,
+ bdm_code VARCHAR(255),
+ administrativ_level VARCHAR(255),
+ grade VARCHAR(255),
+ hospital_type MEDIUMINT,
+ local_or_army MEDIUMINT,
+ comprehensive_or_specialized MEDIUMINT,
+ key_type MEDIUMINT,
+ status MEDIUMINT,
+ duty_officer VARCHAR(255),
+ num_of_doctors MEDIUMINT,
+ num_of_assistant_doctors MEDIUMINT,
+ num_of_staff MEDIUMINT,
+ num_of_treat_per_year MEDIUMINT,
+ num_of_outpatient MEDIUMINT,
+ total_num_of_sickbed MEDIUMINT,
+ num_of_anesthesia_doctor MEDIUMINT,
+ num_of_pain_doctor MEDIUMINT,
+ num_of_surgery_per_year MEDIUMINT,
+ num_of_surgery_room MEDIUMINT,
+ num_of_using_opiates_medicine MEDIUMINT,
+ num_of_using_opiates_injection MEDIUMINT,
+ date_of_establish DATETIME,
+ registered_capital MEDIUMINT,
+ tel VARCHAR(255),
+ fax VARCHAR(255),
+ market_classification MEDIUMINT,
+ province int(11),
+ city int(11),
+ districts VARCHAR(255),
+ address VARCHAR(255),
+ owner VARCHAR(255),
+ whenadded DATETIME,
+ modifier VARCHAR(255),
+ modify_datetime DATETIME,
+ responsible_person VARCHAR(255),
+ UNIQUE INDEX `account_ix_01` (`bdm_code` ASC),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+
+drop table if exists crmuser;
+CREATE TABLE crmuser
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ name VARCHAR(255) NOT NULL,
+ code varchar(255),
+ reportto MEDIUMINT,
+ role MEDIUMINT,
+ pl1 MEDIUMINT,
+ pl2 MEDIUMINT,
+ pl4 MEDIUMINT,
+ pl5 MEDIUMINT,
+ city VARCHAR(255),
+ department VARCHAR(255),
+ whenadded DATETIME,
+ modifier VARCHAR(255),
+ modify_datetime date,
+ owner VARCHAR(255),
+ level MEDIUMINT,
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+insert into crmuser (id,name,code,reportto,role) values
+(-1,'无','BJ',0,-1),
+(1,'管理员','BJ231011001',-1,1),
+(2,'北区地区经理01','BJ131011001',1,2),
+(3,'北区代表001','BJ131001001',2,3);
+
+
+
+drop table if exists accountcrmuser;
+CREATE TABLE accountcrmuser
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ accountId MEDIUMINT NOT NULL,
+ crmuserId MEDIUMINT NOT NULL,
+ UNIQUE KEY(accountId,crmuserId),
+ PRIMARY KEY USING BTREE (id),
+ CONSTRAINT `account_crmuser_cons` FOREIGN KEY (`accountId`) REFERENCES `account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `account_crmuser_cons2` FOREIGN KEY (`crmuserId`) REFERENCES `crmuser` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE InnoDB;
+
+drop table if exists contact;
+CREATE TABLE contact
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ name VARCHAR(255) NOT NULL,
+ accountId MEDIUMINT NOT NULL,
+ department VARCHAR(255),
+ sex MEDIUMINT,
+ native_place VARCHAR(255),
+ office_tel VARCHAR(255),
+ office_fax VARCHAR(255),
+ cellphone VARCHAR(255),
+ email VARCHAR(255),
+ status VARCHAR(255),
+ market_classification MEDIUMINT,
+ grade MEDIUMINT,
+ province int(11),
+ city int(11),
+ districts VARCHAR(255),
+ duty MEDIUMINT,
+ job_title MEDIUMINT,
+ visiting_target MEDIUMINT,
+ product_target VARCHAR(255),
+ owner VARCHAR(255),
+ whenadded DATETIME,
+ modifier VARCHAR(255),
+ modify_datetime DATETIME,
+ responsible_person VARCHAR(255),
+ PRIMARY KEY USING BTREE (id),
+ CONSTRAINT `account_id_cons` FOREIGN KEY (`accountId`) REFERENCES `account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE InnoDB;
+
+
+
+drop table if exists activity;
+CREATE TABLE activity
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ name VARCHAR(255),
+ crmuserId MEDIUMINT NOT NULL,
+ event_type MEDIUMINT NOT NULL,
+ endtime BIGINT,
+ starttime BIGINT NOT NULL DEFAULT 0,
+ title VARCHAR(128),
+ participants VARCHAR(512),
+ activity_type MEDIUMINT,
+ contactId MEDIUMINT,
+ coacheeId int(32),
+ status MEDIUMINT,
+ visiting_purpose MEDIUMINT,
+ feature_product MEDIUMINT,
+ act_endtime DATETIME,
+ owner VARCHAR(255),
+ whenadded DATETIME,
+ modifier VARCHAR(255),
+ modify_datetime DATETIME,
+ responsible_person VARCHAR(255),
+ coach int(32),
+ location VARCHAR(255),
+ total_score MEDIUMINT,
+ planing MEDIUMINT,
+ openling MEDIUMINT,
+ enquery_listening MEDIUMINT,
+ deliverable MEDIUMINT,
+ objection_handing MEDIUMINT,
+ summary MEDIUMINT,
+ PRIMARY KEY USING BTREE (id),
+ CONSTRAINT `crmuserId_activity_cons` FOREIGN KEY (`crmuserId`) REFERENCES `crmuser` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `contactId_activity_cons` FOREIGN KEY (`contactId`) REFERENCES `contact` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE InnoDB;
+
+drop table if exists activitycrmuser;
+CREATE TABLE activitycrmuser
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ activityId MEDIUMINT NOT NULL,
+ crmuserId MEDIUMINT NOT NULL,
+ UNIQUE KEY(activityId,crmuserId),
+ PRIMARY KEY USING BTREE (id),
+ CONSTRAINT `crm_activity_cons` FOREIGN KEY (`crmuserId`) REFERENCES `crmuser` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ,
+ CONSTRAINT `crm_activity_cons2` FOREIGN KEY (`activityId`) REFERENCES `activity` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE InnoDB;
+
+
+drop table if exists contactcrmuser;
+CREATE TABLE contactcrmuser
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ contactId MEDIUMINT NOT NULL,
+ crmuserId MEDIUMINT NOT NULL,
+ UNIQUE KEY(contactId,crmuserId),
+ PRIMARY KEY USING BTREE (id),
+ CONSTRAINT `crm_contact_cons1` FOREIGN KEY (`crmuserId`) REFERENCES `crmuser` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `crm_contact_cons2` FOREIGN KEY (`contactId`) REFERENCES `contact` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE InnoDB;
+
+
+
+drop table if exists user_position;
+create table user_position (
+ id mediumint(9) auto_increment,
+ userId int(32),
+ positionId int(32),
+ primary key (id),
+ unique index user_position_unique (userId,positionId)
+)ENGINE InnoDB;
+
+DROP TABLE IF EXISTS userInfo;
+CREATE TABLE userInfo (
+ id mediumint(9) NOT NULL AUTO_INCREMENT,
+ name varchar(255) NOT NULL,
+ department varchar(255) DEFAULT NULL,
+ division varchar(255) DEFAULT NULL,
+ cellPhone varchar(255) DEFAULT NULL,
+ email varchar(255) DEFAULT NULL,
+ employeeNumber varchar(255) DEFAULT NULL,
+ photo varchar(255) DEFAULT NULL,
+ jobTitle varchar(255) DEFAULT NULL,
+ pl1 mediumint(9) DEFAULT NULL,
+ pl2 mediumint(9) DEFAULT NULL,
+ role mediumint(9) DEFAULT NULL,
+ pl4 mediumint(9) DEFAULT NULL,
+ pl5 mediumint(9) DEFAULT NULL,
+ sex mediumint(9) DEFAULT NULL,
+ loginName varchar(255) DEFAULT NULL,
+ password varchar(255) DEFAULT NULL,
+ sessionKey varchar(255) DEFAULT NULL,
+ lastLoginTime bigint(20) DEFAULT NULL,
+ whenadded datetime DEFAULT NULL,
+ parcel varchar(255) DEFAULT NULL,
+ modifier varchar(255) DEFAULT NULL,
+ modify_datetime datetime DEFAULT NULL,
+ owner varchar(255) DEFAULT NULL,
+ province int(11),
+ city int(11),
+ isActivited mediumint(9) DEFAULT NULL,
+ ts bigint(20) DEFAULT NULL,
+ positionId mediumint(9) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE InnoDB;
+
+INSERT INTO `userInfo` (id,name,loginname,password,role,isActivited,ts,positionId,pl1) VALUES
+(-1,'无','dummy','827ccb0eea8a706c4c34a16891f84e7b',1,2,1386766666,-1,1),
+(1,'Admin Nam','admin','827ccb0eea8a706c4c34a16891f84e7b',1,2,1386766666,1,1),
+(2,'Sales Manager','salesman','827ccb0eea8a706c4c34a16891f84e7b',2,2,1386766666,2,1),
+(3,'Sales','sales','827ccb0eea8a706c4c34a16891f84e7b',3,2,1386766666,3,1);
+
+
+drop table if exists externalMeeting;
+CREATE TABLE externalMeeting
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ crmuserId MEDIUMINT NOT NULL,
+ endtime BIGINT,
+ starttime BIGINT NOT NULL DEFAULT 0,
+ title VARCHAR(128),
+ contactIds VARCHAR(512),
+ status MEDIUMINT,
+ activity_type MEDIUMINT,
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+ALTER table externalMeeting ADD coachId MEDIUMINT;
+
+drop table if exists internalMeeting;
+CREATE TABLE internalMeeting
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ crmuserId MEDIUMINT NOT NULL,
+ endtime BIGINT,
+ starttime BIGINT NOT NULL DEFAULT 0,
+ title VARCHAR(128),
+ contactId MEDIUMINT,
+ crmusermanagerId MEDIUMINT,
+ status MEDIUMINT,
+ activity_type MEDIUMINT,
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+
+
+DROP TABLE IF EXISTS `data_exchange_teample`;
+DROP TABLE IF EXISTS `data_exchange_operation`;
+DROP TABLE IF EXISTS data_exchange_status;
+DROP TABLE IF EXISTS `record_type`;
+
+DROP TABLE IF EXISTS `record_type`;
+CREATE TABLE `record_type` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `version` bigint(20) NOT NULL,
+ `val` varchar(255) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `val` (`val`)
+) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
+INSERT INTO `record_type` VALUES (1,0,'Account'),(2,0,'Contact'),(3,0,'Call'),(4,0,'Coaching'),(5,0,'AccuntTeam'),(6,0,'ContactTeam');
+
+DROP TABLE IF EXISTS data_exchange_status;
+CREATE TABLE data_exchange_status (
+ id bigint(20) NOT NULL AUTO_INCREMENT,
+ version bigint(20) NOT NULL,
+ val varchar(255) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `val` (`val`)
+) ENGINE=InnoDB;
+INSERT INTO `data_exchange_status` VALUES (1,0,'Pending'),(2,0,'Abort'),(3,0,'Completed'),(4,0,'Cancelled');
+
+DROP TABLE IF EXISTS `data_exchange_operation`;
+CREATE TABLE `data_exchange_operation` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `version` bigint(20) NOT NULL,
+ `val` varchar(255) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `val` (`val`)
+) ENGINE=InnoDB;
+INSERT INTO `data_exchange_operation` VALUES (1,0,'Import'),(2,0,'Export');
+
+
+DROP TABLE IF EXISTS `data_exchange_teample`;
+CREATE TABLE `data_exchange_teample` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `version` bigint(20) NOT NULL,
+ `name` varchar(255) NOT NULL,
+ `operation_id` bigint(20) NOT NULL,
+ `type_id` bigint(20) NOT NULL,
+ `template` longtext NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `name` (`name`),
+ KEY `FK8AE35445D557144C` (`type_id`),
+ KEY `FK8AE35445199BCB6C` (`operation_id`),
+ CONSTRAINT `FK8AE35445199BCB6C` FOREIGN KEY (`operation_id`) REFERENCES `data_exchange_operation` (`id`),
+ CONSTRAINT `FK8AE35445D557144C` FOREIGN KEY (`type_id`) REFERENCES `record_type` (`id`)
+) ENGINE=InnoDB;
+
+INSERT INTO `data_exchange_teample` VALUES (1,1,'Account Full Import Template 1.0',1,1,'\r\n\r\n 1000 \r\n Account \r\n BdmCode \r\n account.csv \r\n crm_mysql \r\n \r\n 记录行ID \r\n String \r\n BdmCode \r\n \r\n \r\n \r\n 年诊疗人数 \r\n Integer \r\n NumOfTreatPerYear \r\n \r\n\r\n \r\n 成立时间 \r\n Date \r\n DateOfEstablish \r\n m/d/yy \r\n \r\n \r\n\r\n \r\n 客户名称 \r\n String \r\n Name \r\n \r\n\r\n \r\n 医院行政级别 \r\n Lookup \r\n AdministrativLevel \r\n AccountAdministrativLevelPl \r\n Val \r\n Id \r\n \r\n\r\n \r\n 医院分级 \r\n Lookup \r\n Grade \r\n AccountGradePl \r\n Val \r\n Id \r\n \r\n\r\n \r\n 医院类型 \r\n Lookup \r\n HospitalType \r\n AccountTypePl \r\n Val \r\n Id \r\n \r\n\r\n \r\n 地方军队医院 \r\n Lookup \r\n LocalOrArmy \r\n AccountLocalOrArmyPl \r\n Val \r\n Id \r\n \r\n\r\n \r\n 综合专科医院 \r\n Lookup \r\n ComprehensiveOrSpecialized \r\n AccountComprehensiveOrSpecializedPl \r\n Val \r\n Id \r\n \r\n\r\n \r\n 重点医院 \r\n Lookup \r\n KeyType \r\n AccountPointPl \r\n Val \r\n Id \r\n \r\n\r\n \r\n 状态 \r\n Lookup \r\n Status \r\n AccountStatusPl \r\n Val \r\n Id \r\n \r\n\r\n \r\n 法人 \r\n String \r\n DutyOfficer \r\n \r\n\r\n \r\n 医生数量 \r\n Integer \r\n NumOfDoctors \r\n \r\n\r\n \r\n 助理医师人数 \r\n Integer \r\n NumOfAssistantDoctors \r\n \r\n \r\n \r\n 员工总数 \r\n Integer \r\n NumOfStaff \r\n \r\n\r\n \r\n 门诊人数 \r\n Integer \r\n NumOfOutpatient \r\n \r\n\r\n \r\n 总病床数 \r\n Integer \r\n TotalNumOfSickbed \r\n \r\n\r\n \r\n 麻醉科医生数 \r\n Integer \r\n NumOfAnesthesiaDoctor \r\n \r\n\r\n \r\n 疼痛学组医生数 \r\n Integer \r\n NumOfPainDoctor \r\n \r\n\r\n \r\n 手术量年 \r\n Integer \r\n NumOfSurgeryPerYear \r\n \r\n\r\n \r\n 手术间 \r\n Integer \r\n NumOfSurgeryRoom \r\n \r\n\r\n \r\n 阿片类用药量 \r\n Integer \r\n NumOfUsingOpiatesMedicine \r\n \r\n\r\n \r\n 阿片类注射剂量 \r\n Integer \r\n NumOfUsingOpiatesInjection \r\n \r\n\r\n \r\n 注册资金 \r\n Integer \r\n RegisteredCapital \r\n \r\n\r\n \r\n 主要电话号码 \r\n String \r\n Tel \r\n \r\n\r\n \r\n 主要传真号码 \r\n String \r\n Fax \r\n \r\n\r\n \r\n 市场分类 \r\n Lookup \r\n MarketClassification \r\n AccountMarketClassificationPl \r\n Val \r\n Id \r\n \r\n\r\n \r\n 医院省份 \r\n String \r\n Province \r\n \r\n\r\n \r\n 医院区县 \r\n String \r\n Districts \r\n \r\n \r\n \r\n 医院详细地址 \r\n String \r\n Address \r\n \r\n ');
+
+
+drop table if exists loginhistory;
+CREATE TABLE loginhistory
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ sessionId varchar(128),
+ loginName varchar(256),
+ loginTime datetime,
+ logoutTime datetime,
+ UNIQUE KEY `sessionId` (`sessionId`),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+
+
+
diff --git a/crm/src/main/db/update35.sql b/crm/src/main/db/update35.sql
new file mode 100644
index 0000000..4979096
--- /dev/null
+++ b/crm/src/main/db/update35.sql
@@ -0,0 +1,5 @@
+ALTER TABLE `crmdb`.`role`
+ADD COLUMN `name` VARCHAR(45) NULL AFTER `val`;
+UPDATE `crmdb`.`role` SET `name`='全部' WHERE `id`='1';
+UPDATE `crmdb`.`role` SET `name`='只读' WHERE `id`='2';
+UPDATE `crmdb`.`role` SET `name`='只读' WHERE `id`='3';
diff --git a/crm/src/main/db/update_1.sql b/crm/src/main/db/update_1.sql
new file mode 100644
index 0000000..a5ff31b
--- /dev/null
+++ b/crm/src/main/db/update_1.sql
@@ -0,0 +1,23 @@
+
+ALTER table crmuser ADD ts BIGINT;
+UPDATE `crmdb`.`crmuser` SET `email`='brenda.yuan@rexen.com.cn', `isActivited`='1', `ts`='1382611111318' WHERE `id`='101';
+UPDATE `crmdb`.`crmuser` SET `isActivited`='1', `ts`='1382615122318' WHERE `id`='99';
+UPDATE `crmdb`.`crmuser` SET `isActivited`='1', `ts`='1382613388598' WHERE `id`='100';
+
+
+DROP TABLE IF EXISTS `score1_pl`;
+CREATE TABLE `score1_pl` (
+ `id` int(11) NOT NULL DEFAULT '0',
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+INSERT INTO `score1_pl` VALUES (0,'0'),(1,'1'),(2,'2'),(3,'3'),(4,'4'),(5,'5'),(6,'6'),(7,'7'),(8,'8'),(9,'9'),(10,'10'),(11,'11'),(12,'12'),(13,'13'),(14,'14'),(15,'15');
+
+
+DROP TABLE IF EXISTS `score2_pl`;
+CREATE TABLE `score2_pl` (
+ `id` int(11) NOT NULL DEFAULT '0',
+ `val` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+INSERT INTO `score2_pl` VALUES (0,'0'),(1,'1'),(2,'2'),(3,'3'),(4,'4'),(5,'5'),(6,'6'),(7,'7'),(8,'8'),(9,'9'),(10,'10'),(11,'11'),(12,'12'),(13,'13'),(14,'14'),(15,'15'),(16,'16'),(17,'17'),(18,'18'),(19,'19'),(20,'20');
\ No newline at end of file
diff --git a/crm/src/main/db/update_2.sql b/crm/src/main/db/update_2.sql
new file mode 100644
index 0000000..c3d43bd
--- /dev/null
+++ b/crm/src/main/db/update_2.sql
@@ -0,0 +1,47 @@
+use crmdb;
+
+
+ALTER table account modify province int(11) default 1;
+ALTER table account modify city int(11) default 1;
+update account set province=1,city=1;
+
+ALTER table contact modify province int(11) default 1;
+ALTER table contact modify city int(11) default 1;
+update contact set province=1,city=1;
+
+
+DROP TABLE IF EXISTS `area`;
+DROP TABLE IF EXISTS `city`;
+DROP TABLE IF EXISTS `province`;
+
+
+
+CREATE TABLE `province` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `val` varchar(20) DEFAULT NULL,
+ `externalId` varchar(20) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8;
+
+CREATE TABLE `city` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `val` varchar(20) DEFAULT NULL,
+ `externalId` varchar(20) DEFAULT NULL,
+ `parentId` int(11) NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY `city_parentid_cons` (`parentId`),
+ CONSTRAINT `city_parentid_cons` FOREIGN KEY (`parentId`) REFERENCES `province` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB AUTO_INCREMENT=344 DEFAULT CHARSET=utf8;
+
+CREATE TABLE `area` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `val` varchar(20) DEFAULT NULL,
+ `externalId` varchar(20) DEFAULT NULL,
+ `parentId` int(11) NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY `area_parentid_cons` (`parentId`),
+ CONSTRAINT `area_parentid_cons` FOREIGN KEY (`parentId`) REFERENCES `city` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+INSERT INTO `province` VALUES (1,'北京市','110000'),(2,'天津市','120000'),(3,'河北省','130000'),(4,'山西省','140000'),(5,'内蒙古','150000'),(6,'辽宁省','210000'),(7,'吉林省','220000'),(8,'黑龙江','230000'),(9,'上海市','310000'),(10,'江苏省','320000'),(11,'浙江省','330000'),(12,'安徽省','340000'),(13,'福建省','350000'),(14,'江西省','360000'),(15,'山东省','370000'),(16,'河南省','410000'),(17,'湖北省','420000'),(18,'湖南省','430000'),(19,'广东省','440000'),(20,'广 西','450000'),(21,'海南省','460000'),(22,'重庆市','500000'),(23,'四川省','510000'),(24,'贵州省','520000'),(25,'云南省','530000'),(26,'西 藏','540000'),(27,'陕西省','610000'),(28,'甘肃省','620000'),(29,'青海省','630000'),(30,'宁 夏','640000'),(31,'新 疆','650000'),(32,'台湾省','710000'),(33,'香 港','810000'),(34,'澳 门','820000');
+INSERT INTO `city` VALUES (1,'北京市','110100',1),(2,'石家庄市','130100',3),(3,'唐山市','130200',3),(4,'秦皇岛市','130300',3),(5,'邯郸市','130400',3),(6,'邢台市','130500',3),(7,'保定市','130600',3),(8,'张家口市','130700',3),(9,'承德市','130800',3),(10,'沧州市','130900',3),(11,'廊坊市','131000',3),(12,'衡水市','131100',3),(13,'太原市','140100',4),(14,'大同市','140200',4),(15,'阳泉市','140300',4),(16,'长治市','140400',4),(17,'晋城市','140500',4),(18,'朔州市','140600',4),(19,'晋中市','140700',4),(20,'运城市','140800',4),(21,'忻州市','140900',4),(22,'临汾市','141000',4),(23,'吕梁市','141100',4),(24,'呼和浩特市','150100',5),(25,'包头市','150200',5),(26,'乌海市','150300',5),(27,'赤峰市','150400',5),(28,'通辽市','150500',5),(29,'鄂尔多斯市','150600',5),(30,'呼伦贝尔市','150700',5),(31,'巴彦淖尔市','150800',5),(32,'乌兰察布市','150900',5),(33,'兴安盟','152200',5),(34,'锡林郭勒盟','152500',5),(35,'阿拉善盟','152900',5),(36,'沈阳市','210100',6),(37,'大连市','210200',6),(38,'鞍山市','210300',6),(39,'抚顺市','210400',6),(40,'本溪市','210500',6),(41,'丹东市','210600',6),(42,'锦州市','210700',6),(43,'营口市','210800',6),(44,'阜新市','210900',6),(45,'辽阳市','211000',6),(46,'盘锦市','211100',6),(47,'铁岭市','211200',6),(48,'朝阳市','211300',6),(49,'葫芦岛市','211400',6),(50,'长春市','220100',7),(51,'吉林市','220200',7),(52,'四平市','220300',7),(53,'辽源市','220400',7),(54,'通化市','220500',7),(55,'白山市','220600',7),(56,'松原市','220700',7),(57,'白城市','220800',7),(58,'延边朝鲜族自治州','222400',7),(59,'哈尔滨市','230100',8),(60,'齐齐哈尔市','230200',8),(61,'鸡西市','230300',8),(62,'鹤岗市','230400',8),(63,'双鸭山市','230500',8),(64,'大庆市','230600',8),(65,'伊春市','230700',8),(66,'佳木斯市','230800',8),(67,'七台河市','230900',8),(68,'牡丹江市','231000',8),(69,'黑河市','231100',8),(70,'绥化市','231200',8),(71,'大兴安岭地区','232700',8),(72,'市辖区','310100',9),(73,'县','310200',9),(74,'南京市','320100',10),(75,'无锡市','320200',10),(76,'徐州市','320300',10),(77,'常州市','320400',10),(78,'苏州市','320500',10),(79,'南通市','320600',10),(80,'连云港市','320700',10),(81,'淮安市','320800',10),(82,'盐城市','320900',10),(83,'扬州市','321000',10),(84,'镇江市','321100',10),(85,'泰州市','321200',10),(86,'宿迁市','321300',10),(87,'杭州市','330100',11),(88,'宁波市','330200',11),(89,'温州市','330300',11),(90,'嘉兴市','330400',11),(91,'湖州市','330500',11),(92,'绍兴市','330600',11),(93,'金华市','330700',11),(94,'衢州市','330800',11),(95,'舟山市','330900',11),(96,'台州市','331000',11),(97,'丽水市','331100',11),(98,'合肥市','340100',12),(99,'芜湖市','340200',12),(100,'蚌埠市','340300',12),(101,'淮南市','340400',12),(102,'马鞍山市','340500',12),(103,'淮北市','340600',12),(104,'铜陵市','340700',12),(105,'安庆市','340800',12),(106,'黄山市','341000',12),(107,'滁州市','341100',12),(108,'阜阳市','341200',12),(109,'宿州市','341300',12),(110,'巢湖市','341400',12),(111,'六安市','341500',12),(112,'亳州市','341600',12),(113,'池州市','341700',12),(114,'宣城市','341800',12),(115,'福州市','350100',13),(116,'厦门市','350200',13),(117,'莆田市','350300',13),(118,'三明市','350400',13),(119,'泉州市','350500',13),(120,'漳州市','350600',13),(121,'南平市','350700',13),(122,'龙岩市','350800',13),(123,'宁德市','350900',13),(124,'南昌市','360100',14),(125,'景德镇市','360200',14),(126,'萍乡市','360300',14),(127,'九江市','360400',14),(128,'新余市','360500',14),(129,'鹰潭市','360600',14),(130,'赣州市','360700',14),(131,'吉安市','360800',14),(132,'宜春市','360900',14),(133,'抚州市','361000',14),(134,'上饶市','361100',14),(135,'济南市','370100',15),(136,'青岛市','370200',15),(137,'淄博市','370300',15),(138,'枣庄市','370400',15),(139,'东营市','370500',15),(140,'烟台市','370600',15),(141,'潍坊市','370700',15),(142,'济宁市','370800',15),(143,'泰安市','370900',15),(144,'威海市','371000',15),(145,'日照市','371100',15),(146,'莱芜市','371200',15),(147,'临沂市','371300',15),(148,'德州市','371400',15),(149,'聊城市','371500',15),(150,'滨州市','371600',15),(151,'荷泽市','371700',15),(152,'郑州市','410100',16),(153,'开封市','410200',16),(154,'洛阳市','410300',16),(155,'平顶山市','410400',16),(156,'安阳市','410500',16),(157,'鹤壁市','410600',16),(158,'新乡市','410700',16),(159,'焦作市','410800',16),(160,'濮阳市','410900',16),(161,'许昌市','411000',16),(162,'漯河市','411100',16),(163,'三门峡市','411200',16),(164,'南阳市','411300',16),(165,'商丘市','411400',16),(166,'信阳市','411500',16),(167,'周口市','411600',16),(168,'驻马店市','411700',16),(169,'武汉市','420100',17),(170,'黄石市','420200',17),(171,'十堰市','420300',17),(172,'宜昌市','420500',17),(173,'襄樊市','420600',17),(174,'鄂州市','420700',17),(175,'荆门市','420800',17),(176,'孝感市','420900',17),(177,'荆州市','421000',17),(178,'黄冈市','421100',17),(179,'咸宁市','421200',17),(180,'随州市','421300',17),(181,'恩施土家族苗族自治州','422800',17),(182,'省直辖行政单位','429000',17),(183,'长沙市','430100',18),(184,'株洲市','430200',18),(185,'湘潭市','430300',18),(186,'衡阳市','430400',18),(187,'邵阳市','430500',18),(188,'岳阳市','430600',18),(189,'常德市','430700',18),(190,'张家界市','430800',18),(191,'益阳市','430900',18),(192,'郴州市','431000',18),(193,'永州市','431100',18),(194,'怀化市','431200',18),(195,'娄底市','431300',18),(196,'湘西土家族苗族自治州','433100',18),(197,'广州市','440100',19),(198,'韶关市','440200',19),(199,'深圳市','440300',19),(200,'珠海市','440400',19),(201,'汕头市','440500',19),(202,'佛山市','440600',19),(203,'江门市','440700',19),(204,'湛江市','440800',19),(205,'茂名市','440900',19),(206,'肇庆市','441200',19),(207,'惠州市','441300',19),(208,'梅州市','441400',19),(209,'汕尾市','441500',19),(210,'河源市','441600',19),(211,'阳江市','441700',19),(212,'清远市','441800',19),(213,'东莞市','441900',19),(214,'中山市','442000',19),(215,'潮州市','445100',19),(216,'揭阳市','445200',19),(217,'云浮市','445300',19),(218,'南宁市','450100',20),(219,'柳州市','450200',20),(220,'桂林市','450300',20),(221,'梧州市','450400',20),(222,'北海市','450500',20),(223,'防城港市','450600',20),(224,'钦州市','450700',20),(225,'贵港市','450800',20),(226,'玉林市','450900',20),(227,'百色市','451000',20),(228,'贺州市','451100',20),(229,'河池市','451200',20),(230,'来宾市','451300',20),(231,'崇左市','451400',20),(232,'海口市','460100',21),(233,'三亚市','460200',21),(234,'省直辖县级行政单位','469000',21),(235,'市辖区','500100',22),(236,'县','500200',22),(237,'市','500300',22),(238,'成都市','510100',23),(239,'自贡市','510300',23),(240,'攀枝花市','510400',23),(241,'泸州市','510500',23),(242,'德阳市','510600',23),(243,'绵阳市','510700',23),(244,'广元市','510800',23),(245,'遂宁市','510900',23),(246,'内江市','511000',23),(247,'乐山市','511100',23),(248,'南充市','511300',23),(249,'眉山市','511400',23),(250,'宜宾市','511500',23),(251,'广安市','511600',23),(252,'达州市','511700',23),(253,'雅安市','511800',23),(254,'巴中市','511900',23),(255,'资阳市','512000',23),(256,'阿坝藏族羌族自治州','513200',23),(257,'甘孜藏族自治州','513300',23),(258,'凉山彝族自治州','513400',23),(259,'贵阳市','520100',24),(260,'六盘水市','520200',24),(261,'遵义市','520300',24),(262,'安顺市','520400',24),(263,'铜仁地区','522200',24),(264,'黔西南布依族苗族自治州','522300',24),(265,'毕节地区','522400',24),(266,'黔东南苗族侗族自治州','522600',24),(267,'黔南布依族苗族自治州','522700',24),(268,'昆明市','530100',25),(269,'曲靖市','530300',25),(270,'玉溪市','530400',25),(271,'保山市','530500',25),(272,'昭通市','530600',25),(273,'丽江市','530700',25),(274,'思茅市','530800',25),(275,'临沧市','530900',25),(276,'楚雄彝族自治州','532300',25),(277,'红河哈尼族彝族自治州','532500',25),(278,'文山壮族苗族自治州','532600',25),(279,'西双版纳傣族自治州','532800',25),(280,'大理白族自治州','532900',25),(281,'德宏傣族景颇族自治州','533100',25),(282,'怒江傈僳族自治州','533300',25),(283,'迪庆藏族自治州','533400',25),(284,'拉萨市','540100',26),(285,'昌都地区','542100',26),(286,'山南地区','542200',26),(287,'日喀则地区','542300',26),(288,'那曲地区','542400',26),(289,'阿里地区','542500',26),(290,'林芝地区','542600',26),(291,'西安市','610100',27),(292,'铜川市','610200',27),(293,'宝鸡市','610300',27),(294,'咸阳市','610400',27),(295,'渭南市','610500',27),(296,'延安市','610600',27),(297,'汉中市','610700',27),(298,'榆林市','610800',27),(299,'安康市','610900',27),(300,'商洛市','611000',27),(301,'兰州市','620100',28),(302,'嘉峪关市','620200',28),(303,'金昌市','620300',28),(304,'白银市','620400',28),(305,'天水市','620500',28),(306,'武威市','620600',28),(307,'张掖市','620700',28),(308,'平凉市','620800',28),(309,'酒泉市','620900',28),(310,'庆阳市','621000',28),(311,'定西市','621100',28),(312,'陇南市','621200',28),(313,'临夏回族自治州','622900',28),(314,'甘南藏族自治州','623000',28),(315,'西宁市','630100',29),(316,'海东地区','632100',29),(317,'海北藏族自治州','632200',29),(318,'黄南藏族自治州','632300',29),(319,'海南藏族自治州','632500',29),(320,'果洛藏族自治州','632600',29),(321,'玉树藏族自治州','632700',29),(322,'海西蒙古族藏族自治州','632800',29),(323,'银川市','640100',30),(324,'石嘴山市','640200',30),(325,'吴忠市','640300',30),(326,'固原市','640400',30),(327,'中卫市','640500',30),(328,'乌鲁木齐市','650100',31),(329,'克拉玛依市','650200',31),(330,'吐鲁番地区','652100',31),(331,'哈密地区','652200',31),(332,'昌吉回族自治州','652300',31),(333,'博尔塔拉蒙古自治州','652700',31),(334,'巴音郭楞蒙古自治州','652800',31),(335,'阿克苏地区','652900',31),(336,'克孜勒苏柯尔克孜自治州','653000',31),(337,'喀什地区','653100',31),(338,'和田地区','653200',31),(339,'伊犁哈萨克自治州','654000',31),(340,'塔城地区','654200',31),(341,'阿勒泰地区','654300',31),(342,'省直辖行政单位','659000',31),(343,'天津',NULL,2);
diff --git a/crm/src/main/db/update_20.sql b/crm/src/main/db/update_20.sql
new file mode 100644
index 0000000..cc91922
--- /dev/null
+++ b/crm/src/main/db/update_20.sql
@@ -0,0 +1,116 @@
+use crmdb;
+ALTER TABLE `crmdb`.`contact`
+ADD COLUMN `contactCode` VARCHAR(255) NULL AFTER `responsible_person`,
+ADD UNIQUE INDEX `contactCode_UNIQUE` (`contactCode` ASC);
+
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('14', '保健科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('15', '采购科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('16', '传染科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('17', '创伤外科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('18', '儿科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('19', '耳鼻喉科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('20', '方便门诊');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('21', '放化疗科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('22', '放疗科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('23', '放射科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('24', '妇产科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('25', '妇科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('26', '感染科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('27', '肛肠科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('28', '姑息科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('29', '国际医疗科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('30', '核医学科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('31', '呼吸内科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('32', '护理科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('33', '急诊科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('34', '介入科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('35', '康复科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('36', '口腔科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('37', '老干科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('38', '麻醉科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('39', '泌尿外科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('40', '脑外科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('41', '内分泌科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('42', '宁养科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('43', '皮肤科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('44', '普外科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('45', '其他');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('46', '乳腺外科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('47', '烧伤整形科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('48', '神经科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('49', '神经内科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('50', '神经外科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('51', '肾内科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('52', '生物治疗科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('53', '特需科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('54', '疼痛科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('55', '微创科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('56', '胃肠外科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('57', '消化科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('58', '消化内科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('59', '消化外科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('60', '心内科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('61', '心胸外科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('62', '血管外科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('63', '血透科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('64', '药剂科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('65', '医保办');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('66', '医务科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('67', '整形美容科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('68', '质控科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('69', '中西医结合科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('70', '肿瘤科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('71', '肿瘤内科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('72', '肿瘤外科');
+INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('73', '综合科');
+
+
+INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('9', '医生');
+INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('10', '副主任');
+INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('11', '院长助理');
+INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('12', '书记');
+INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('13', '副书记');
+INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('14', '护士');
+INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('15', '护士长');
+INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('16', '库管');
+INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('17', '采购科科长');
+INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('18', '药师');
+INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('19', '药剂科副主任');
+INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('20', '医务科科长');
+INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('21', '医务科副科长');
+INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('22', '医保办主任');
+INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('23', '科教科主任');
+INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('24', '信息卡科长');
+INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('25', '其他');
+
+UPDATE `crmdb`.`contact_job_title_pl` SET `val`='主管护士' WHERE `id`='6';
+INSERT INTO `crmdb`.`contact_job_title_pl` (`id`, `val`) VALUES ('9', '副主任护士');
+INSERT INTO `crmdb`.`contact_job_title_pl` (`id`, `val`) VALUES ('10', '主任护师');
+INSERT INTO `crmdb`.`contact_job_title_pl` (`id`, `val`) VALUES ('11', '主管药师');
+INSERT INTO `crmdb`.`contact_job_title_pl` (`id`, `val`) VALUES ('12', '副主任药师');
+INSERT INTO `crmdb`.`contact_job_title_pl` (`id`, `val`) VALUES ('13', '主任药师');
+INSERT INTO `crmdb`.`contact_job_title_pl` (`id`, `val`) VALUES ('14', '主管技师');
+INSERT INTO `crmdb`.`contact_job_title_pl` (`id`, `val`) VALUES ('15', '副主任技师');
+INSERT INTO `crmdb`.`contact_job_title_pl` (`id`, `val`) VALUES ('16', '主任技师');
+INSERT INTO `crmdb`.`contact_job_title_pl` (`id`, `val`) VALUES ('17', '其他');
+
+
+ALTER TABLE `crmdb`.`userinfo`
+ADD COLUMN `office_tel` VARCHAR(255) NULL AFTER `positionId`;
+
+DROP TABLE IF EXISTS `activity_whethercoach_pl`;
+CREATE TABLE `crmdb`.`activity_whethercoach_pl` (
+ `id` MEDIUMINT(9) NOT NULL,
+ `val` VARCHAR(255) NULL,
+ PRIMARY KEY (`id`)
+ ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
+
+INSERT INTO `crmdb`.`activity_whethercoach_pl` (`id`, `val`) VALUES ('1', '否');
+INSERT INTO `crmdb`.`activity_whethercoach_pl` (`id`, `val`) VALUES ('2', '协防半天');
+INSERT INTO `crmdb`.`activity_whethercoach_pl` (`id`, `val`) VALUES ('3', '协防一天');
+
+UPDATE `crmdb`.`activity_event_type_pl` SET `val`='拜访辅导' WHERE `id`='2';
+INSERT INTO `crmdb`.`activity_event_type_pl` (`id`, `val`) VALUES ('3', '科室会辅导');
+
+ALTER TABLE `crmdb`.`activity`
+ADD COLUMN `whetherCoach` MEDIUMINT(9) NULL AFTER `summary`;
\ No newline at end of file
diff --git a/crm/src/main/db/update_21.sql b/crm/src/main/db/update_21.sql
new file mode 100644
index 0000000..f3f3f18
--- /dev/null
+++ b/crm/src/main/db/update_21.sql
@@ -0,0 +1,27 @@
+use crmdb;
+UPDATE `crmdb`.`activity_whethercoach_pl` SET `val`='协访半天' WHERE `id`='2';
+UPDATE `crmdb`.`activity_whethercoach_pl` SET `val`='协访一天' WHERE `id`='3';
+UPDATE `crmdb`.`crmuser_activited` SET `id`='0', `val`='未激活' WHERE `id`='1';
+UPDATE `crmdb`.`crmuser_activited` SET `id`='1', `val`='已激活' WHERE `id`='2';
+DELETE FROM `crmdb`.`activity_whethercoach_pl` WHERE `id`='1';
+UPDATE `crmdb`.`activity_whethercoach_pl` SET `id`='1' WHERE `id`='2';
+UPDATE `crmdb`.`activity_whethercoach_pl` SET `id`='2' WHERE `id`='3';
+UPDATE `crmdb`.`userinfo` SET `email`='tigerzhou@rexen.com.cn', `sex`='1', `isActivited`='1' WHERE `id`='1';
+UPDATE `crmdb`.`userinfo` SET `email`='alexsong@rexen.com.cn', `sex`='1', `isActivited`='1' WHERE `id`='2';
+UPDATE `crmdb`.`userinfo` SET `email`='feiyunzhou@rexen.com.cn', `sex`='1', `isActivited`='1' WHERE `id`='3';
+UPDATE `crmdb`.`userinfo` SET `sex`='1', `isActivited`='1' WHERE `id`='-1';
+UPDATE `crmdb`.`userinfo` SET `city`='1' WHERE `id`='1';
+UPDATE `crmdb`.`userinfo` SET `city`='1' WHERE `id`='2';
+UPDATE `crmdb`.`userinfo` SET `city`='1' WHERE `id`='3';
+UPDATE `crmdb`.`userinfo` SET `province`='1' WHERE `id`='1';
+UPDATE `crmdb`.`userinfo` SET `province`='1' WHERE `id`='2';
+UPDATE `crmdb`.`userinfo` SET `province`='1' WHERE `id`='3';
+
+ALTER TABLE `crmdb`.`activity`
+ADD COLUMN `coachTime` MEDIUMINT(9) NULL AFTER `whetherCoach`;
+
+ALTER TABLE `crmdb`.`contact`
+ADD COLUMN `num_of_monthlySurgery` MEDIUMINT(9) NULL AFTER `contactCode`,
+ADD COLUMN `num_of_monthlyAnalgesia` MEDIUMINT(9) NULL AFTER `num_of_monthlySurgery`;
+
+
diff --git a/crm/src/main/db/update_22.sql b/crm/src/main/db/update_22.sql
new file mode 100644
index 0000000..8befd28
--- /dev/null
+++ b/crm/src/main/db/update_22.sql
@@ -0,0 +1,125 @@
+use crmdb;
+
+
+drop table if exists activity_score3_pl;
+CREATE TABLE `crmdb`.`activity_score3_pl` (
+ `id` INT NOT NULL,
+ `val` VARCHAR(255) NULL,
+ PRIMARY KEY (`id`)
+ )ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
+
+ drop table if exists activity_score4_pl;
+CREATE TABLE `crmdb`.`activity_score4_pl` (
+ `id` INT NOT NULL,
+ `val` VARCHAR(25) NULL,
+ PRIMARY KEY (`id`)
+ )ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
+
+
+drop table if exists activity_score5_pl;
+CREATE TABLE `crmdb`.`activity_score5_pl` (
+`id` INT NOT NULL,
+`val` VARCHAR(255) NULL,
+PRIMARY KEY (`id`)
+)ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
+
+INSERT INTO `crmdb`.`activity_score3_pl` (`id`, `val`) VALUES ('0', '0');
+INSERT INTO `crmdb`.`activity_score3_pl` (`id`, `val`) VALUES ('1', '1');
+INSERT INTO `crmdb`.`activity_score3_pl` (`id`, `val`) VALUES ('2', '2');
+INSERT INTO `crmdb`.`activity_score3_pl` (`id`, `val`) VALUES ('3', '3');
+INSERT INTO `crmdb`.`activity_score3_pl` (`id`, `val`) VALUES ('4', '4');
+INSERT INTO `crmdb`.`activity_score3_pl` (`id`, `val`) VALUES ('5', '5');
+INSERT INTO `crmdb`.`activity_score3_pl` (`id`, `val`) VALUES ('6', '6');
+INSERT INTO `crmdb`.`activity_score3_pl` (`id`, `val`) VALUES ('7', '7');
+INSERT INTO `crmdb`.`activity_score3_pl` (`id`, `val`) VALUES ('8', '8');
+INSERT INTO `crmdb`.`activity_score3_pl` (`id`, `val`) VALUES ('9', '9');
+INSERT INTO `crmdb`.`activity_score3_pl` (`id`, `val`) VALUES ('10', '10');
+
+INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('0', '0');
+INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('1', '1');
+INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('2', '2');
+INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('3', '3');
+INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('4', '4');
+INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('5', '5');
+INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('6', '6');
+INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('7', '7');
+INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('8', '8');
+INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('9', '9');
+INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('10', '10');
+INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('11', '11');
+INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('12', '12');
+INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('13', '13');
+INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('14', '14');
+INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('15', '15');
+INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('16', '16');
+INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('17', '17');
+INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('18', '18');
+INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('19', '19');
+INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('20', '20');
+INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('21', '21');
+INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('22', '22');
+INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('23', '23');
+INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('24', '24');
+INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('25', '25');
+
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('0', '0');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('1', '1');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('2', '2');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('3', '3');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('4', '4');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('5', '5');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('6', '6');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('7', '7');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('8', '8');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('9', '9');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('10', '10');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('11', '11');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('12', '12');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('13', '13');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('14', '14');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('15', '15');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('16', '16');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('17', '17');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('18', '18');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('19', '19');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('20', '20');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('21', '21');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('22', '22');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('23', '23');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('24', '24');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('25', '25');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('26', '26');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('27', '27');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('28', '28');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('29', '29');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('30', '30');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('31', '31');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('32', '32');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('33', '33');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('34', '34');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('35', '35');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('36', '36');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('37', '37');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('38', '38');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('39', '39');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('40', '40');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('41', '41');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('42', '42');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('43', '43');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('44', '44');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('45', '45');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('46', '46');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('47', '47');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('48', '48');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('49', '49');
+INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('50', '50');
+
+
+UPDATE `crmdb`.`crmuser_pl2` SET `id`='3', `val`='奥诺美' WHERE `id`='3';
+ INSERT INTO `crmdb`.`crmuser_pl2` (`id`, `val`) VALUES ('4', '全部');
+UPDATE `crmdb`.`activity_visiting_purpose_pl` SET `activity_type`='1', `parentId`='1' WHERE `id`='3';
+
+ALTER TABLE `crmdb`.`activity`
+ADD COLUMN `accountId` MEDIUMINT(9) NULL AFTER `coachTime`,
+ADD COLUMN `department` MEDIUMINT(9) NULL AFTER `accountId`,
+ADD COLUMN `whether_coach` VARCHAR(255) NULL AFTER `department`;
\ No newline at end of file
diff --git a/crm/src/main/db/update_23.sql b/crm/src/main/db/update_23.sql
new file mode 100644
index 0000000..d165a13
--- /dev/null
+++ b/crm/src/main/db/update_23.sql
@@ -0,0 +1,11 @@
+use crmdb;
+DROP TABLE IF EXISTS `activity_coachtime_pl`;
+CREATE TABLE `crmdb`.`activity_coachtime_pl` (
+ `id` INT NOT NULL,
+ `val` VARCHAR(255) NULL,
+ PRIMARY KEY (`id`)
+ )ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
+
+INSERT INTO `crmdb`.`activity_coachtime_pl` (`id`, `val`) VALUES ('1', '无');
+INSERT INTO `crmdb`.`activity_coachtime_pl` (`id`, `val`) VALUES ('2', '半天');
+INSERT INTO `crmdb`.`activity_coachtime_pl` (`id`, `val`) VALUES ('3', '全天');
\ No newline at end of file
diff --git a/crm/src/main/db/update_24.sql b/crm/src/main/db/update_24.sql
new file mode 100644
index 0000000..d4fea0e
--- /dev/null
+++ b/crm/src/main/db/update_24.sql
@@ -0,0 +1,8 @@
+use crmdb;
+ALTER TABLE `crmdb`.`userinfo`
+ADD COLUMN `num_of_signIn` MEDIUMINT(9) NULL AFTER `office_tel`;
+
+ALTER TABLE `crmdb`.`user_position`
+ADD COLUMN `status` INT NULL DEFAULT NULL AFTER `positionId`,
+ADD COLUMN `createtime` DATETIME NULL DEFAULT NULL AFTER `status`,
+ADD COLUMN `isPrimary` INT NULL DEFAULT NULL AFTER `createtime`;
\ No newline at end of file
diff --git a/crm/src/main/db/update_25.sql b/crm/src/main/db/update_25.sql
new file mode 100644
index 0000000..349f319
--- /dev/null
+++ b/crm/src/main/db/update_25.sql
@@ -0,0 +1,13 @@
+use crmdb;
+ALTER TABLE `crmdb`.`account`
+CHANGE COLUMN `administrativ_level` `administrativ_level` MEDIUMINT(9) NULL DEFAULT NULL ,
+CHANGE COLUMN `grade` `grade` MEDIUMINT(9) NULL DEFAULT NULL ;
+
+ALTER TABLE `crmdb`.`contact`
+CHANGE COLUMN `department` `department` MEDIUMINT(9) NULL ;
+
+ALTER TABLE `crmdb`.`crmuser`
+CHANGE COLUMN `city` `city` MEDIUMINT(9) NULL DEFAULT NULL ;
+
+ALTER TABLE `crmdb`.`accountcrmuser`
+ADD COLUMN `externalId` VARCHAR(45) NULL AFTER `crmuserId`;
\ No newline at end of file
diff --git a/crm/src/main/db/update_26.sql b/crm/src/main/db/update_26.sql
new file mode 100644
index 0000000..9c55073
--- /dev/null
+++ b/crm/src/main/db/update_26.sql
@@ -0,0 +1,10 @@
+use crmdb;
+ALTER TABLE `crmdb`.`data_exchange_teample`
+DROP FOREIGN KEY `FK8AE35445D557144C`,
+DROP FOREIGN KEY `FK8AE35445199BCB6C`;
+ALTER TABLE `crmdb`.`data_exchange_teample`
+DROP COLUMN `type_id`,
+DROP COLUMN `operation_id`,
+DROP COLUMN `version`,
+DROP INDEX `FK8AE35445199BCB6C` ,
+DROP INDEX `FK8AE35445D557144C` ;
\ No newline at end of file
diff --git a/crm/src/main/db/update_28.sql b/crm/src/main/db/update_28.sql
new file mode 100644
index 0000000..45f1cea
--- /dev/null
+++ b/crm/src/main/db/update_28.sql
@@ -0,0 +1,50 @@
+DROP TABLE IF EXISTS `alert`;
+CREATE TABLE `crmdb`.`alert` (
+ `id` MEDIUMINT(9) NOT NULL AUTO_INCREMENT,
+ `name` VARCHAR(255) NOT NULL,
+ `publishDate` BIGINT(20) NULL,
+ `expired` BIGINT(20) NULL,
+ `priority` MEDIUMINT(9) NULL,
+ `towhom` MEDIUMINT(9) NULL,
+ `description` LONGTEXT NULL,
+ `owner` VARCHAR(255) NULL,
+ `whenadded` DATETIME NULL,
+ `modifier` VARCHAR(255) NULL,
+ `modify_datetime` DATETIME NULL,
+ PRIMARY KEY (`id`)
+ )ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8;
+
+DROP TABLE IF EXISTS `alert_priority_pl`;
+ CREATE TABLE `crmdb`.`alert_priority_pl` (
+ `id` MEDIUMINT(9) NOT NULL,
+ `val` VARCHAR(255) NULL,
+PRIMARY KEY (`id`)
+)ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8;
+
+DROP TABLE IF EXISTS `alert_publicobject_pl`;
+CREATE TABLE `crmdb`.`alert_publicobject_pl` (
+ `id` MEDIUMINT(9) NOT NULL,
+ `val` VARCHAR(255) NULL,
+ PRIMARY KEY (`id`)
+ )ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8;
+
+INSERT INTO `crmdb`.`alert_priority_pl` (`id`, `val`) VALUES ('1', '高级');
+INSERT INTO `crmdb`.`alert_priority_pl` (`id`, `val`) VALUES ('2', '中级');
+INSERT INTO `crmdb`.`alert_priority_pl` (`id`, `val`) VALUES ('3', '低级');
+
+INSERT INTO `crmdb`.`alert_publicobject_pl` (`id`, `val`) VALUES ('1', '管理员');
+INSERT INTO `crmdb`.`alert_publicobject_pl` (`id`, `val`) VALUES ('2', '主管');
+INSERT INTO `crmdb`.`alert_publicobject_pl` (`id`, `val`) VALUES ('3', '代表');
+
+drop view if exists crmdb.activity_alert;
+create view crmdb.activity_alert as
+SELECT id,
+case when to_days(curdate())-to_days(DATE_FORMAT(from_unixtime(act.starttime/1000),'%Y-%m-%d'))=0 THEN '今天'
+when to_days(curdate())-to_days(DATE_FORMAT(from_unixtime(act.starttime/1000),'%Y-%m-%d'))=1 THEN '昨天'
+when to_days(curdate())-to_days(DATE_FORMAT(from_unixtime(act.starttime/1000),'%Y-%m-%d'))=2 THEN '前天'
+when to_days(curdate())-to_days(DATE_FORMAT(from_unixtime(act.starttime/1000),'%Y-%m-%d'))>=3 and to_days(curdate())-to_days(DATE_FORMAT(from_unixtime(act.starttime/1000),'%Y-%m-%d'))<7 THEN '三天以前'
+when to_days(curdate())-to_days(DATE_FORMAT(from_unixtime(act.starttime/1000),'%Y-%m-%d'))>=7 THEN '七天以前'
+ELSE '错误' END as time,
+title
+FROM crmdb.activity act where event_type=1 and status=1 order by time
+
diff --git a/crm/src/main/db/update_29.sql b/crm/src/main/db/update_29.sql
new file mode 100644
index 0000000..da59ebe
--- /dev/null
+++ b/crm/src/main/db/update_29.sql
@@ -0,0 +1,33 @@
+use crmdb;
+drop view if exists crmdb.user_position_account;
+create view user_position_account as
+select ac.id as id,u.name as userName,u.loginName as loginName,u.email as email,sp.val as sex,u.whenadded as addTime,
+c.name as positionName,c.code as positionCode,(select name from crmuser crm where crm.id=c.reportto) as reportTo,(select name from crmuser c1 where c1.id =(select c2.reportto from crmuser c2 where id=c.reportto)) as reporttto,r.val as role,rlp4.val as regoin1,rlp5.val as regoin2,ct.val as city,
+a.name as accountName,a.bdm_code as BDMCode,aalp.val as adminLevel,asp.val as status
+from userinfo u
+left join sex_pl sp
+on u.sex=sp.id
+left join user_position up
+on u.id=up.userId
+left join crmuser c
+on up.positionId =c.id
+left join role r
+on c.role=r.id
+left join region_level1_pl rlp4
+on c.pl4=rlp4.id
+left join region_level1_pl rlp5
+on c.pl5=rlp5.id
+left join city ct
+on c.city=ct.id
+left join accountcrmuser ac
+on c.id=ac.crmuserId
+left join account a
+on ac.accountId=a.id
+left join account_status_pl asp
+on a.status =asp.id
+left join account_administrativ_level_pl aalp on
+a.administrativ_level=aalp.id
+where up.status=1 order by id;
+
+ALTER TABLE `crmdb`.`userinfo`
+DROP COLUMN `positionId`;
diff --git a/crm/src/main/db/update_3.sql b/crm/src/main/db/update_3.sql
new file mode 100644
index 0000000..5970e59
--- /dev/null
+++ b/crm/src/main/db/update_3.sql
@@ -0,0 +1,5 @@
+
+ALTER TABLE `crmdb`.`activity`
+CHANGE COLUMN `coach` `coach` MEDIUMINT(9) NULL DEFAULT NULL ;
+ALTER TABLE `crmdb`.`activity`
+ADD COLUMN `coacheeId` MEDIUMINT(9) NULL AFTER `contactId`;
diff --git a/crm/src/main/db/update_31.sql b/crm/src/main/db/update_31.sql
new file mode 100644
index 0000000..0367b55
--- /dev/null
+++ b/crm/src/main/db/update_31.sql
@@ -0,0 +1,34 @@
+UPDATE `crmdb`.`activity_status_pl` SET `val`='未执行' WHERE `id`='3';
+
+ALTER TABLE `crmdb`.`activity`
+ADD COLUMN `activity_daypart` MEDIUMINT(9) NULL AFTER `whether_coach`;
+
+drop table if exists activity_daypart_pl;
+CREATE TABLE `crmdb`.`activity_daypart_pl` (
+ `id` MEDIUMINT(9) NOT NULL AUTO_INCREMENT,
+ `val` VARCHAR(255) NULL,
+ PRIMARY KEY (`id`));
+
+INSERT INTO `crmdb`.`activity_daypart_pl` (`id`, `val`) VALUES ('1', '上午');
+INSERT INTO `crmdb`.`activity_daypart_pl` (`id`, `val`) VALUES ('2', '下午');
+
+-- ALTER TABLE `crmdb`.`activitycrmuser`
+-- DROP FOREIGN KEY `crm_activity_cons2`;
+
+DELETE FROM `crmdb`.`account_administrativ_level_pl` WHERE `id`='2';
+DELETE FROM `crmdb`.`account_administrativ_level_pl` WHERE `id`='3';
+DELETE FROM `crmdb`.`account_administrativ_level_pl` WHERE `id`='4';
+DELETE FROM `crmdb`.`account_administrativ_level_pl` WHERE `id`='6';
+DELETE FROM `crmdb`.`account_administrativ_level_pl` WHERE `id`='7';
+DELETE FROM `crmdb`.`account_administrativ_level_pl` WHERE `id`='8';
+DELETE FROM `crmdb`.`account_administrativ_level_pl` WHERE `id`='10';
+DELETE FROM `crmdb`.`account_administrativ_level_pl` WHERE `id`='11';
+DELETE FROM `crmdb`.`account_administrativ_level_pl` WHERE `id`='12';
+
+UPDATE `crmdb`.`account_administrativ_level_pl` SET `val`='未评级' WHERE `id`= '13';
+
+drop table `crmdb`.`account_grade_pl`;
+
+ALTER TABLE `crmdb`.`account`
+DROP COLUMN `grade`;
+
diff --git a/crm/src/main/db/update_32.sql b/crm/src/main/db/update_32.sql
new file mode 100644
index 0000000..99fe9d9
--- /dev/null
+++ b/crm/src/main/db/update_32.sql
@@ -0,0 +1,42 @@
+use crmdb;
+
+set session old_alter_table =on;
+ALTER IGNORE TABLE crmuser ADD UNIQUE (code);
+set session old_alter_table =off;
+
+ALTER table contact ADD externalId varchar(128);
+set session old_alter_table =on;
+ALTER IGNORE TABLE contact ADD UNIQUE (externalId);
+set session old_alter_table =off;
+
+set session old_alter_table =on;
+ALTER IGNORE TABLE userinfo ADD UNIQUE (employeeNumber);
+set session old_alter_table =off;
+
+
+DROP TABLE IF EXISTS `area`;
+DROP TABLE IF EXISTS `city`;
+DROP TABLE IF EXISTS `province`;
+
+DROP TABLE IF EXISTS `province`;
+CREATE TABLE `province` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `val` varchar(20) DEFAULT NULL,
+ `externalId` varchar(20) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB;
+INSERT INTO `province` VALUES (1,'北京','110000'),(2,'天津','120000'),(3,'河北','130000'),(4,'山西','140000'),(5,'内蒙古','150000'),(6,'辽宁','210000'),(7,'吉林','220000'),(8,'黑龙江','230000'),(9,'上海','310000'),(10,'江苏','320000'),(11,'浙江','330000'),(12,'安徽','340000'),(13,'福建','350000'),(14,'江西','360000'),(15,'山东','370000'),(16,'河南','410000'),(17,'湖北','420000'),(18,'湖南','430000'),(19,'广东','440000'),(20,'广西','450000'),(21,'海南','460000'),(22,'重庆','500000'),(23,'四川','510000'),(24,'贵州','520000'),(25,'云南','530000'),(26,'西藏','540000'),(27,'陕西','610000'),(28,'甘肃','620000'),(29,'青海','630000'),(30,'宁夏','640000'),(31,'新疆','650000'),(32,'台湾','710000'),(33,'香港','810000'),(34,'澳门','820000');
+
+DROP TABLE IF EXISTS `city`;
+CREATE TABLE `city` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `val` varchar(20) DEFAULT NULL,
+ `externalId` varchar(20) DEFAULT NULL,
+ `parentId` int(11) NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY `city_parentid_cons` (`parentId`),
+ CONSTRAINT `city_parentid_cons` FOREIGN KEY (`parentId`) REFERENCES `province` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB;
+
+INSERT INTO `city` VALUES (1,'北京','110100',1),(2,'石家庄','130100',3),(3,'唐山','130200',3),(4,'秦皇岛','130300',3),(5,'邯郸','130400',3),(6,'邢台','130500',3),(7,'保定','130600',3),(8,'张家口','130700',3),(9,'承德','130800',3),(10,'沧州','130900',3),(11,'廊坊','131000',3),(12,'衡水','131100',3),(13,'太原','140100',4),(14,'大同','140200',4),(15,'阳泉','140300',4),(16,'长治','140400',4),(17,'晋城','140500',4),(18,'朔州','140600',4),(19,'晋中','140700',4),(20,'运城','140800',4),(21,'忻州','140900',4),(22,'临汾','141000',4),(23,'吕梁','141100',4),(24,'呼和浩特','150100',5),(25,'包头','150200',5),(26,'乌海','150300',5),(27,'赤峰','150400',5),(28,'通辽','150500',5),(29,'鄂尔多斯','150600',5),(30,'呼伦贝尔','150700',5),(31,'巴彦淖尔','150800',5),(32,'乌兰察布','150900',5),(33,'兴安盟','152200',5),(34,'锡林郭勒盟','152500',5),(35,'阿拉善盟','152900',5),(36,'沈阳','210100',6),(37,'大连','210200',6),(38,'鞍山','210300',6),(39,'抚顺','210400',6),(40,'本溪','210500',6),(41,'丹东','210600',6),(42,'锦州','210700',6),(43,'营口','210800',6),(44,'阜新','210900',6),(45,'辽阳','211000',6),(46,'盘锦','211100',6),(47,'铁岭','211200',6),(48,'朝阳','211300',6),(49,'葫芦岛','211400',6),(50,'长春','220100',7),(51,'吉林','220200',7),(52,'四平','220300',7),(53,'辽源','220400',7),(54,'通化','220500',7),(55,'白山','220600',7),(56,'松原','220700',7),(57,'白城','220800',7),(58,'延边朝鲜族自治州','222400',7),(59,'哈尔滨','230100',8),(60,'齐齐哈尔','230200',8),(61,'鸡西','230300',8),(62,'鹤岗','230400',8),(63,'双鸭山','230500',8),(64,'大庆','230600',8),(65,'伊春','230700',8),(66,'佳木斯','230800',8),(67,'七台河','230900',8),(68,'牡丹江','231000',8),(69,'黑河','231100',8),(70,'绥化','231200',8),(71,'大兴安岭地区','232700',8),(72,'上海','310100',9),(73,'县','310200',9),(74,'南京','320100',10),(75,'无锡','320200',10),(76,'徐州','320300',10),(77,'常州','320400',10),(78,'苏州','320500',10),(79,'南通','320600',10),(80,'连云港','320700',10),(81,'淮安','320800',10),(82,'盐城','320900',10),(83,'扬州','321000',10),(84,'镇江','321100',10),(85,'泰州','321200',10),(86,'宿迁','321300',10),(87,'杭州','330100',11),(88,'宁波','330200',11),(89,'温州','330300',11),(90,'嘉兴','330400',11),(91,'湖州','330500',11),(92,'绍兴','330600',11),(93,'金华','330700',11),(94,'衢州','330800',11),(95,'舟山','330900',11),(96,'台州','331000',11),(97,'丽水','331100',11),(98,'合肥','340100',12),(99,'芜湖','340200',12),(100,'蚌埠','340300',12),(101,'淮南','340400',12),(102,'马鞍山','340500',12),(103,'淮北','340600',12),(104,'铜陵','340700',12),(105,'安庆','340800',12),(106,'黄山','341000',12),(107,'滁州','341100',12),(108,'阜阳','341200',12),(109,'宿州','341300',12),(110,'巢湖','341400',12),(111,'六安','341500',12),(112,'亳州','341600',12),(113,'池州','341700',12),(114,'宣城','341800',12),(115,'福州','350100',13),(116,'厦门','350200',13),(117,'莆田','350300',13),(118,'三明','350400',13),(119,'泉州','350500',13),(120,'漳州','350600',13),(121,'南平','350700',13),(122,'龙岩','350800',13),(123,'宁德','350900',13),(124,'南昌','360100',14),(125,'景德镇','360200',14),(126,'萍乡','360300',14),(127,'九江','360400',14),(128,'新余','360500',14),(129,'鹰潭','360600',14),(130,'赣州','360700',14),(131,'吉安','360800',14),(132,'宜春','360900',14),(133,'抚州','361000',14),(134,'上饶','361100',14),(135,'济南','370100',15),(136,'青岛','370200',15),(137,'淄博','370300',15),(138,'枣庄','370400',15),(139,'东营','370500',15),(140,'烟台','370600',15),(141,'潍坊','370700',15),(142,'济宁','370800',15),(143,'泰安','370900',15),(144,'威海','371000',15),(145,'日照','371100',15),(146,'莱芜','371200',15),(147,'临沂','371300',15),(148,'德州','371400',15),(149,'聊城','371500',15),(150,'滨州','371600',15),(151,'荷泽','371700',15),(152,'郑州','410100',16),(153,'开封','410200',16),(154,'洛阳','410300',16),(155,'平顶山','410400',16),(156,'安阳','410500',16),(157,'鹤壁','410600',16),(158,'新乡','410700',16),(159,'焦作','410800',16),(160,'濮阳','410900',16),(161,'许昌','411000',16),(162,'漯河','411100',16),(163,'三门峡','411200',16),(164,'南阳','411300',16),(165,'商丘','411400',16),(166,'信阳','411500',16),(167,'周口','411600',16),(168,'驻马店','411700',16),(169,'武汉','420100',17),(170,'黄石','420200',17),(171,'十堰','420300',17),(172,'宜昌','420500',17),(173,'襄樊','420600',17),(174,'鄂州','420700',17),(175,'荆门','420800',17),(176,'孝感','420900',17),(177,'荆州','421000',17),(178,'黄冈','421100',17),(179,'咸宁','421200',17),(180,'随州','421300',17),(181,'恩施土家族苗族自治州','422800',17),(182,'省直辖行政单位','429000',17),(183,'长沙','430100',18),(184,'株洲','430200',18),(185,'湘潭','430300',18),(186,'衡阳','430400',18),(187,'邵阳','430500',18),(188,'岳阳','430600',18),(189,'常德','430700',18),(190,'张家界','430800',18),(191,'益阳','430900',18),(192,'郴州','431000',18),(193,'永州','431100',18),(194,'怀化','431200',18),(195,'娄底','431300',18),(196,'湘西土家族苗族自治州','433100',18),(197,'广州','440100',19),(198,'韶关','440200',19),(199,'深圳','440300',19),(200,'珠海','440400',19),(201,'汕头','440500',19),(202,'佛山','440600',19),(203,'江门','440700',19),(204,'湛江','440800',19),(205,'茂名','440900',19),(206,'肇庆','441200',19),(207,'惠州','441300',19),(208,'梅州','441400',19),(209,'汕尾','441500',19),(210,'河源','441600',19),(211,'阳江','441700',19),(212,'清远','441800',19),(213,'东莞','441900',19),(214,'中山','442000',19),(215,'潮州','445100',19),(216,'揭阳','445200',19),(217,'云浮','445300',19),(218,'南宁','450100',20),(219,'柳州','450200',20),(220,'桂林','450300',20),(221,'梧州','450400',20),(222,'北海','450500',20),(223,'防城港','450600',20),(224,'钦州','450700',20),(225,'贵港','450800',20),(226,'玉林','450900',20),(227,'百色','451000',20),(228,'贺州','451100',20),(229,'河池','451200',20),(230,'来宾','451300',20),(231,'崇左','451400',20),(232,'海口','460100',21),(233,'三亚','460200',21),(234,'省直辖县级行政单位','469000',21),(235,'辖区','500100',22),(236,'县','500200',22),(237,'','500300',22),(238,'成都','510100',23),(239,'自贡','510300',23),(240,'攀枝花','510400',23),(241,'泸州','510500',23),(242,'德阳','510600',23),(243,'绵阳','510700',23),(244,'广元','510800',23),(245,'遂宁','510900',23),(246,'内江','511000',23),(247,'乐山','511100',23),(248,'南充','511300',23),(249,'眉山','511400',23),(250,'宜宾','511500',23),(251,'广安','511600',23),(252,'达州','511700',23),(253,'雅安','511800',23),(254,'巴中','511900',23),(255,'资阳','512000',23),(256,'阿坝藏族羌族自治州','513200',23),(257,'甘孜藏族自治州','513300',23),(258,'凉山彝族自治州','513400',23),(259,'贵阳','520100',24),(260,'六盘水','520200',24),(261,'遵义','520300',24),(262,'安顺','520400',24),(263,'铜仁地区','522200',24),(264,'黔西南布依族苗族自治州','522300',24),(265,'毕节地区','522400',24),(266,'黔东南苗族侗族自治州','522600',24),(267,'黔南布依族苗族自治州','522700',24),(268,'昆明','530100',25),(269,'曲靖','530300',25),(270,'玉溪','530400',25),(271,'保山','530500',25),(272,'昭通','530600',25),(273,'丽江','530700',25),(274,'思茅','530800',25),(275,'临沧','530900',25),(276,'楚雄彝族自治州','532300',25),(277,'红河哈尼族彝族自治州','532500',25),(278,'文山壮族苗族自治州','532600',25),(279,'西双版纳傣族自治州','532800',25),(280,'大理白族自治州','532900',25),(281,'德宏傣族景颇族自治州','533100',25),(282,'怒江傈僳族自治州','533300',25),(283,'迪庆藏族自治州','533400',25),(284,'拉萨','540100',26),(285,'昌都地区','542100',26),(286,'山南地区','542200',26),(287,'日喀则地区','542300',26),(288,'那曲地区','542400',26),(289,'阿里地区','542500',26),(290,'林芝地区','542600',26),(291,'西安','610100',27),(292,'铜川','610200',27),(293,'宝鸡','610300',27),(294,'咸阳','610400',27),(295,'渭南','610500',27),(296,'延安','610600',27),(297,'汉中','610700',27),(298,'榆林','610800',27),(299,'安康','610900',27),(300,'商洛','611000',27),(301,'兰州','620100',28),(302,'嘉峪关','620200',28),(303,'金昌','620300',28),(304,'白银','620400',28),(305,'天水','620500',28),(306,'武威','620600',28),(307,'张掖','620700',28),(308,'平凉','620800',28),(309,'酒泉','620900',28),(310,'庆阳','621000',28),(311,'定西','621100',28),(312,'陇南','621200',28),(313,'临夏回族自治州','622900',28),(314,'甘南藏族自治州','623000',28),(315,'西宁','630100',29),(316,'海东地区','632100',29),(317,'海北藏族自治州','632200',29),(318,'黄南藏族自治州','632300',29),(319,'海南藏族自治州','632500',29),(320,'果洛藏族自治州','632600',29),(321,'玉树藏族自治州','632700',29),(322,'海西蒙古族藏族自治州','632800',29),(323,'银川','640100',30),(324,'石嘴山','640200',30),(325,'吴忠','640300',30),(326,'固原','640400',30),(327,'中卫','640500',30),(328,'乌鲁木齐','650100',31),(329,'克拉玛依','650200',31),(330,'吐鲁番地区','652100',31),(331,'哈密地区','652200',31),(332,'昌吉回族自治州','652300',31),(333,'博尔塔拉蒙古自治州','652700',31),(334,'巴音郭楞蒙古自治州','652800',31),(335,'阿克苏地区','652900',31),(336,'克孜勒苏柯尔克孜自治州','653000',31),(337,'喀什地区','653100',31),(338,'和田地区','653200',31),(339,'伊犁哈萨克自治州','654000',31),(340,'塔城地区','654200',31),(341,'阿勒泰地区','654300',31),(342,'省直辖行政单位','659000',31),(343,'天津',NULL,2);
+-- ALTER table userinfo drop positionId;
diff --git a/crm/src/main/db/update_33.sql b/crm/src/main/db/update_33.sql
new file mode 100644
index 0000000..6f7798d
--- /dev/null
+++ b/crm/src/main/db/update_33.sql
@@ -0,0 +1,47 @@
+drop table if exists importMetaInfo;
+CREATE TABLE importMetaInfo
+(
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ name VARCHAR(255) NOT NULL,
+ entity_name VARCHAR(255),
+ importfilename VARCHAR(255),
+ logfilename VARCHAR(255),
+ whenadded DATETIME,
+ modifier VARCHAR(255),
+ modify_datetime DATETIME,
+ num_of_total_record MEDIUMINT,
+ num_of_imported MEDIUMINT,
+ num_of_failed MEDIUMINT,
+ status MEDIUMINT,
+ result MEDIUMINT,
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB;
+
+
+
+DROP TABLE IF EXISTS `importstatus`;
+CREATE TABLE `crmdb`.`importstatus` (
+ `id` INT NOT NULL,
+ `val` VARCHAR(45),
+ PRIMARY KEY (`id`)
+) ENGINE InnoDB;
+INSERT INTO importstatus (id,val) VALUES(0,'运行');
+INSERT INTO importstatus (id,val) VALUES(1,'已完成');
+
+DROP TABLE IF EXISTS `importresult`;
+CREATE TABLE `crmdb`.`importresult` (
+ `id` INT NOT NULL,
+ `val` VARCHAR(45) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE InnoDB;
+INSERT INTO importresult (id,val) VALUES(0,'成功');
+INSERT INTO importresult (id,val) VALUES(1,'失败');
+
+
+ALTER table user_position add externalId varchar(128);
+ALTER table user_position add whenadded DATETIME;
+ALTER table user_position add modifier VARCHAR(255);
+ALTER table user_position add modify_datetime DATETIME;
+
+
+ALTER TABLE user_position drop KEY user_position_unique;
\ No newline at end of file
diff --git a/crm/src/main/db/update_34.sql b/crm/src/main/db/update_34.sql
new file mode 100644
index 0000000..aae5ef3
--- /dev/null
+++ b/crm/src/main/db/update_34.sql
@@ -0,0 +1,15 @@
+ALTER TABLE `crmdb`.`userinfo`
+DROP COLUMN `ts`,
+DROP COLUMN `isActivited`,
+ADD UNIQUE INDEX `loginName_UNIQUE` (`loginName` ASC);
+
+
+alter table importMetaInfo add num_of_updated int;
+
+
+-- ALTER table accountcrmuser add externalId varchar(128);
+ALTER table accountcrmuser add whenadded DATETIME;
+ALTER table accountcrmuser add modifier VARCHAR(255);
+ALTER table accountcrmuser add modify_datetime DATETIME;
+
+insert into user_position (userId,positionId,isPrimary) values(1,1,1);
\ No newline at end of file
diff --git a/crm/src/main/db/update_35.sql b/crm/src/main/db/update_35.sql
new file mode 100644
index 0000000..8f89aab
--- /dev/null
+++ b/crm/src/main/db/update_35.sql
@@ -0,0 +1,4 @@
+-- ALTER TABLE `crmdb`.`userinfo`
+-- DROP COLUMN `ts`,
+-- DROP COLUMN `isActivited`,
+-- ADD UNIQUE INDEX `loginName_UNIQUE` (`loginName` ASC);
\ No newline at end of file
diff --git a/crm/src/main/db/update_36.sql b/crm/src/main/db/update_36.sql
new file mode 100644
index 0000000..147081d
--- /dev/null
+++ b/crm/src/main/db/update_36.sql
@@ -0,0 +1,7 @@
+
+use crmdb;
+
+
+set session old_alter_table =on;
+ALTER IGNORE TABLE user_position ADD UNIQUE (positionId);
+set session old_alter_table =off;
diff --git a/crm/src/main/db/update_37.sql b/crm/src/main/db/update_37.sql
new file mode 100644
index 0000000..7abe7e6
--- /dev/null
+++ b/crm/src/main/db/update_37.sql
@@ -0,0 +1,13 @@
+drop view if exists crmdb.activity_alert;
+create view crmdb.activity_alert as
+SELECT id,
+case when to_days(curdate())-to_days(DATE_FORMAT(from_unixtime(act.starttime/1000),'%Y-%m-%d'))=0 THEN '今天'
+when to_days(curdate())-to_days(DATE_FORMAT(from_unixtime(act.starttime/1000),'%Y-%m-%d'))=1 THEN '昨天'
+when to_days(curdate())-to_days(DATE_FORMAT(from_unixtime(act.starttime/1000),'%Y-%m-%d'))=2 THEN '前天'
+when to_days(curdate())-to_days(DATE_FORMAT(from_unixtime(act.starttime/1000),'%Y-%m-%d'))>=3 and to_days(curdate())-to_days(DATE_FORMAT(from_unixtime(act.starttime/1000),'%Y-%m-%d'))<7 THEN '三天以前'
+when to_days(curdate())-to_days(DATE_FORMAT(from_unixtime(act.starttime/1000),'%Y-%m-%d'))>=7 THEN '七天以前'
+ELSE '错误' END as time,
+title,
+act.owner as name,
+act.starttime as times
+FROM crmdb.activity act where status=1 and to_days(curdate())-to_days(DATE_FORMAT(from_unixtime(act.starttime/1000),'%Y-%m-%d'))>=0 order by times
\ No newline at end of file
diff --git a/crm/src/main/db/update_38.sql b/crm/src/main/db/update_38.sql
new file mode 100644
index 0000000..516bab5
--- /dev/null
+++ b/crm/src/main/db/update_38.sql
@@ -0,0 +1,3 @@
+use crmdb;
+
+alter table account CHANGE COLUMN date_of_establish date_of_establish varchar(128);
\ No newline at end of file
diff --git a/crm/src/main/db/update_39.sql b/crm/src/main/db/update_39.sql
new file mode 100644
index 0000000..c5c6a02
--- /dev/null
+++ b/crm/src/main/db/update_39.sql
@@ -0,0 +1,41 @@
+drop view if exists parent_user_info;
+drop view if exists parent_user_position;
+drop view if exists parent_position;
+create view parent_user_info as select * from userinfo;
+create view parent_user_position as select * from user_position;
+create view parent_position as select * from crmuser;
+
+drop view if exists user_position_query;
+
+create view user_position_query as
+select user_position.userid user_id,
+ user_position.positionid position_id,
+ region_level1_pl.val area,
+ region_level2_pl.val region,
+ province.val province,
+ crmuser_pl2.val productLine,
+ crmuser.level position_level,
+ crmuser.name position_name,
+ crmuser.code position_code,
+ userinfo.employeenumber delegatePosition,
+ userinfo.name delegateName,
+ parent_position.id manager_position_id,
+ parent_position.code managerPosition,
+ parent_position.name manager_position_name,
+ parent_position.level manager_position_level,
+ parent_user_info.employeenumber manager_employee_number,
+ parent_user_info.name regionManager,
+ account.name accountName,
+ account.bdm_code BDMcode
+from user_position
+left join crmuser on user_position.positionid = crmuser.id
+left join userinfo on user_position.userid = userinfo.id
+left join parent_position on crmuser.reportto = parent_position.id
+left join parent_user_position on parent_position.id = parent_user_position.positionid
+left join parent_user_info on parent_user_position.userid = parent_user_info.id
+inner join accountcrmuser on user_position.positionid = accountcrmuser.crmuserid
+inner join account on accountcrmuser.accountid = account.id
+left join region_level1_pl on crmuser.pl4 = region_level1_pl.id
+left join region_level2_pl on crmuser.pl5 = region_level2_pl.id
+left join province on account.province = province.id
+left join crmuser_pl2 on crmuser_pl2.id = crmuser.pl2
diff --git a/crm/src/main/db/update_4.sql b/crm/src/main/db/update_4.sql
new file mode 100644
index 0000000..a00a678
--- /dev/null
+++ b/crm/src/main/db/update_4.sql
@@ -0,0 +1,19 @@
+use crmdb;
+
+drop trigger if exists activity_score_insert;
+DELIMITER |
+
+CREATE TRIGGER activity_score_insert BEFORE INSERT ON activity
+ FOR EACH ROW BEGIN
+ SET NEW.total_score = (NEW.planing + NEW.openling + NEW.enquery_listening + NEW.deliverable + NEW.objection_handing + NEW.summary);
+ END;
+|
+
+drop trigger if exists activity_score_update;
+CREATE TRIGGER activity_score_update BEFORE UPDATE ON activity
+ FOR EACH ROW BEGIN
+ SET NEW.total_score = (NEW.planing + NEW.openling + NEW.enquery_listening + NEW.deliverable + NEW.objection_handing + NEW.summary);
+ END;
+|
+
+DELIMITER ;
\ No newline at end of file
diff --git a/crm/src/main/db/update_40.sql b/crm/src/main/db/update_40.sql
new file mode 100644
index 0000000..991b60a
--- /dev/null
+++ b/crm/src/main/db/update_40.sql
@@ -0,0 +1,8 @@
+drop table if exists crmuser_level_pl;
+CREATE TABLE `crmdb`.`crmuser_level_pl` (
+ `id` INT NOT NULL,
+ `val` VARCHAR(45) NULL,
+ PRIMARY KEY (`id`));
+ INSERT INTO `crmdb`.`crmuser_level_pl` (`id`, `val`) VALUES ('11', '11');
+INSERT INTO `crmdb`.`crmuser_level_pl` (`id`, `val`) VALUES ('21', '21');
+INSERT INTO `crmdb`.`crmuser_level_pl` (`id`, `val`) VALUES ('31', '31');
\ No newline at end of file
diff --git a/crm/src/main/db/update_41.sql b/crm/src/main/db/update_41.sql
new file mode 100644
index 0000000..d0ee79e
--- /dev/null
+++ b/crm/src/main/db/update_41.sql
@@ -0,0 +1,2 @@
+INSERT INTO `crmdb`.`contact_grade_pl` (`val`) VALUES ('V');
+INSERT INTO `crmdb`.`contact_grade_pl` (`val`) VALUES ('非目标医生');
diff --git a/crm/src/main/db/update_5.sql b/crm/src/main/db/update_5.sql
new file mode 100644
index 0000000..693b2bd
--- /dev/null
+++ b/crm/src/main/db/update_5.sql
@@ -0,0 +1,15 @@
+use crmdb;
+ALTER TABLE `crmdb`.`crmuser`
+CHANGE COLUMN `isActivited` `isActivited` MEDIUMINT(9) NULL DEFAULT NULL ;
+
+DROP TABLE IF EXISTS `crmuser_activited`;
+CREATE TABLE `crmdb`.`crmuser_activited` (
+ `id` MEDIUMINT(9) NOT NULL AUTO_INCREMENT,
+ `val` VARCHAR(255) NULL,
+ PRIMARY KEY (`id`)
+ )ENGINE=InnoDB;
+INSERT INTO `crmdb`.`crmuser_activited` (`id`, `val`) VALUES ('1', '已激活');
+INSERT INTO `crmdb`.`crmuser_activited` (`id`, `val`) VALUES ('2', '未激活');
+
+ALTER TABLE `crmdb`.`account`
+ADD UNIQUE INDEX `account_ix_01` (`bdm_code` ASC);
\ No newline at end of file
diff --git a/crm/src/main/db/update_51.sql b/crm/src/main/db/update_51.sql
new file mode 100644
index 0000000..e1da5ce
--- /dev/null
+++ b/crm/src/main/db/update_51.sql
@@ -0,0 +1,16 @@
+DELETE FROM `crmdb`.`activity_coachtime_pl` WHERE `id`='1';
+DROP TABLE `crmdb`.`activity_whethercoach_pl`;
+UPDATE `crmdb`.`city` SET `val`='菏泽' WHERE `id`='151';
+UPDATE `crmdb`.`city` SET `val`='重庆' WHERE `id`='235';
+DELETE FROM `crmdb`.`city` WHERE `id`='236';
+INSERT INTO `crmdb`.`city` (`id`, `val`, `parentId`) VALUES ('345', '未知地域', '31');
+INSERT INTO `crmdb`.`city` (`id`, `val`, `parentId`) VALUES ('346', '未知地域', '27');
+INSERT INTO `crmdb`.`city` (`id`, `val`, `parentId`) VALUES ('347', '三河(虚拟)', '1');
+
+UPDATE `crmdb`.`region_level2_pl` SET `val`='奥诺美北区' WHERE `id`='1';
+UPDATE `crmdb`.`region_level2_pl` SET `val`='奥诺美东北区' WHERE `id`='2';
+UPDATE `crmdb`.`region_level2_pl` SET `val`='奥诺美东一区' WHERE `id`='3';
+UPDATE `crmdb`.`region_level2_pl` SET `val`='奥诺美东二区' WHERE `id`='4';
+UPDATE `crmdb`.`region_level2_pl` SET `val`='奥诺美西区' WHERE `id`='5';
+UPDATE `crmdb`.`region_level2_pl` SET `val`='奥诺美南区' WHERE `id`='6';
+DELETE FROM `crmdb`.`region_level2_pl` WHERE `id`='7';
\ No newline at end of file
diff --git a/crm/src/main/db/update_52.sql b/crm/src/main/db/update_52.sql
new file mode 100644
index 0000000..ac3c3ff
--- /dev/null
+++ b/crm/src/main/db/update_52.sql
@@ -0,0 +1,8 @@
+UPDATE `crmdb`.`alert_publicobject_pl` SET `val`='系统管理员' WHERE `id`='1';
+UPDATE `crmdb`.`alert_publicobject_pl` SET `val`='地区经理' WHERE `id`='2';
+UPDATE `crmdb`.`alert_publicobject_pl` SET `val`='销售代表' WHERE `id`='3';
+
+DELETE FROM `crmdb`.`contact_grade_pl` WHERE `id`='4';
+UPDATE `crmdb`.`contact_grade_pl` SET `id`='4' WHERE `id`='5';
+UPDATE `crmdb`.`contact_grade_pl` SET `id`='5' WHERE `id`='6';
+
diff --git a/crm/src/main/db/update_53.sql b/crm/src/main/db/update_53.sql
new file mode 100644
index 0000000..9f503f0
--- /dev/null
+++ b/crm/src/main/db/update_53.sql
@@ -0,0 +1,51 @@
+DELETE FROM `crmdb`.`crmuser_pl2` WHERE `id`='4';
+
+INSERT INTO `crmdb`.`alert_publicobject_pl` (`id`, `val`) VALUES ('4', '所有人');
+
+drop view if exists crmdb.call_export;
+create view crmdb.call_export as
+SELECT act.id as id,act.title as Activity_title,acp.val as Activity_whetherCoach,afpp.val as Activity_feature_product,at.val as Activity_types,act.whenadded as Activity_addTime,act.modify_datetime as Activity_modifyTime,from_unixtime(act.starttime/1000) as Activity_start,from_unixtime(act.endtime/1000) as Activity_end,
+u.name as Position_name,rlp1.val as Region_level_1,rlp2.val as Region_level_2,u.code as position_code,r.val as position_role,
+c.name as Contact_name,cgp.val as Contact_grade,cdp.val as Contact_department,sp.val as Contact_sex,c.email as Contact_email,cdp2.val as Contact_duty,cjtp.val as Contact_job_title,
+a.name as Account_name , a.bdm_code as Account_BDMCode,atl.val as Account_type,aalp.val as Account_administrative_level,aloap.val as local_or_army,acosp.val as comprehensive_or_specialized,app.val as isKey,asp.val as Account_status
+FROM crmdb.activity act
+left join crmdb.activity_coachtime_pl acp on
+act.whetherCoach=acp.id
+left join crmdb.activity_feature_product_pl afpp on
+act.feature_product=afpp.id
+left join crmdb.activity_types at on
+act.activity_type=at.id
+left join crmdb.crmuser u on
+act.crmuserId = u.id
+left join crmdb.contact c on
+act.contactId = c.id
+left join crmdb.contact_grade_pl cgp on
+c.grade=cgp.id
+left join crmdb.contact_department_pl cdp on
+c.department=cdp.id
+left join crmdb.sex_pl sp on
+c.sex=sp.id
+left join crmdb.contact_duty_pl cdp2 on
+c.duty=cdp2.id
+left join crmdb.contact_job_title_pl cjtp on
+c.job_title=cjtp.id
+left join crmdb.region_level1_pl rlp1 on
+u.pl5=rlp1.id
+left join crmdb.region_level2_pl rlp2 on
+u.pl4=rlp2.id
+left join crmdb.role r on
+u.role=r.id
+left join crmdb.account a on
+c.accountId= a.id
+left join crmdb.account_type_pl atl on
+a.hospital_type = atl.id
+left join crmdb.account_administrativ_level_pl aalp on
+a.administrativ_level=aalp.id
+left join crmdb.account_local_or_army_pl aloap on
+a.local_or_army=aloap.id
+left join crmdb.account_comprehensive_or_specialized_pl acosp on
+a.comprehensive_or_specialized=acosp.id
+left join crmdb.account_point_pl app on
+a.key_type=app.id
+left join crmdb.account_status_pl asp on
+a.status=asp.id order by id
\ No newline at end of file
diff --git a/crm/src/main/db/update_54.sql b/crm/src/main/db/update_54.sql
new file mode 100644
index 0000000..1c02bb6
--- /dev/null
+++ b/crm/src/main/db/update_54.sql
@@ -0,0 +1,13 @@
+CREATE TABLE `product` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `name` varchar(128) NOT NULL,
+ `status` int(11) NOT NULL DEFAULT '1',
+ `parentid` int(11) DEFAULT NULL,
+ `specification` varchar(512) DEFAULT NULL,
+ `created_date` datetime DEFAULT NULL,
+ `modified_date` datetime DEFAULT NULL,
+ `created_by_user_id` int(11) DEFAULT NULL,
+ `modfied_by_user_id` int(11) DEFAULT NULL,
+ `level` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8;
diff --git a/crm/src/main/db/update_55.sql b/crm/src/main/db/update_55.sql
new file mode 100644
index 0000000..a4c4ebd
--- /dev/null
+++ b/crm/src/main/db/update_55.sql
@@ -0,0 +1,15 @@
+use crmdb;
+
+drop table if exists activity_coachtime_pl;
+CREATE TABLE activity_coachtime_pl
+(
+ id MEDIUMINT NOT NULL,
+ val VARCHAR(255),
+ PRIMARY KEY USING BTREE (id)
+) ENGINE InnoDB DEFAULT CHARSET=utf8;
+INSERT INTO `crmdb`.`activity_coachtime_pl` (`id`, `val`) VALUES ('1', '半天');
+INSERT INTO `crmdb`.`activity_coachtime_pl` (`id`, `val`) VALUES ('2', '全天');
+
+
+ALTER table accountcrmuser add owner VARCHAR(255);
+ALTER table user_position add owner VARCHAR(255);
\ No newline at end of file
diff --git a/crm/src/main/db/update_56.sql b/crm/src/main/db/update_56.sql
new file mode 100644
index 0000000..0a31884
--- /dev/null
+++ b/crm/src/main/db/update_56.sql
@@ -0,0 +1,32 @@
+DELETE FROM `crmdb`.`region_level1_pl` WHERE `id`='3';
+DELETE FROM `crmdb`.`region_level1_pl` WHERE `id`='1';
+DELETE FROM `crmdb`.`region_level1_pl` WHERE `id`='2';
+INSERT INTO `crmdb`.`region_level1_pl` (`id`, `val`) VALUES ('1', '中国区');
+
+ALTER TABLE `crmdb`.`alert`
+ADD COLUMN `alertRegion` MEDIUMINT(9) NULL AFTER `modify_datetime`;
+
+DROP TABLE IF EXISTS `crmdb`.`alert_region_pl`;
+CREATE TABLE `crmdb`.`alert_region_pl` (
+ `id` INT NOT NULL,
+ `val` VARCHAR(255) NULL,
+ PRIMARY KEY (`id`)
+ ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
+
+INSERT INTO `crmdb`.`alert_region_pl` (`id`, `val`) VALUES ('1', '奥诺美北区');
+INSERT INTO `crmdb`.`alert_region_pl` (`id`, `val`) VALUES ('2', '奥诺美东北区');
+INSERT INTO `crmdb`.`alert_region_pl` (`id`, `val`) VALUES ('3', '奥诺美东一区');
+INSERT INTO `crmdb`.`alert_region_pl` (`id`, `val`) VALUES ('4', '奥诺美东二区');
+INSERT INTO `crmdb`.`alert_region_pl` (`id`, `val`) VALUES ('5', '奥诺美西区');
+INSERT INTO `crmdb`.`alert_region_pl` (`id`, `val`) VALUES ('6', '奥诺美南区');
+INSERT INTO `crmdb`.`alert_region_pl` (`id`, `val`) VALUES ('7', '所有区');
+
+DELETE FROM `crmdb`.`data_exchange_teample` WHERE `id`='1';
+
+INSERT INTO `crmdb`.`data_exchange_teample` (`id`, `name`, `template`) VALUES ('1', 'Account Export Full Template 1.0', '\n\n 1000 \n Account \n BdmCode \n account.csv \n crm_mysql \n 100000 \n GBK \n \n Id \n Integer \n Id \n \n\n \n Name \n String \n Name \n \n\n\n \n BdmCode \n String \n BdmCode \n \n\n\n \n DutyOfficer \n String \n DutyOfficer \n \n\n \n numofdoctors \n Integer \n numofdoctors \n \n\n \n numofsurgeryroom \n Integer \n numofsurgeryroom \n \n \n numofsurgeryperyear \n Integer \n numofsurgeryperyear \n \n \n numofpaindoctor \n Integer \n numofpaindoctor \n \n \n numofanesthesiadoctor \n Integer \n numofanesthesiadoctor \n \n \n totalnumofsickbed \n Integer \n totalnumofsickbed \n \n \n numofoutpatient \n Integer \n numofoutpatient \n \n \n numoftreatperyear \n Integer \n numoftreatperyear \n \n \n numofstaff \n Integer \n numofstaff \n \n \n numofassistantdoctors \n Integer \n numofassistantdoctors \n \n\n \n registeredcapital \n Integer \n registeredcapital \n \n \n numofusingopiatesinjection \n Integer \n numofusingopiatesinjection \n \n \n numofusingopiatesmedicine \n Integer \n numofusingopiatesmedicine \n \n\n \n dateofestablish \n Date \n dateofestablish \n m/d/yy \n \n\n \n fax \n Integer \n fax \n \n\n \n tel \n Integer \n tel \n \n\n \n districts \n Integer \n districts \n \n \n address \n Integer \n address \n \n \n owner \n Integer \n owner \n \n \n responsibleperson \n Integer \n responsibleperson \n \n\n\n \n whenadded \n Date \n whenadded \n m/d/yy \n \n\n \n modifydatetime \n Date \n modifydatetime \n m/d/yy \n \n\n \n modifier \n String \n modifier \n \n\n \n administrativlevel \n Integer \n administrativlevel \n \n\n\n \n 医院类型 \n Lookup \n HospitalType \n AccountTypePl \n Val \n Id \n \n\n \n localorarmy \n Lookup \n localorarmy \n AccountLocalOrArmyPl \n Val \n Id \n \n\n \n comprehensiveorspecialized \n Lookup \n comprehensiveorspecialized \n AccountComprehensiveOrSpecializedPl \n Val \n Id \n \n\n\n \n keytype \n Lookup \n keytype \n AccountPointPl \n Val \n Id \n \n \n status \n Lookup \n status \n AccountStatusPl \n Val \n Id \n \n\n \n marketclassification \n Lookup \n marketclassification \n AccountMarketClassificationPl \n Val \n Id \n \n \n province \n Lookup \n province \n Province \n Val \n Id \n \n \n city \n Lookup \n city \n City \n Val \n Id \n \n \n');
+INSERT INTO `crmdb`.`data_exchange_teample` (`id`, `name`, `template`) VALUES ('2', 'Contact Export Full Template 1.0', '\n\n 1000 \n Contact \n contact.csv \n contactCode \n crm_mysql \n GBK \n 100000 \n \n contactCode \n String \n contactCode \n \n \n duty \n Lookup \n duty \n ContactDutyPl \n val \n Id \n \n \n grade \n Lookup \n grade \n ContactGradePl \n val \n Id \n \n \n \n \n \n marketclassification \n Lookup \n marketclassification \n ContactMarketClassificationPl \n val \n Id \n \n \n \n jobtitle \n Lookup \n jobtitle \n ContactJobTitlePl \n val \n Id \n \n \n \n accountId \n Lookup \n accountId \n Account \n Name \n Id \n \n \n \n \n \n city \n Lookup \n city \n City \n val \n Id \n \n \n \n sex \n Lookup \n sex \n SexPl \n val \n Id \n \n \n \n \n \n province \n Lookup \n province \n Province \n val \n Id \n \n \n cellphone \n String \n cellphone \n \n \n contactCode \n String \n contactCode \n \n \n 科室 \n Lookup \n department \n ContactDepartmentPl \n val \n id \n \n \n districts \n String \n districts \n \n \n email \n String \n email \n \n \n modifier \n String \n modifier \n \n \n name \n String \n name \n \n \n nativeplace \n String \n nativeplace \n \n \n officefax \n String \n officefax \n \n \n officetel \n String \n officetel \n \n \n owner \n String \n owner \n \n \n producttarget \n String \n producttarget \n \n \n responsibleperson \n String \n responsibleperson \n \n \n status \n String \n status \n \n \n modifydatetime \n Date \n modifydatetime \n m/d/yy \n \n \n whenadded \n Date \n whenadded \n m/d/yy \n \n \n \n \n \n \n ');
+INSERT INTO `crmdb`.`data_exchange_teample` (`id`, `name`, `template`) VALUES ('3', 'Position Export Full Template 1.0', '\n\n 1000 \n Crmuser \n Id \n position.csv \n crm_mysql \n GBK \n 100000 \n \n Id \n Integer \n Id \n \n \n Name \n String \n Name \n \n \n code \n String \n code \n \n \n reportto \n Integer \n reportto \n \n \n role \n Lookup \n role \n Role \n Val \n Id \n \n \n pl1 \n Lookup \n pl1 \n CrmuserPl1 \n Val \n Id \n \n \n pl2 \n Lookup \n pl2 \n CrmuserPl2 \n Val \n Id \n \n \n role \n Lookup \n role \n Role \n Val \n Id \n \n \n role \n Lookup \n role \n Role \n Val \n Id \n \n \n 城市 \n Lookup \n city \n City \n Val \n Id \n \n \n modifier \n String \n Name \n \n \n department \n String \n Name \n \n\n \n pl4 \n Lookup \n pl4 \n RegionLevel1Pl \n Val \n Id \n \n \n pl5 \n Lookup \n pl5 \n RegionLevel2Pl \n Val \n Id \n \n \n whenadded \n Date \n whenadded \n m/d/yy \n \n \n modifydatetime \n Date \n modifydatetime \n m/d/yy \n \n \n owner \n String \n owner \n \n \n level \n Integer \n level \n \n ');
+INSERT INTO `crmdb`.`data_exchange_teample` (`id`, `name`, `template`) VALUES ('4', 'Activity Export Full Template 1.0', '\n\n 1000 \n Activity \n Id \n Activity.csv \n crm_mysql \n GBK \n 100000 \n \n Id \n Integer \n Id \n \n \n Name \n String \n Name \n \n \n eventtype \n Lookup \n eventtype \n ActivityEventTypePl \n val \n Id \n \n \n starttime \n Date \n starttime \n m/d/yy \n \n \n endtime \n Date \n endtime \n m/d/yy \n \n \n title \n String \n title \n \n \n participants \n String \n participants \n \n \n activitytype \n Lookup \n activitytype \n \n ActivityTypes \n val \n Id \n \n \n');
+INSERT INTO `crmdb`.`data_exchange_teample` (`id`, `name`, `template`) VALUES ('5', 'Account Team Export Full Template 1.0', '\n\n 1000 \n Accountcrmuser \n account_position.csv \n Id \n crm_mysql \n GBK \n 100000 \n \n Id \n Integer \n Id \n \n \n \n accountId \n Lookup \n accountId \n Account \n Name \n Id \n \n \n \n crmuser \n Lookup \n crmuserid \n Crmuser \n name \n Id \n \n ');
+INSERT INTO `crmdb`.`data_exchange_teample` (`id`, `name`, `template`) VALUES ('6', 'UserPosition Team Export Full Template 1.0', '\n\n 1000 \n UserPosition \n user_position.csv \n ExternalId \n crm_mysql \n GBK \n 100000 \n \n Id \n Integer \n Id \n \n positionId \n Integer \n positionId \n \n userId \n Integer \n userId \n \n \n positionid \n Lookup \n positionId \n Crmuser \n Name \n Id \n \n \n userId \n Lookup \n userId \n Userinfo \n name \n Id \n \n \n externalId \n String \n externalId \n \n ');
+
diff --git a/crm/src/main/db/update_57.sql b/crm/src/main/db/update_57.sql
new file mode 100644
index 0000000..17e6698
--- /dev/null
+++ b/crm/src/main/db/update_57.sql
@@ -0,0 +1,14 @@
+ALTER TABLE `crmdb`.`activity`
+ADD COLUMN `activity_coachType` MEDIUMINT(9) NULL AFTER `activity_daypart`;
+
+DROP TABLE IF EXISTS `crmdb`.`activity_coachtype_pl`;
+CREATE TABLE `crmdb`.`activity_coachtype_pl` (
+ `id` MEDIUMINT(9) NOT NULL,
+ `val` VARCHAR(255) NULL,
+ PRIMARY KEY (`id`)
+ ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
+
+INSERT INTO `crmdb`.`activity_coachtype_pl` (`id`, `val`) VALUES ('1', '拜访辅导');
+INSERT INTO `crmdb`.`activity_coachtype_pl` (`id`, `val`) VALUES ('2', '科室会辅导');
+DELETE FROM `crmdb`.`activity_event_type_pl` WHERE `id`='3';
+UPDATE `crmdb`.`activity_event_type_pl` SET `val`='辅导' WHERE `id`='2';
\ No newline at end of file
diff --git a/crm/src/main/db/update_58.sql b/crm/src/main/db/update_58.sql
new file mode 100644
index 0000000..eaeec28
--- /dev/null
+++ b/crm/src/main/db/update_58.sql
@@ -0,0 +1,11 @@
+DROP TABLE IF EXISTS `crmdb`.`data_audit`;
+CREATE TABLE `crmdb`.`data_audit` (
+ `id` INT NOT NULL AUTO_INCREMENT,
+ `entity_name` VARCHAR(45) NOT NULL,
+ `record_id` INT NOT NULL,
+ `modify_time` DATETIME NOT NULL,
+ `modifier` VARCHAR(45) NOT NULL,
+ `column_name` VARCHAR(45) NOT NULL,
+ `old_value` VARCHAR(45) ,
+ `new_value` VARCHAR(45) ,
+ PRIMARY KEY (`id`));
\ No newline at end of file
diff --git a/crm/src/main/db/update_59.sql b/crm/src/main/db/update_59.sql
new file mode 100644
index 0000000..9057d01
--- /dev/null
+++ b/crm/src/main/db/update_59.sql
@@ -0,0 +1,44 @@
+use crmdb;
+drop table if Exists product;
+drop table if Exists productline;
+drop table if Exists productcategory;
+CREATE TABLE `product` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `name` varchar(128) NOT NULL,
+ `status` int(11) NOT NULL DEFAULT '1',
+ `productlineId` int(11) NOT NULL,
+ `description` varchar(512) DEFAULT NULL,
+ `whenadded` datetime DEFAULT NULL,
+ `modify_datetime` datetime DEFAULT NULL,
+ `owner` varchar(50) DEFAULT NULL,
+ `modifier` varchar(50) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;
+
+CREATE TABLE `productcategory` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `name` varchar(128) NOT NULL,
+ `status` int(11) NOT NULL DEFAULT '1',
+ `productId` int(11) NOT NULL,
+ `description` varchar(512) DEFAULT NULL,
+ `whenadded` datetime DEFAULT NULL,
+ `modify_datetime` datetime DEFAULT NULL,
+ `owner` varchar(50) DEFAULT NULL,
+ `modifier` varchar(50) DEFAULT NULL,
+ `productlineId` int(11) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=103 DEFAULT CHARSET=utf8;
+
+CREATE TABLE `productline` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `name` varchar(128) NOT NULL,
+ `status` int(11) NOT NULL DEFAULT '1',
+ `description` varchar(512) DEFAULT NULL,
+ `whenadded` datetime DEFAULT NULL,
+ `modify_datetime` datetime DEFAULT NULL,
+ `owner` varchar(50) DEFAULT NULL,
+ `modifier` varchar(50) DEFAULT NULL,
+ `val` varchar(45) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
+
diff --git a/crm/src/main/db/update_6.sql b/crm/src/main/db/update_6.sql
new file mode 100644
index 0000000..e0752ff
--- /dev/null
+++ b/crm/src/main/db/update_6.sql
@@ -0,0 +1,5 @@
+use crmdb;
+
+-- ALTER table activity_visiting_purpose_pl change activity_type parentId mediumint(9);
+ALTER table activity_visiting_purpose_pl add parentId mediumint(9);
+update activity_visiting_purpose_pl set parentId = activity_type;
\ No newline at end of file
diff --git a/crm/src/main/db/update_60.sql b/crm/src/main/db/update_60.sql
new file mode 100644
index 0000000..7b963de
--- /dev/null
+++ b/crm/src/main/db/update_60.sql
@@ -0,0 +1,3 @@
+ALTER TABLE `crmdb`.`activity`
+CHANGE COLUMN `endtime` `endtime` DATETIME NULL ,
+CHANGE COLUMN `starttime` `starttime` DATETIME NOT NULL ;
\ No newline at end of file
diff --git a/crm/src/main/db/update_61.sql b/crm/src/main/db/update_61.sql
new file mode 100644
index 0000000..433a86d
--- /dev/null
+++ b/crm/src/main/db/update_61.sql
@@ -0,0 +1,15 @@
+CREATE TABLE `crmdb`.`accountcrmuser_relation_history` (
+ `id` INT NOT NULL AUTO_INCREMENT,
+ `position_id` INT NOT NULL,
+ `account_id` INT NOT NULL,
+ `modify_time` DATE NOT NULL,
+ `modifier` VARCHAR(45) NOT NULL,
+ PRIMARY KEY (`id`));
+
+CREATE TABLE `crmdb`.`userposition_relation_history` (
+ `id` INT NOT NULL AUTO_INCREMENT,
+ `position_id` INT NOT NULL,
+ `userinfo_id` INT NOT NULL,
+ `modify_time` DATE NOT NULL,
+ `modifier` VARCHAR(45) NOT NULL,
+ PRIMARY KEY (`id`));
diff --git a/crm/src/main/db/update_62.sql b/crm/src/main/db/update_62.sql
new file mode 100644
index 0000000..f5039ce
--- /dev/null
+++ b/crm/src/main/db/update_62.sql
@@ -0,0 +1,3 @@
+ALTER TABLE `crmdb`.`alert`
+CHANGE COLUMN `expired` `expired` DATETIME NULL DEFAULT NULL ,
+CHANGE COLUMN `publishDate` `publishDate` DATETIME NULL DEFAULT NULL ;
diff --git a/crm/src/main/db/update_63.sql b/crm/src/main/db/update_63.sql
new file mode 100644
index 0000000..e305f40
--- /dev/null
+++ b/crm/src/main/db/update_63.sql
@@ -0,0 +1,15 @@
+drop view if exists crmdb.activity_alert;
+create view crmdb.activity_alert as
+select
+id,
+case
+when to_days(curdate())-to_days(DATE_FORMAT(act.starttime,'%Y-%m-%d'))=0 THEN '今天'
+when to_days(curdate())-to_days(DATE_FORMAT(act.starttime,'%Y-%m-%d'))=1 THEN '昨天'
+when to_days(curdate())-to_days(DATE_FORMAT(act.starttime,'%Y-%m-%d'))=2 THEN '前天'
+when to_days(curdate())-to_days(DATE_FORMAT(act.starttime,'%Y-%m-%d'))>=3 and to_days(curdate())-to_days(DATE_FORMAT(act.starttime,'%Y-%m-%d'))<7 THEN '三天以前'
+when to_days(curdate())-to_days(DATE_FORMAT(act.starttime,'%Y-%m-%d'))>=7 THEN '七天以前'
+ELSE '错误' END as time,
+title,
+act.owner as name,
+act.starttime as times
+from activity act where status=1 and to_days(curdate())-to_days(DATE_FORMAT(act.starttime,'%Y-%m-%d'))>=0 order by times
\ No newline at end of file
diff --git a/crm/src/main/db/update_64.sql b/crm/src/main/db/update_64.sql
new file mode 100644
index 0000000..11123b5
--- /dev/null
+++ b/crm/src/main/db/update_64.sql
@@ -0,0 +1,15 @@
+ALTER TABLE `crmdb`.`alert`
+ADD COLUMN `attachment` MEDIUMINT(9) NULL AFTER `alertRegion`;
+
+CREATE TABLE `crmdb`.`alertattachment` (
+ `id` MEDIUMINT(9) NOT NULL,
+ `fileName` VARCHAR(255) NULL,
+ `whenadded` DATETIME NULL,
+ `owner` VARCHAR(255) NULL,
+ `alertId` MEDIUMINT(9) NULL,
+ `modify_datetime` DATETIME NULL,
+ PRIMARY KEY (`id`)
+ )ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
+
+ALTER TABLE `crmdb`.`data_audit`
+CHANGE COLUMN `modify_time` `modify_time` DATETIME NOT NULL ;
diff --git a/crm/src/main/db/update_65.sql b/crm/src/main/db/update_65.sql
new file mode 100644
index 0000000..c74f2e8
--- /dev/null
+++ b/crm/src/main/db/update_65.sql
@@ -0,0 +1,35 @@
+drop view if exists user_position_query;
+create view user_position_query as select
+accountcrmuser.id as id,
+ `user_position`.`userId` AS `user_id`,
+ `user_position`.`positionId` AS `position_id`,
+ `region_level1_pl`.`val` AS `area`,
+ `region_level2_pl`.`val` AS `region`,
+ `province`.`val` AS `province`,
+ `crmuser_pl2`.`val` AS `productLine`,
+ `crmuser`.`level` AS `position_level`,
+ `crmuser`.`name` AS `position_name`,
+ `crmuser`.`code` AS `position_code`,
+ `userinfo`.`employeeNumber` AS `delegatePosition`,
+ `userinfo`.`name` AS `delegateName`,
+ `parent_position`.`id` AS `manager_position_id`,
+ `parent_position`.`code` AS `managerPosition`,
+ `parent_position`.`name` AS `manager_position_name`,
+ `parent_position`.`level` AS `manager_position_level`,
+ `parent_user_info`.`employeeNumber` AS `manager_employee_number`,
+ `parent_user_info`.`name` AS `regionManager`,
+ `account`.`name` AS `accountName`,
+ `account`.`bdm_code` AS `BDMcode`
+ from
+ (((((((((((`user_position`
+ left join `crmuser` ON ((`user_position`.`positionId` = `crmuser`.`id`)))
+ left join `userinfo` ON ((`user_position`.`userId` = `userinfo`.`id`)))
+ left join `parent_position` ON ((`crmuser`.`reportto` = `parent_position`.`id`)))
+ left join `parent_user_position` ON ((`parent_position`.`id` = `parent_user_position`.`positionId`)))
+ left join `parent_user_info` ON ((`parent_user_position`.`userId` = `parent_user_info`.`id`)))
+ join `accountcrmuser` ON ((`user_position`.`positionId` = `accountcrmuser`.`crmuserId`)))
+ join `account` ON ((`accountcrmuser`.`accountId` = `account`.`id`)))
+ left join `region_level1_pl` ON ((`crmuser`.`pl4` = `region_level1_pl`.`id`)))
+ left join `region_level2_pl` ON ((`crmuser`.`pl5` = `region_level2_pl`.`id`)))
+ left join `province` ON ((`account`.`province` = `province`.`id`)))
+ left join `crmuser_pl2` ON ((`crmuser_pl2`.`id` = `crmuser`.`pl2`)))
\ No newline at end of file
diff --git a/crm/src/main/db/update_66.sql b/crm/src/main/db/update_66.sql
new file mode 100644
index 0000000..d92785a
--- /dev/null
+++ b/crm/src/main/db/update_66.sql
@@ -0,0 +1,8 @@
+ALTER TABLE `crmdb`.`userposition_relation_history`
+CHANGE COLUMN `userinfo_id` `user_id` INT(11) NOT NULL ,
+CHANGE COLUMN `modify_time` `modify_time` DATETIME NOT NULL ;
+
+
+ALTER TABLE `crmdb`.`accountcrmuser_relation_history`
+CHANGE COLUMN `modify_time` `modify_time` DATETIME NOT NULL ;
+
diff --git a/crm/src/main/db/update_67.sql b/crm/src/main/db/update_67.sql
new file mode 100644
index 0000000..970ae93
--- /dev/null
+++ b/crm/src/main/db/update_67.sql
@@ -0,0 +1,41 @@
+drop VIEW if exists user_position_query;
+USE `crmdb`;
+CREATE
+ OR REPLACE ALGORITHM = UNDEFINED
+ DEFINER = `crm`@`localhost`
+ SQL SECURITY DEFINER
+VIEW `user_position_query` AS
+ select
+ `accountcrmuser`.`id` AS `id`,
+ `user_position`.`userId` AS `user_id`,
+ `user_position`.`positionId` AS `position_id`,
+ `region_level1_pl`.`val` AS `area`,
+ `region_level2_pl`.`val` AS `region`,
+ `province`.`val` AS `province`,
+ `productline`.`val` AS `productLine`,
+ `crmuser`.`level` AS `position_level`,
+ `crmuser`.`name` AS `position_name`,
+ `crmuser`.`code` AS `position_code`,
+ `userinfo`.`employeeNumber` AS `delegatePosition`,
+ `userinfo`.`name` AS `delegateName`,
+ `parent_position`.`id` AS `manager_position_id`,
+ `parent_position`.`code` AS `managerPosition`,
+ `parent_position`.`name` AS `manager_position_name`,
+ `parent_position`.`level` AS `manager_position_level`,
+ `parent_user_info`.`employeeNumber` AS `manager_employee_number`,
+ `parent_user_info`.`name` AS `regionManager`,
+ `account`.`name` AS `accountName`,
+ `account`.`bdm_code` AS `BDMcode`
+ from
+ (((((((((((`user_position`
+ left join `crmuser` ON ((`user_position`.`positionId` = `crmuser`.`id`)))
+ left join `userinfo` ON ((`user_position`.`userId` = `userinfo`.`id`)))
+ left join `parent_position` ON ((`crmuser`.`reportto` = `parent_position`.`id`)))
+ left join `parent_user_position` ON ((`parent_position`.`id` = `parent_user_position`.`positionId`)))
+ left join `parent_user_info` ON ((`parent_user_position`.`userId` = `parent_user_info`.`id`)))
+ join `accountcrmuser` ON ((`user_position`.`positionId` = `accountcrmuser`.`crmuserId`)))
+ join `account` ON ((`accountcrmuser`.`accountId` = `account`.`id`)))
+ left join `region_level1_pl` ON ((`crmuser`.`pl4` = `region_level1_pl`.`id`)))
+ left join `region_level2_pl` ON ((`crmuser`.`pl5` = `region_level2_pl`.`id`)))
+ left join `province` ON ((`account`.`province` = `province`.`id`)))
+ left join `productline` ON ((`productline`.`id` = `crmuser`.`pl2`)));
diff --git a/crm/src/main/db/update_68.sql b/crm/src/main/db/update_68.sql
new file mode 100644
index 0000000..184f650
--- /dev/null
+++ b/crm/src/main/db/update_68.sql
@@ -0,0 +1,22 @@
+drop view if exists activity_alert;
+create view activity_alert as
+
+select `act`.`id` AS `id`,
+(case when ((to_days(curdate()) - to_days(date_format(`act`.`starttime`,'%Y-%m-%d'))) = 0) then '今天'
+when ((to_days(curdate()) - to_days(date_format(`act`.`starttime`,'%Y-%m-%d'))) = 1) then '昨天'
+when ((to_days(curdate()) - to_days(date_format(`act`.`starttime`,'%Y-%m-%d'))) = 2) then '前天'
+when (((to_days(curdate()) - to_days(date_format(`act`.`starttime`,'%Y-%m-%d'))) >= 3) and ((to_days(curdate()) - to_days(date_format(`act`.`starttime`,'%Y-%m-%d'))) < 7)) then '三天以前'
+when ((to_days(curdate()) - to_days(date_format(`act`.`starttime`,'%Y-%m-%d'))) >= 7) then '七天以前'
+ else '错误' end) AS `time`,
+`act`.`title` AS `title`,`act`.`owner` AS `name`,`act`.`starttime` AS `starttime` ,act.endtime as endtime,
+c.name as contact,avpp.val as purpose,act.whenadded as addtime,pl.val as product,acp.val as coachtype
+from `activity` `act`
+left join contact c on
+c.id=act.contactId
+left join activity_visiting_purpose_pl avpp on
+act.visiting_purpose=avpp.id
+left join productline pl on
+pl.id=act.feature_product
+left join activity_coachtype_pl acp on
+acp.id=act.activity_coachType
+ where ((`act`.`status` = 1) and ((to_days(curdate()) - to_days(date_format(`act`.`starttime`,'%Y-%m-%d'))) >= 0)) order by `starttime` desc;
diff --git a/crm/src/main/db/update_69.sql b/crm/src/main/db/update_69.sql
new file mode 100644
index 0000000..a247244
--- /dev/null
+++ b/crm/src/main/db/update_69.sql
@@ -0,0 +1,20 @@
+drop view if exists user_position_account;
+create view user_position_account as
+select `ac`.`id` AS `id`,`u`.`name` AS `userName`,`u`.`loginName` AS `loginName`,`u`.`email` AS `email`,`sp`.`val` AS `sex`,`u`.`whenadded` AS `addTime`,`c`.`name` AS `positionName`,`c`.`code` AS `positionCode`,
+(select `crm`.`name` from `crmuser` `crm` where (`crm`.`id` = `c`.`reportto`)) AS `reportTo`,
+(select u.name from userinfo u left join user_position iup on iup.userId=u.id left join crmuser ic on ic.id=iup.positionId where ic.name=(select `crm`.`name` from `crmuser` `crm` where (`crm`.`id` = `c`.`reportto`))) as DSMName,
+(select `c1`.`name` from `crmuser` `c1` where (`c1`.`id` = (select `c2`.`reportto` from `crmuser` `c2` where (`c2`.`id` = `c`.`reportto`)))) AS `reporttto`,
+(select u.name from userinfo u left join user_position iup on iup.userId=u.id left join crmuser ic on ic.id=iup.positionId where ic.name=(select `c1`.`name` from `crmuser` `c1` where (`c1`.`id` = (select `c2`.`reportto` from `crmuser` `c2` where (`c2`.`id` = `c`.`reportto`))))) as RSMName,
+`r`.`val` AS `role`,`rlp4`.`val` AS `regoin1`,`rlp5`.`val` AS `regoin2`,`ct`.`val` AS `city`,`a`.`name` AS `accountName`,`a`.`bdm_code` AS `BDMCode`,`aalp`.`val` AS `adminLevel`,`asp`.`val` AS `status` from (((((((((((`userinfo` `u`
+left join `sex_pl` `sp` on((`u`.`sex` = `sp`.`id`)))
+left join `user_position` `up` on((`u`.`id` = `up`.`userId`)))
+left join `crmuser` `c` on((`up`.`positionId` = `c`.`id`)))
+left join `role` `r` on((`c`.`role` = `r`.`id`)))
+left join `region_level1_pl` `rlp4` on((`c`.`pl4` = `rlp4`.`id`)))
+left join `region_level1_pl` `rlp5` on((`c`.`pl5` = `rlp5`.`id`)))
+left join `city` `ct` on((`c`.`city` = `ct`.`id`)))
+ left join `accountcrmuser` `ac` on((`c`.`id` = `ac`.`crmuserId`)))
+left join `account` `a` on((`ac`.`accountId` = `a`.`id`)))
+left join `account_status_pl` `asp` on((`a`.`status` = `asp`.`id`)))
+left join `account_administrativ_level_pl` `aalp` on((`a`.`administrativ_level` = `aalp`.`id`)))
+where up.status = 1 and c.role>2 and ac.id>0 order by `ac`.`id`;
diff --git a/crm/src/main/db/update_7.sql b/crm/src/main/db/update_7.sql
new file mode 100644
index 0000000..ba1e6a5
--- /dev/null
+++ b/crm/src/main/db/update_7.sql
@@ -0,0 +1,59 @@
+
+
+
+
+DROP TABLE IF EXISTS `userInfo`;
+CREATE TABLE `userInfo` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `name` varchar(255) NOT NULL,
+ `department` varchar(255) DEFAULT NULL,
+ `division` varchar(255) DEFAULT NULL,
+ `cellPhone` varchar(255) DEFAULT NULL,
+ `email` varchar(255) DEFAULT NULL,
+ `employeeNumber` varchar(255) DEFAULT NULL,
+ `photo` varchar(255) DEFAULT NULL,
+ `jobTitle` varchar(255) DEFAULT NULL,
+ `pl1` mediumint(9) DEFAULT NULL,
+ `pl2` mediumint(9) DEFAULT NULL,
+ `role` mediumint(9) DEFAULT NULL,
+ `pl4` mediumint(9) DEFAULT NULL,
+ `pl5` mediumint(9) DEFAULT NULL,
+ `sex` mediumint(9) DEFAULT NULL,
+ `loginName` varchar(255) DEFAULT NULL,
+ `password` varchar(255) DEFAULT NULL,
+ `sessionKey` varchar(255) DEFAULT NULL,
+ `lastLoginTime` bigint(20) DEFAULT NULL,
+ `whenadded` datetime DEFAULT NULL,
+ `reportto` mediumint(9) DEFAULT NULL,
+ `parcel` varchar(255) DEFAULT NULL,
+ `modifier` varchar(255) DEFAULT NULL,
+ `modify_datetime` datetime DEFAULT NULL,
+ `owner` varchar(255) DEFAULT NULL,
+ `postId` varchar(255) DEFAULT NULL,
+ `city` varchar(255) DEFAULT NULL,
+ `isActivited` mediumint(9) DEFAULT NULL,
+ `ts` bigint(20) DEFAULT NULL,
+ `positionId` mediumint(9) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=107 DEFAULT CHARSET=utf8;
+
+INSERT INTO `userInfo` (id,name,loginname,password,role,isActivited,ts,positionId) VALUES
+(-1,'无','dummy','827ccb0eea8a706c4c34a16891f84e7b',1,2,1386766666,-1),
+(1,'Admin Nam','admin','827ccb0eea8a706c4c34a16891f84e7b',1,2,1386766666,1),
+(2,'Sales Manager','salesman','827ccb0eea8a706c4c34a16891f84e7b',2,2,1386766666,2),
+(3,'Sales','sales','827ccb0eea8a706c4c34a16891f84e7b',3,2,1386766666,3);
+
+insert into crmuser (id,name,code,reportto,role) values
+(-1,'无','BJ',0,-1),
+(1,'管理员','BJ231011001',-1,1),
+(2,'北区地区经理01','BJ131011001',1,2),
+(3,'北区代表001','BJ131001001',2,3);
+
+
+
+ALTER table crmuser ADD level MEDIUMINT;
+ALTER table crmuser ADD position_code varchar(255);
+
+
+
+
diff --git a/crm/src/main/db/update_70.sql b/crm/src/main/db/update_70.sql
new file mode 100644
index 0000000..b5a7b34
--- /dev/null
+++ b/crm/src/main/db/update_70.sql
@@ -0,0 +1,3 @@
+ALTER TABLE `crmdb`.`alertattachment`
+CHANGE COLUMN `id` `id` MEDIUMINT(9) NOT NULL AUTO_INCREMENT ,
+ADD COLUMN `modifier` VARCHAR(255) NULL AFTER `modify_datetime`;
\ No newline at end of file
diff --git a/crm/src/main/db/update_71.sql b/crm/src/main/db/update_71.sql
new file mode 100644
index 0000000..27c0cc2
--- /dev/null
+++ b/crm/src/main/db/update_71.sql
@@ -0,0 +1,2 @@
+ALTER TABLE `crmdb`.`alertattachment`
+ADD COLUMN `srcForFile` VARCHAR(255) NULL AFTER `modifier`;
\ No newline at end of file
diff --git a/crm/src/main/db/update_72.sql b/crm/src/main/db/update_72.sql
new file mode 100644
index 0000000..d8cd489
--- /dev/null
+++ b/crm/src/main/db/update_72.sql
@@ -0,0 +1,3 @@
+ALTER TABLE `crmdb`.`contact`
+ADD COLUMN `initializationdepartment` VARCHAR(128) NULL AFTER `externalId`;
+UPDATE `crmdb`.`contact_grade_pl` SET `val`='VIP' WHERE `id`='4';
\ No newline at end of file
diff --git a/crm/src/main/db/update_73.sql b/crm/src/main/db/update_73.sql
new file mode 100644
index 0000000..217b5a6
--- /dev/null
+++ b/crm/src/main/db/update_73.sql
@@ -0,0 +1,82 @@
+USE `crmdb`;
+drop view if exists activity_alert;
+CREATE
+ OR REPLACE ALGORITHM = UNDEFINED
+ DEFINER = `crm`@`localhost`
+ SQL SECURITY DEFINER
+VIEW `activity_alert` AS
+ select
+ `act`.`id` AS `id`,
+ (case
+ when ((to_days(curdate()) - to_days(date_format(`act`.`starttime`, '%Y-%m-%d'))) = 0) then '今天'
+ when ((to_days(curdate()) - to_days(date_format(`act`.`starttime`, '%Y-%m-%d'))) = 1) then '昨天'
+ when ((to_days(curdate()) - to_days(date_format(`act`.`starttime`, '%Y-%m-%d'))) = 2) then '前天'
+ when
+ (((to_days(curdate()) - to_days(date_format(`act`.`starttime`, '%Y-%m-%d'))) >= 3)
+ and ((to_days(curdate()) - to_days(date_format(`act`.`starttime`, '%Y-%m-%d'))) < 7))
+ then
+ '三天以前'
+ when ((to_days(curdate()) - to_days(date_format(`act`.`starttime`, '%Y-%m-%d'))) >= 7) then '七天以前'
+ else '错误'
+ end) AS `time`,
+ `act`.`title` AS `title`,
+ `act`.`owner` AS `name`,
+ `act`.`starttime` AS `starttime`,
+ `act`.`endtime` AS `endtime`,
+ `c`.`id` AS `contact`,
+ `avpp`.`val` AS `purpose`,
+ `act`.`whenadded` AS `addtime`,
+ `pl`.`val` AS `product`,
+ `acp`.`val` AS `coachtype`
+ from
+ ((((`activity` `act`
+ left join `contact` `c` ON ((`c`.`id` = `act`.`contactId`)))
+ left join `activity_visiting_purpose_pl` `avpp` ON ((`act`.`visiting_purpose` = `avpp`.`id`)))
+ left join `productline` `pl` ON ((`pl`.`id` = `act`.`feature_product`)))
+ left join `activity_coachtype_pl` `acp` ON ((`acp`.`id` = `act`.`activity_coachType`)))
+ where
+ ((`act`.`status` = 1)
+ and ((to_days(curdate()) - to_days(date_format(`act`.`starttime`, '%Y-%m-%d'))) >= 0))
+ order by `act`.`starttime` desc;
+
+
+ drop view if exists user_position_query;
+ CREATE
+ ALGORITHM = UNDEFINED
+ DEFINER = `crm`@`localhost`
+ SQL SECURITY DEFINER
+VIEW `user_position_query` AS
+ select
+ `accountcrmuser`.`id` AS `id`,
+ `user_position`.`userId` AS `user_id`,
+ `user_position`.`positionId` AS `position_id`,
+ `region_level1_pl`.`val` AS `area`,
+ `region_level2_pl`.`val` AS `region`,
+ `province`.`val` AS `province`,
+ `productline`.`val` AS `productLine`,
+ `crmuser`.`level` AS `position_level`,
+ `crmuser`.`name` AS `position_name`,
+ `crmuser`.`code` AS `position_code`,
+ `userinfo`.`employeeNumber` AS `delegatePosition`,
+ `userinfo`.`name` AS `delegateName`,
+ `parent_position`.`id` AS `manager_position_id`,
+ `parent_position`.`code` AS `managerPosition`,
+ `parent_position`.`name` AS `manager_position_name`,
+ `parent_position`.`level` AS `manager_position_level`,
+ `parent_user_info`.`employeeNumber` AS `manager_employee_number`,
+ `parent_user_info`.`name` AS `regionManager`,
+ `account`.`id` AS `accountName`,
+ `account`.`bdm_code` AS `BDMcode`
+ from
+ (((((((((((`user_position`
+ left join `crmuser` ON ((`user_position`.`positionId` = `crmuser`.`id`)))
+ left join `userinfo` ON ((`user_position`.`userId` = `userinfo`.`id`)))
+ left join `parent_position` ON ((`crmuser`.`reportto` = `parent_position`.`id`)))
+ left join `parent_user_position` ON ((`parent_position`.`id` = `parent_user_position`.`positionId`)))
+ left join `parent_user_info` ON ((`parent_user_position`.`userId` = `parent_user_info`.`id`)))
+ join `accountcrmuser` ON ((`user_position`.`positionId` = `accountcrmuser`.`crmuserId`)))
+ join `account` ON ((`accountcrmuser`.`accountId` = `account`.`id`)))
+ left join `region_level1_pl` ON ((`crmuser`.`pl4` = `region_level1_pl`.`id`)))
+ left join `region_level2_pl` ON ((`crmuser`.`pl5` = `region_level2_pl`.`id`)))
+ left join `province` ON ((`account`.`province` = `province`.`id`)))
+ left join `productline` ON ((`productline`.`id` = `crmuser`.`pl2`)))
diff --git a/crm/src/main/db/update_8.sql b/crm/src/main/db/update_8.sql
new file mode 100644
index 0000000..1b91b40
--- /dev/null
+++ b/crm/src/main/db/update_8.sql
@@ -0,0 +1,9 @@
+
+drop table if exists user_position;
+create table user_position (
+id int(64) auto_increment,
+userId int(64),
+positionId int(64),
+primary key (id),
+unique index user_position_unique (userId,positionId)
+)ENGINE InnoDB;
\ No newline at end of file
diff --git a/crm/src/main/doc/account_crmuser_import.csv b/crm/src/main/doc/account_crmuser_import.csv
new file mode 100644
index 0000000..babebdb
--- /dev/null
+++ b/crm/src/main/doc/account_crmuser_import.csv
@@ -0,0 +1 @@
+BDM,λ,ExternalId
16940,SH131011001,16940SH131011001
16879,SH131011001,16879SH131011001
16836,SH131011001,16836SH131011001
\ No newline at end of file
diff --git a/crm/src/main/doc/account_crmuser_import.xml b/crm/src/main/doc/account_crmuser_import.xml
new file mode 100644
index 0000000..192c097
--- /dev/null
+++ b/crm/src/main/doc/account_crmuser_import.xml
@@ -0,0 +1,30 @@
+
+
+ 1000
+ Accountcrmuser
+ account_crmuser_import.csv
+ ExternalId
+ crm_mysql
+ 100000
+
+ ExternalId
+ String
+ ExternalId
+
+
+ BDM编码
+ Lookup
+ accountId
+ Account
+ BdmCode
+ Id
+
+
+ 岗位编码
+ Lookup
+ crmuserid
+ Crmuser
+ Code
+ Id
+
+
\ No newline at end of file
diff --git a/crm/src/main/doc/account_export.xml b/crm/src/main/doc/account_export.xml
new file mode 100644
index 0000000..00327ea
--- /dev/null
+++ b/crm/src/main/doc/account_export.xml
@@ -0,0 +1,246 @@
+
+
+ 1000
+ Account
+ BdmCode
+ account.csv
+ crm_mysql
+ 100000
+
+ Id
+ Integer
+ Id
+
+
+
+ Name
+ String
+ Name
+
+
+
+
+ BdmCode
+ String
+ BdmCode
+
+
+
+
+ Grade
+ String
+ Grade
+
+
+
+ DutyOfficer
+ String
+ DutyOfficer
+
+
+
+ numofdoctors
+ Integer
+ numofdoctors
+
+
+
+ numofsurgeryroom
+ Integer
+ numofsurgeryroom
+
+
+ numofsurgeryperyear
+ Integer
+ numofsurgeryperyear
+
+
+ numofpaindoctor
+ Integer
+ numofpaindoctor
+
+
+ numofanesthesiadoctor
+ Integer
+ numofanesthesiadoctor
+
+
+ totalnumofsickbed
+ Integer
+ totalnumofsickbed
+
+
+ numofoutpatient
+ Integer
+ numofoutpatient
+
+
+ numoftreatperyear
+ Integer
+ numoftreatperyear
+
+
+ numofstaff
+ Integer
+ numofstaff
+
+
+ numofassistantdoctors
+ Integer
+ numofassistantdoctors
+
+
+
+ registeredcapital
+ Integer
+ registeredcapital
+
+
+ numofusingopiatesinjection
+ Integer
+ numofusingopiatesinjection
+
+
+ numofusingopiatesmedicine
+ Integer
+ numofusingopiatesmedicine
+
+
+
+ dateofestablish
+ Date
+ dateofestablish
+ m/d/yy
+
+
+
+ fax
+ Integer
+ fax
+
+
+
+ tel
+ Integer
+ tel
+
+
+
+ districts
+ Integer
+ districts
+
+
+ address
+ Integer
+ address
+
+
+ owner
+ Integer
+ owner
+
+
+ responsibleperson
+ Integer
+ responsibleperson
+
+
+
+
+ whenadded
+ Date
+ whenadded
+ m/d/yy
+
+
+
+ modifydatetime
+ Date
+ modifydatetime
+ m/d/yy
+
+
+
+ modifier
+ String
+ modifier
+
+
+
+ administrativlevel
+ String
+ administrativlevel
+
+
+
+
+ 医院类型
+ Lookup
+ HospitalType
+ AccountTypePl
+ Val
+ Id
+
+
+
+ localorarmy
+ Lookup
+ localorarmy
+ AccountLocalOrArmyPl
+ Val
+ Id
+
+
+
+ comprehensiveorspecialized
+ Lookup
+ comprehensiveorspecialized
+ AccountComprehensiveOrSpecializedPl
+ Val
+ Id
+
+
+
+
+ keytype
+ Lookup
+ keytype
+ AccountPointPl
+ Val
+ Id
+
+
+ status
+ Lookup
+ status
+ AccountStatusPl
+ Val
+ Id
+
+
+
+ marketclassification
+ Lookup
+ marketclassification
+ AccountMarketClassificationPl
+ Val
+ Id
+
+
+ province
+ Lookup
+ province
+ Province
+ Val
+ Id
+
+
+ city
+ Lookup
+ city
+ City
+ Val
+ Id
+
+
diff --git a/crm/src/main/doc/account_import.csv b/crm/src/main/doc/account_import.csv
new file mode 100644
index 0000000..f408d14
--- /dev/null
+++ b/crm/src/main/doc/account_import.csv
@@ -0,0 +1 @@
+BDM,ҽԺ,ʡ,,,,ҽԺ,طҽԺ,ۺרҽԺ,صҽԺ,״̬,ҽԺּ,г
10071,ѪܲרҽԺ,,,,,ŵĿҽԺ,طҽԺ,ۺҽԺ,ŵصҽԺ,Ч,,սԳ
11139,йһͻְҽԺ,,,ϳ,δ,ĿҽԺ,ҽԺ,רҽԺ,صҽԺ,Ч,,һ
1114,дȾҽԺ,,,,,ʹĿҽԺ,ҽԺ,ۺҽԺ,ŵصҽԺ,Ч,,
\ No newline at end of file
diff --git a/crm/src/main/doc/account_import.xml b/crm/src/main/doc/account_import.xml
new file mode 100644
index 0000000..fc82666
--- /dev/null
+++ b/crm/src/main/doc/account_import.xml
@@ -0,0 +1,106 @@
+
+
+ 1000
+ Account
+ BdmCode
+ account_import.csv
+ crm_mysql
+ 100000
+
+ BDM编码
+ String
+ BdmCode
+
+
+ 标准医院名
+ String
+ Name
+
+
+ 省份
+ Lookup
+ Province
+ Province
+ Val
+ Id
+
+
+ 城市
+ Lookup
+ city
+ City
+ Val
+ Id
+
+
+ 区县
+ String
+ districts
+
+
+ true
+ 行政级别
+ Lookup
+ AdministrativLevel
+ AccountAdministrativLevelPl
+ Val
+ Id
+
+
+ true
+ 医院分级
+ Lookup
+ Grade
+ AccountGradePl
+ Val
+ Id
+
+
+ 医院类型
+ Lookup
+ HospitalType
+ AccountTypePl
+ Val
+ Id
+
+
+ 地方军队医院
+ Lookup
+ LocalOrArmy
+ AccountLocalOrArmyPl
+ Val
+ Id
+
+
+ 综合专科医院
+ Lookup
+ ComprehensiveOrSpecialized
+ AccountComprehensiveOrSpecializedPl
+ Val
+ Id
+
+
+ 重点医院
+ Lookup
+ KeyType
+ AccountPointPl
+ Val
+ Id
+
+
+ 状态
+ Lookup
+ Status
+ AccountStatusPl
+ Val
+ Id
+
+
+ 市场分类
+ Lookup
+ MarketClassification
+ AccountMarketClassificationPl
+ Val
+ Id
+
+
diff --git a/crm/src/main/doc/account_position_export.xml b/crm/src/main/doc/account_position_export.xml
new file mode 100644
index 0000000..876b701
--- /dev/null
+++ b/crm/src/main/doc/account_position_export.xml
@@ -0,0 +1,32 @@
+
+
+ 1000
+ Accountcrmuser
+ account_position.csv
+ Id
+ crm_mysql
+ 100000
+
+ Id
+ Integer
+ Id
+
+
+
+ accountId
+ Lookup
+ accountId
+ Account
+ Name
+ Id
+
+
+
+ crmuser
+ Lookup
+ crmuserid
+ Crmuser
+ name
+ Id
+
+
\ No newline at end of file
diff --git a/crm/src/main/doc/activity_crmuser_export.xml b/crm/src/main/doc/activity_crmuser_export.xml
new file mode 100644
index 0000000..33499ae
--- /dev/null
+++ b/crm/src/main/doc/activity_crmuser_export.xml
@@ -0,0 +1,35 @@
+
+
+ 1000
+ Activitycrmuser
+ activity_crmuser.csv
+ Id
+ crm_mysql
+ 100000
+
+ Id
+ Integer
+ Id
+
+
+
+ activityid
+ Lookup
+ activityid
+ Activity
+ Name
+ Id
+
+
+
+ crmuserid
+ Lookup
+ crmuserid
+ Userinfo
+ name
+ Id
+
+
+
+
+
\ No newline at end of file
diff --git a/crm/src/main/doc/activity_export.xml b/crm/src/main/doc/activity_export.xml
new file mode 100644
index 0000000..364059b
--- /dev/null
+++ b/crm/src/main/doc/activity_export.xml
@@ -0,0 +1,67 @@
+
+
+ 1000
+ Activity
+ Id
+ Activity.csv
+ crm_mysql
+ 100000
+
+ Id
+ Integer
+ Id
+
+
+ Name
+ String
+ Name
+
+
+
+ crmuserId
+ Lookup
+ crmuserId
+ Userinfo
+ Name
+ Id
+
+
+ eventtype
+ Lookup
+ eventtype
+ ActivityEventTypePl
+ val
+ Id
+
+
+ starttime
+ Date
+ starttime
+ m/d/yy
+
+
+ endtime
+ Date
+ endtime
+ m/d/yy
+
+
+ title
+ String
+ title
+
+
+ participants
+ String
+ participants
+
+
+ activitytype
+ Lookup
+ activitytype
+
+ ActivityTypes
+ val
+ Id
+
+
diff --git a/crm/src/main/doc/configuration.xml b/crm/src/main/doc/configuration.xml
new file mode 100644
index 0000000..94d59d6
--- /dev/null
+++ b/crm/src/main/doc/configuration.xml
@@ -0,0 +1,37 @@
+
+
+ 1000
+ crm_mysql
+ Account
+ ExternalId
+
+ false
+ Id
+ Integer
+ Id
+
+
+ false
+ ExternalId
+ Integer
+ ExternalId
+
+
+ false
+ StartTime
+ Date
+ StartTime
+ YYYY-MM-DD
+
+
+ true
+ Department
+ Lookup
+ DepartmentId
+ Department
+ Name
+ Id
+
+ account.csv
+ 1000000
+
diff --git a/crm/src/main/doc/contact_export.xml b/crm/src/main/doc/contact_export.xml
new file mode 100644
index 0000000..349d7f6
--- /dev/null
+++ b/crm/src/main/doc/contact_export.xml
@@ -0,0 +1,180 @@
+
+
+ 1000
+ Contact
+ contact.csv
+ contactCode
+ crm_mysql
+ 100000
+
+ contactCode
+ String
+ contactCode
+
+
+ duty
+ Lookup
+ duty
+ ContactDutyPl
+ val
+ Id
+
+
+ grade
+ Lookup
+ grade
+ ContactGradePl
+ val
+ Id
+
+
+
+
+
+ marketclassification
+ Lookup
+ marketclassification
+ ContactMarketClassificationPl
+ val
+ Id
+
+
+
+ jobtitle
+ Lookup
+ jobtitle
+ ContactJobTitlePl
+ val
+ Id
+
+
+
+ accountId
+ Lookup
+ accountId
+ Account
+ Name
+ Id
+
+
+
+
+
+ city
+ Lookup
+ city
+ City
+ val
+ Id
+
+
+
+ sex
+ Lookup
+ sex
+ SexPl
+ val
+ Id
+
+
+
+
+
+ province
+ Lookup
+ province
+ Province
+ val
+ Id
+
+
+ cellphone
+ String
+ cellphone
+
+
+ contactCode
+ String
+ contactCode
+
+
+ 科室
+ Lookup
+ department
+ ContactDepartmentPl
+ val
+ id
+
+
+ districts
+ String
+ districts
+
+
+ email
+ String
+ email
+
+
+ modifier
+ String
+ modifier
+
+
+ name
+ String
+ name
+
+
+ nativeplace
+ String
+ nativeplace
+
+
+ officefax
+ String
+ officefax
+
+
+ officetel
+ String
+ officetel
+
+
+ owner
+ String
+ owner
+
+
+ producttarget
+ String
+ producttarget
+
+
+ responsibleperson
+ String
+ responsibleperson
+
+
+ status
+ String
+ status
+
+
+ modifydatetime
+ Date
+ modifydatetime
+ m/d/yy
+
+
+ whenadded
+ Date
+ whenadded
+ m/d/yy
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/crm/src/main/doc/contact_import.csv b/crm/src/main/doc/contact_import.csv
new file mode 100644
index 0000000..2a6d48c
--- /dev/null
+++ b/crm/src/main/doc/contact_import.csv
@@ -0,0 +1 @@
+,ҽּ,¾,ʹ̨,ְ,ְ,Ա,ֻ,BDM,״̬,CRMҽ,ο,
ƽ,A,80,80,סԺҽʦ,,,13888888888,20540,Ч,D0000001,,
лȻ,A,20,20,ҽʦ,,Ů,13777777777,20540,Ч,D0000002,,
,A,20,20,ҽʦ,ɹ,,13555555555,20151,Ч,D0000003,,
\ No newline at end of file
diff --git a/crm/src/main/doc/contact_import.xml b/crm/src/main/doc/contact_import.xml
new file mode 100644
index 0000000..be95619
--- /dev/null
+++ b/crm/src/main/doc/contact_import.xml
@@ -0,0 +1,76 @@
+
+
+ 1000
+ Contact
+ contact_import.csv
+ ContactCode
+ crm_mysql
+ 100000
+
+
+ Code
+ String
+ ContactCode
+
+
+
+ 目标医生姓名
+ String
+ name
+
+
+ 医生级别
+ Lookup
+ grade
+ ContactGradePl
+ val
+ Id
+
+
+ 职称
+ Lookup
+ jobtitle
+ ContactJobTitlePl
+ val
+ Id
+
+
+
+ 行政职务(如有)
+ Lookup
+ duty
+ ContactDutyPl
+ val
+ Id
+
+
+ 医院ID
+ Lookup
+ accountid
+ Account
+ BdmCode
+ Id
+
+
+ 科室
+ Lookup
+ department
+ ContactDepartmentPl
+ val
+ id
+
+
+ 性别
+ Lookup
+ sex
+ SexPl
+ val
+ Id
+
+
+
+ 手机
+ String
+ cellphone
+
+
\ No newline at end of file
diff --git a/crm/src/main/doc/crmuser_import.csv b/crm/src/main/doc/crmuser_import.csv
new file mode 100644
index 0000000..0cff48d
--- /dev/null
+++ b/crm/src/main/doc/crmuser_import.csv
@@ -0,0 +1 @@
+λ,λ,ϼλ,ɫ,״̬,Ʒ,,һ,,
E1131031001,E1131031001,,,Ч,ŵ,31,й,,ŵһ
һ01,SH131021001,E1131031001,,Ч,ŵ,21,й,Ϻ,ŵһ
һ001,SH131011001,SH131021001,۴,Ч,ŵ,11,й,Ϻ,ŵһ
\ No newline at end of file
diff --git a/crm/src/main/doc/crmuser_reportto_import.csv b/crm/src/main/doc/crmuser_reportto_import.csv
new file mode 100644
index 0000000..0cff48d
--- /dev/null
+++ b/crm/src/main/doc/crmuser_reportto_import.csv
@@ -0,0 +1 @@
+λ,λ,ϼλ,ɫ,״̬,Ʒ,,һ,,
E1131031001,E1131031001,,,Ч,ŵ,31,й,,ŵһ
һ01,SH131021001,E1131031001,,Ч,ŵ,21,й,Ϻ,ŵһ
һ001,SH131011001,SH131021001,۴,Ч,ŵ,11,й,Ϻ,ŵһ
\ No newline at end of file
diff --git a/crm/src/main/doc/mag.rptdesign b/crm/src/main/doc/mag.rptdesign
new file mode 100644
index 0000000..903ef96
--- /dev/null
+++ b/crm/src/main/doc/mag.rptdesign
@@ -0,0 +1,8302 @@
+
+
+ Eclipse BIRT Designer Version 4.3.1.v201309091055 Build <4.3.1.v20130918-1142>
+
+
+ Data Cube - dl_by_dn_date.dl_by_dn_date.x
+ integer
+ false
+
+
+ Data Cube - dl_by_dn_date.dl_by_dn_date.y
+ integer
+ false
+
+
+ downloading_mag.downloading_of_magazine.x
+ integer
+ false
+
+
+ downloading_mag.downloading_of_magazine.y
+ integer
+ false
+
+
+ downloading_mag.downloading_of_magazine.width
+ integer
+ false
+
+
+ downloading_mag.downloading_of_magazine.height
+ integer
+ false
+
+
+ downloading_mag.Group3.NewTabularHierarchy4.x
+ integer
+ false
+
+
+ downloading_mag.Group3.NewTabularHierarchy4.y
+ integer
+ false
+
+
+ 135
+ 80
+ 226
+ 46
+ 150
+ 200
+ 12
+ 46
+
+
+ queryText
+ 297
+
+
+ queryTimeOut
+ 297
+
+
+ rowFetchSize
+ 297
+
+
+ queryText
+ 273
+
+
+ queryTimeOut
+ 273
+
+
+ rowFetchSize
+ 273
+
+
+ queryText
+ 275
+
+
+ queryTimeOut
+ 275
+
+
+ rowFetchSize
+ 275
+
+
+ in
+ /templates/blank_report.gif
+ auto layout
+ ltr
+ 96
+
+
+
+
+ metadataBidiFormatStr
+ ILYNN
+
+
+ disabledMetadataBidiFormatStr
+
+
+ contentBidiFormatStr
+ ILYNN
+
+
+ disabledContentBidiFormatStr
+
+
+ com.mysql.jdbc.Driver
+ jdbc:mysql://localhost:3306/analyzerdb
+ analyzer
+ New BIRT JDBC Data Source
+ abc
+
+
+
+
+
+
+ id
+ measure
+ id
+ id
+
+
+ device_id
+ dimension
+ device_id
+ device_id
+
+
+ log_time
+ dimension
+ log_time
+ log_time
+
+
+ event_type
+ dimension
+ event_type
+ event_type
+
+
+ param1
+ dimension
+ param1
+ param1
+
+
+ param2
+ dimension
+ param2
+ param2
+
+
+ param3
+ dimension
+ param3
+ param3
+
+
+ param4
+ dimension
+ param4
+ param4
+
+
+ param5
+ dimension
+ param5
+ param5
+
+
+ param6
+ dimension
+ param6
+ param6
+
+
+
+
+
+ 1
+ id
+ decimal
+
+
+ 2
+ device_id
+ string
+
+
+ 3
+ log_time
+ date-time
+
+
+ 4
+ event_type
+ string
+
+
+ 5
+ param1
+ string
+
+
+ 6
+ param2
+ string
+
+
+ 7
+ param3
+ string
+
+
+ 8
+ param4
+ string
+
+
+ 9
+ param5
+ string
+
+
+ 10
+ param6
+ string
+
+
+
+ analyzer data source
+
+
+ 1
+ id
+ id
+ decimal
+ -5
+
+
+ 2
+ device_id
+ device_id
+ string
+ 12
+
+
+ 3
+ log_time
+ log_time
+ date-time
+ 93
+
+
+ 4
+ event_type
+ event_type
+ string
+ 12
+
+
+ 5
+ param1
+ param1
+ string
+ 12
+
+
+ 6
+ param2
+ param2
+ string
+ 12
+
+
+ 7
+ param3
+ param3
+ string
+ 12
+
+
+ 8
+ param4
+ param4
+ string
+ 12
+
+
+ 9
+ param5
+ param5
+ string
+ 12
+
+
+ 10
+ param6
+ param6
+ string
+ 12
+
+
+
+
+
+ 2.0
+
+
+
+
+
+
+ id
+ 1
+
+ -5
+ 20
+ 0
+ NotNullable
+
+ id
+
+
+
+ id
+
+ 20
+
+
+
+
+
+
+ device_id
+ 2
+
+ 12
+ 64
+ 0
+ NotNullable
+
+ device_id
+
+
+
+ device_id
+
+ 64
+
+
+
+
+
+
+ log_time
+ 3
+
+ 93
+ 19
+ 0
+ NotNullable
+
+ log_time
+
+
+
+ log_time
+
+ 19
+
+
+
+
+
+
+ event_type
+ 4
+
+ 12
+ 32
+ 0
+ Nullable
+
+ event_type
+
+
+
+ event_type
+
+ 32
+
+
+
+
+
+
+ param1
+ 5
+
+ 12
+ 64
+ 0
+ Nullable
+
+ param1
+
+
+
+ param1
+
+ 64
+
+
+
+
+
+
+ param2
+ 6
+
+ 12
+ 64
+ 0
+ Nullable
+
+ param2
+
+
+
+ param2
+
+ 64
+
+
+
+
+
+
+ param3
+ 7
+
+ 12
+ 64
+ 0
+ Nullable
+
+ param3
+
+
+
+ param3
+
+ 64
+
+
+
+
+
+
+ param4
+ 8
+
+ 12
+ 64
+ 0
+ Nullable
+
+ param4
+
+
+
+ param4
+
+ 64
+
+
+
+
+
+
+ param5
+ 9
+
+ 12
+ 64
+ 0
+ Nullable
+
+ param5
+
+
+
+ param5
+
+ 64
+
+
+
+
+
+
+ param6
+ 10
+
+ 12
+ 64
+ 0
+ Nullable
+
+ param6
+
+
+
+ param6
+
+ 64
+
+
+
+
+
+
+
+ ]]>
+
+
+ nulls lowest
+
+
+ count(id)
+ measure
+ count(id)
+ count(id)
+
+
+ dldt
+ dimension
+ dldt
+ dldt
+
+
+
+
+
+
+ 1
+ count(id)
+ decimal
+
+
+ 2
+ dldt
+ date
+
+
+
+ analyzer data source
+
+
+ 1
+ count(id)
+ count(id)
+ decimal
+ -5
+
+
+ 2
+ dldt
+ dldt
+ date
+ 12
+
+
+
+
+
+ 2.0
+
+
+
+
+
+
+ imei
+ 1
+
+ 12
+ 32
+ 0
+ Nullable
+
+ imei
+
+
+
+ imei
+
+ 32
+
+
+
+
+
+
+ dldt
+ 2
+
+ 12
+ 10
+ 0
+ Nullable
+
+ dldt
+
+
+
+ dldt
+
+ 10
+
+
+
+
+
+
+
+ ]]>
+
+
+
+
+ count(device_id)
+ measure
+ count(device_id)
+ count(device_id)
+
+
+ dt
+ dimension
+ dt
+ dt
+
+
+
+
+
+
+ 1
+ count(device_id)
+ decimal
+
+
+ 2
+ dt
+ date
+
+
+
+ analyzer data source
+
+
+ 1
+ count(device_id)
+ count(device_id)
+ decimal
+ -5
+
+
+ 2
+ dt
+ dt
+ date
+ 12
+
+
+
+
+
+ 2.0
+
+
+
+
+
+
+ count(device_id)
+ 1
+
+ -5
+ 21
+ 0
+ NotNullable
+
+ count(device_id)
+
+
+
+ count(device_id)
+
+ 21
+
+
+
+
+
+
+ dt
+ 2
+
+ 12
+ 8
+ 0
+ Nullable
+
+ dt
+
+
+
+ dt
+
+ 8
+
+
+
+
+
+
+
+ ]]>
+
+
+
+
+ count(id)
+ measure
+ count(id)
+ count(id)
+
+
+ dt
+ dimension
+ dt
+ dt
+
+
+
+
+
+
+ 1
+ count(id)
+ decimal
+
+
+ 2
+ dt
+ string
+
+
+
+ analyzer data source
+
+
+ 1
+ count(id)
+ count(id)
+ decimal
+ -5
+
+
+ 2
+ dt
+ dt
+ string
+ 12
+
+
+
+
+
+ 2.0
+
+
+
+
+
+
+ count(id)
+ 1
+
+ -5
+ 21
+ 0
+ NotNullable
+
+ count(id)
+
+
+
+ count(id)
+
+ 21
+
+
+
+
+
+
+ dt
+ 2
+
+ 12
+ 8
+ 0
+ Nullable
+
+ dt
+
+
+
+ dt
+
+ 8
+
+
+
+
+
+
+
+ ]]>
+
+
+
+
+ count(id)
+ measure
+ count(id)
+ count(id)
+
+
+ dt
+ dimension
+ dt
+ dt
+
+
+
+
+
+
+ 1
+ count(id)
+ decimal
+
+
+ 2
+ dt
+ date
+
+
+
+ analyzer data source
+
+
+ 1
+ count(id)
+ count(id)
+ decimal
+ -5
+
+
+ 2
+ dt
+ dt
+ date
+ 12
+
+
+
+
+
+ 2.0
+
+
+
+
+
+
+ count(id)
+ 1
+
+ -5
+ 21
+ 0
+ NotNullable
+
+ count(id)
+
+
+
+ count(id)
+
+ 21
+
+
+
+
+
+
+ dt
+ 2
+
+ 12
+ 8
+ 0
+ Nullable
+
+ dt
+
+
+
+ dt
+
+ 8
+
+
+
+
+
+
+
+ ]]>
+
+
+ nulls lowest
+
+
+ dt
+ dimension
+ dt
+ dt
+
+
+ MagazineName
+ dimension
+ MagazineName
+ MagazineName
+
+
+ count(magazine.MagazineId)
+ measure
+ count(magazine.MagazineId)
+ count(magazine.MagazineId)
+
+
+
+
+
+
+ 1
+ dt
+ date
+
+
+ 2
+ MagazineName
+ string
+
+
+ 3
+ count(magazine.MagazineId)
+ decimal
+
+
+
+ analyzer data source
+
+
+ 1
+ dt
+ dt
+ date
+ 12
+
+
+ 2
+ MagazineName
+ MagazineName
+ string
+ 12
+
+
+ 3
+ count(magazine.MagazineId)
+ count(magazine.MagazineId)
+ decimal
+ -5
+
+
+
+
+
+ 2.0
+
+
+
+
+
+
+ id
+ 1
+
+ -5
+ 20
+ 0
+ NotNullable
+
+ id
+
+
+
+ id
+
+ 20
+
+
+
+
+
+
+ device_id
+ 2
+
+ 12
+ 64
+ 0
+ NotNullable
+
+ device_id
+
+
+
+ device_id
+
+ 64
+
+
+
+
+
+
+ log_time
+ 3
+
+ 93
+ 19
+ 0
+ NotNullable
+
+ log_time
+
+
+
+ log_time
+
+ 19
+
+
+
+
+
+
+ event_type
+ 4
+
+ 12
+ 32
+ 0
+ Nullable
+
+ event_type
+
+
+
+ event_type
+
+ 32
+
+
+
+
+
+
+ param1
+ 5
+
+ 12
+ 64
+ 0
+ Nullable
+
+ param1
+
+
+
+ param1
+
+ 64
+
+
+
+
+
+
+ param2
+ 6
+
+ 12
+ 64
+ 0
+ Nullable
+
+ param2
+
+
+
+ param2
+
+ 64
+
+
+
+
+
+
+ param3
+ 7
+
+ 12
+ 64
+ 0
+ Nullable
+
+ param3
+
+
+
+ param3
+
+ 64
+
+
+
+
+
+
+ param4
+ 8
+
+ 12
+ 64
+ 0
+ Nullable
+
+ param4
+
+
+
+ param4
+
+ 64
+
+
+
+
+
+
+ param5
+ 9
+
+ 12
+ 64
+ 0
+ Nullable
+
+ param5
+
+
+
+ param5
+
+ 64
+
+
+
+
+
+
+ param6
+ 10
+
+ 12
+ 64
+ 0
+ Nullable
+
+ param6
+
+
+
+ param6
+
+ 64
+
+
+
+
+
+
+ MagazineId
+ 11
+
+ -5
+ 20
+ 0
+ NotNullable
+
+ MagazineId
+
+
+
+ MagazineId
+
+ 20
+
+
+
+
+
+
+ Description
+ 12
+
+ 12
+ 21845
+ 0
+ Nullable
+
+ Description
+
+
+
+ Description
+
+ 21845
+
+
+
+
+
+
+ MagazineName
+ 13
+
+ 12
+ 64
+ 0
+ Nullable
+
+ MagazineName
+
+
+
+ MagazineName
+
+ 64
+
+
+
+
+
+
+ MagazineCover
+ 14
+
+ 12
+ 256
+ 0
+ Nullable
+
+ MagazineCover
+
+
+
+ MagazineCover
+
+ 256
+
+
+
+
+
+
+ AdminId
+ 15
+
+ -5
+ 20
+ 0
+ NotNullable
+
+ AdminId
+
+
+
+ AdminId
+
+ 20
+
+
+
+
+
+
+ CreateDate
+ 16
+
+ 93
+ 19
+ 0
+ Nullable
+
+ CreateDate
+
+
+
+ CreateDate
+
+ 19
+
+
+
+
+
+
+ CategoryId
+ 17
+
+ -5
+ 20
+ 0
+ Nullable
+
+ CategoryId
+
+
+
+ CategoryId
+
+ 20
+
+
+
+
+
+
+ PublishDate
+ 18
+
+ 93
+ 19
+ 0
+ Nullable
+
+ PublishDate
+
+
+
+ PublishDate
+
+ 19
+
+
+
+
+
+
+ PressId
+ 19
+
+ -5
+ 20
+ 0
+ Nullable
+
+ PressId
+
+
+
+ PressId
+
+ 20
+
+
+
+
+
+
+
+ ]]>
+
+
+
+
+ param2
+ dimension
+ param2
+ param2
+
+
+ log_time
+ dimension
+ log_time
+ log_time
+
+
+ ct
+ measure
+ ct
+ ct
+
+
+
+
+
+
+ 1
+ param2
+ string
+
+
+ 2
+ log_time
+ date-time
+
+
+ 3
+ ct
+ decimal
+
+
+
+ analyzer data source
+
+
+ 1
+ param2
+ param2
+ string
+ 12
+
+
+ 2
+ log_time
+ log_time
+ date-time
+ 93
+
+
+ 3
+ ct
+ ct
+ decimal
+ -5
+
+
+
+
+
+ 2.0
+
+
+
+
+
+
+ id
+ 1
+
+ -5
+ 20
+ 0
+ NotNullable
+
+ id
+
+
+
+ id
+
+ 20
+
+
+
+
+
+
+ device_id
+ 2
+
+ 12
+ 64
+ 0
+ NotNullable
+
+ device_id
+
+
+
+ device_id
+
+ 64
+
+
+
+
+
+
+ log_time
+ 3
+
+ 93
+ 19
+ 0
+ NotNullable
+
+ log_time
+
+
+
+ log_time
+
+ 19
+
+
+
+
+
+
+ event_type
+ 4
+
+ 12
+ 32
+ 0
+ Nullable
+
+ event_type
+
+
+
+ event_type
+
+ 32
+
+
+
+
+
+
+ param1
+ 5
+
+ 12
+ 64
+ 0
+ Nullable
+
+ param1
+
+
+
+ param1
+
+ 64
+
+
+
+
+
+
+ param2
+ 6
+
+ 12
+ 64
+ 0
+ Nullable
+
+ param2
+
+
+
+ param2
+
+ 64
+
+
+
+
+
+
+ param3
+ 7
+
+ 12
+ 64
+ 0
+ Nullable
+
+ param3
+
+
+
+ param3
+
+ 64
+
+
+
+
+
+
+ param4
+ 8
+
+ 12
+ 64
+ 0
+ Nullable
+
+ param4
+
+
+
+ param4
+
+ 64
+
+
+
+
+
+
+ param5
+ 9
+
+ 12
+ 64
+ 0
+ Nullable
+
+ param5
+
+
+
+ param5
+
+ 64
+
+
+
+
+
+
+ param6
+ 10
+
+ 12
+ 64
+ 0
+ Nullable
+
+ param6
+
+
+
+ param6
+
+ 64
+
+
+
+
+
+
+
+ ]]>
+
+
+
+
+ MagazineId
+ measure
+ MagazineId
+ MagazineId
+
+
+ MagazineName
+ dimension
+ MagazineName
+ MagazineName
+
+
+
+
+
+ 1
+ MagazineId
+ decimal
+
+
+ 2
+ MagazineName
+ string
+
+
+
+ analyzer data source
+
+
+ 1
+ MagazineId
+ MagazineId
+ decimal
+ -5
+
+
+ 2
+ MagazineName
+ MagazineName
+ string
+ 12
+
+
+
+
+
+ 2.0
+
+
+
+
+
+
+ MagazineId
+ 1
+
+ -5
+ 20
+ 0
+ NotNullable
+
+ MagazineId
+
+
+
+ MagazineId
+
+ 20
+
+
+
+
+
+
+ MagazineName
+ 2
+
+ 12
+ 64
+ 0
+ Nullable
+
+ MagazineName
+
+
+
+ MagazineName
+
+ 64
+
+
+
+
+
+
+
+ ]]>
+
+
+
+
+ count(distinct id)
+ measure
+ count(distinct id)
+ count(distinct id)
+
+
+
+
+
+
+ 1
+ count(distinct id)
+ decimal
+
+
+
+ analyzer data source
+
+
+ 1
+ count(distinct id)
+ count(distinct id)
+ decimal
+ -5
+
+
+
+
+
+ 2.0
+
+
+
+
+
+
+ count(distinct id)
+ 1
+
+ -5
+ 21
+ 0
+ NotNullable
+
+ count(distinct id)
+
+
+
+ count(distinct id)
+
+ 21
+
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+ NewTabularHierarchy
+
+
+
+
+ string
+ event_type
+
+
+
+
+
+
+ NewTabularHierarchy1
+
+
+
+
+ string
+ device_id
+
+
+
+
+
+
+
+
+
+
+ count
+ false
+ dataSetRow["event_type"]
+ integer
+ true
+
+
+
+
+ event_data
+
+
+
+
+ NewTabularHierarchy2
+
+
+
+
+ string
+ dt
+
+
+
+
+
+
+ NewTabularHierarchy3
+
+
+
+
+ string
+ MagazineName
+
+
+
+
+
+
+
+
+
+
+ sum
+ false
+ dataSetRow["count(magazine.MagazineId)"]
+ decimal
+ true
+
+
+
+
+ download_spec_magazine_by_date
+
+
+
+
+ true
+ NewTabularHierarchy5
+
+
+
+
+ integer
+ year
+
+
+ DateTime
+ date-time
+
+
+ log_time
+
+
+ integer
+ month
+
+
+ DateTime
+ date-time
+
+
+ log_time
+
+
+ integer
+ week-of-year
+
+
+ DateTime
+ date-time
+
+
+ log_time
+
+
+ integer
+ day-of-month
+
+
+ DateTime
+ date-time
+
+
+ log_time
+
+
+
+
+
+
+ NewTabularHierarchy4
+
+
+
+
+ string
+ MagazineName
+
+
+ decimal
+ MagazineId
+
+
+ magazineInfo
+
+
+
+
+
+
+
+
+ dataSetRow["ct"]
+ decimal
+
+
+
+
+ downloading_of_magazine
+
+
+
+
+ param2
+ MagazineId
+
+
+ NewTabularHierarchy4
+
+
+
+
+
+
+
+
+
+
+
+ 0in
+
+
+ html
+ new Date()]]>
+
+
+
+
+
+
+ 19.927083333333332in
+ 8.291666666666666in
+
+ 1.0208333333333333in
+
+
+ 4.53125in
+
+
+ 2.7395833333333335in
+
+
+ 0.3958333333333333in
+
+
+ 12pt
+ bold
+ right
+ auto
+
+
+ |
+
+
+ 12pt
+ bold
+ num_of_device_id
+
+
+ count(distinct id)
+ count(distinct id)
+ dataSetRow["count(distinct id)"]
+ decimal
+
+
+ count(distinct id)
+
+ |
+ |
+
+
+ 0.3541666666666667in
+
+ 3
+ 1
+
+ #808080
+ bold
+ #FFFFFF
+ 4pt
+ 4pt
+ 4pt
+ 4pt
+ 每日新增用户
+
+ |
+
+
+ 2.96875in
+
+ 3
+ 1
+
+
+ 2.6.1
+ Bar Chart
+ Side-by-side
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ false
+
+
+
+ 16.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+ 5
+ 5
+
+
+
+ 0
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ false
+
+
+
+ 0
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 2.0
+ 2.0
+ 2.0
+ 2.0
+
+
+
+
+
+
+
+
+ Vertical
+ Top_Bottom
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+ Right
+ Series
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Above
+
+
+ 0.0
+ 0.0
+ 212.0
+ 130.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+
+ Two_Dimensional
+ Points
+ 10.0
+
+ enable.area.alt
+ false
+
+
+
+ 'A','B','C','D','E'
+
+
+ 5,4,12
+ 0
+
+
+
+
+
+ This chart contains no data.
+
+
+ Center
+ Center
+
+
+
+
+ 64
+ 127
+ 127
+ 127
+
+
+
+ 128
+ 127
+ 127
+ 127
+
+ true
+
+
+ 10.0
+ 10.0
+ 10.0
+ 10.0
+
+ false
+
+
+ Text
+
+
+ X-Axis Title
+
+ 14.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Below
+
+ Linear
+
+
+ Y-Axis Title
+
+ 14.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Left
+
+
+
+
+ Text
+
+
+
+
+
+ 255
+ 80
+ 166
+ 218
+
+
+ 255
+ 108
+ 222
+ 228
+
+ 90.0
+
+
+ 255
+ 242
+ 88
+ 106
+
+
+ 255
+ 232
+ 172
+ 57
+
+
+ 255
+ 128
+ 255
+ 128
+
+
+ 255
+ 64
+ 128
+ 128
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 170
+ 85
+ 85
+
+
+ 255
+ 128
+ 128
+ 0
+
+
+ 255
+ 192
+ 192
+ 192
+
+
+ 255
+ 255
+ 255
+ 128
+
+
+ 255
+ 128
+ 192
+ 128
+
+
+ 255
+ 7
+ 146
+ 94
+
+
+ 255
+ 0
+ 128
+ 255
+
+
+ 255
+ 255
+ 128
+ 192
+
+
+ 255
+ 0
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 128
+
+
+ 255
+ 0
+ 128
+ 192
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 255
+ 0
+ 255
+
+
+ 255
+ 128
+ 64
+ 64
+
+
+ 255
+ 255
+ 128
+ 64
+
+
+ 255
+ 80
+ 240
+ 120
+
+
+ 255
+ 0
+ 64
+ 128
+
+
+ 255
+ 128
+ 0
+ 64
+
+
+ 255
+ 255
+ 0
+ 128
+
+
+ 255
+ 128
+ 128
+ 64
+
+
+ 255
+ 128
+ 128
+ 128
+
+
+ 255
+ 255
+ 128
+ 255
+
+
+ 255
+ 0
+ 64
+ 0
+
+
+ 255
+ 0
+ 0
+ 0
+
+
+ 255
+ 255
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 0
+
+
+
+ true
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+
+ row["count(id)"]
+
+ Text
+ Sum
+
+
+ Series 1
+
+
+ Orthogonal_Value
+
+ ,
+
+ Outside
+ false
+
+ onmouseover
+
+ Show_Tooltip
+
+
+ 200
+
+
+
+
+
+
+ 1
+
+ 255
+ 128
+ 128
+ 128
+
+ true
+
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ North
+
+ Rectangle
+
+
+ Text
+ Sum
+
+
+ Vertical
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+ Left
+
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ true
+
+
+
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+
+
+ 5
+
+
+ Min
+
+ 0.0
+
+
+ true
+ false
+
+
+
+
+
+
+
+
+ 255
+ 80
+ 166
+ 218
+
+
+ 255
+ 108
+ 222
+ 228
+
+ 90.0
+
+
+ 255
+ 242
+ 88
+ 106
+
+
+ 255
+ 232
+ 172
+ 57
+
+
+ 255
+ 128
+ 255
+ 128
+
+
+ 255
+ 64
+ 128
+ 128
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 170
+ 85
+ 85
+
+
+ 255
+ 128
+ 128
+ 0
+
+
+ 255
+ 192
+ 192
+ 192
+
+
+ 255
+ 255
+ 255
+ 128
+
+
+ 255
+ 128
+ 192
+ 128
+
+
+ 255
+ 7
+ 146
+ 94
+
+
+ 255
+ 0
+ 128
+ 255
+
+
+ 255
+ 255
+ 128
+ 192
+
+
+ 255
+ 0
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 128
+
+
+ 255
+ 0
+ 128
+ 192
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 255
+ 0
+ 255
+
+
+ 255
+ 128
+ 64
+ 64
+
+
+ 255
+ 255
+ 128
+ 64
+
+
+ 255
+ 80
+ 240
+ 120
+
+
+ 255
+ 0
+ 64
+ 128
+
+
+ 255
+ 128
+ 0
+ 64
+
+
+ 255
+ 255
+ 0
+ 128
+
+
+ 255
+ 128
+ 128
+ 64
+
+
+ 255
+ 128
+ 128
+ 128
+
+
+ 255
+ 255
+ 128
+ 255
+
+
+ 255
+ 0
+ 64
+ 0
+
+
+ 255
+ 0
+ 0
+ 0
+
+
+ 255
+ 255
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 0
+
+
+
+ true
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+
+ row["dldt"]
+
+
+
+
+ Orthogonal_Value
+
+ ,
+
+ Outside
+ false
+
+
+ true
+ Years
+ Text
+ Sum
+
+
+ Horizontal
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+
+
+
+
+
+ 68.0
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+ Below
+ 1
+
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ true
+
+
+
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+
+
+ 5
+ false
+
+
+ Min
+
+ 0.0
+
+
+ true
+ true
+ false
+
+ Vertical
+ 50.0
+
+
+ -20.0
+ 45.0
+ 0.0
+ None
+
+
+ false
+
+]]>
+ SVG
+ false
+ 2.5520833333333335in
+ 8.104166666666666in
+ devices_by_date
+
+
+ count(id)
+ dataSetRow["count(id)"]
+ decimal
+
+
+ dldt
+ dataSetRow["dldt"]
+ string
+
+
+
+ |
+
+
+ 0.3333333333333333in
+
+ 3
+ 1
+
+ #808080
+ bold
+ #FFFFFF
+ 4pt
+ 4pt
+ 4pt
+ 4pt
+ 每日活跃用户
+
+ |
+
+
+ 4in
+
+ 3
+ 1
+
+
+ 2.6.1
+ Bar Chart
+ Side-by-side
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ false
+
+
+ Active devices by date
+
+ 16.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+ 5
+ 5
+
+
+
+ 0
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ false
+
+
+
+ 0
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 2.0
+ 2.0
+ 2.0
+ 2.0
+
+
+
+
+
+
+
+
+ Vertical
+ Top_Bottom
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+ Right
+ Series
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Above
+
+
+ 0.0
+ 0.0
+ 212.0
+ 130.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+
+ Two_Dimensional
+ Points
+ 10.0
+
+ enable.area.alt
+ false
+
+
+
+ A, B, C
+
+
+ 5,4,12
+ 0
+
+
+
+
+
+ This chart contains no data.
+
+
+ Center
+ Center
+
+
+
+
+ 64
+ 127
+ 127
+ 127
+
+
+
+ 128
+ 127
+ 127
+ 127
+
+ true
+
+
+ 10.0
+ 10.0
+ 10.0
+ 10.0
+
+ false
+
+
+ Text
+
+
+ X-Axis Title
+
+ 14.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Below
+
+ Linear
+
+
+ Y-Axis Title
+
+ 14.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Left
+
+
+
+
+
+
+
+ 255
+ 80
+ 166
+ 218
+
+
+ 255
+ 108
+ 222
+ 228
+
+ 90.0
+
+
+ 255
+ 242
+ 88
+ 106
+
+
+ 255
+ 232
+ 172
+ 57
+
+
+ 255
+ 128
+ 255
+ 128
+
+
+ 255
+ 64
+ 128
+ 128
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 170
+ 85
+ 85
+
+
+ 255
+ 128
+ 128
+ 0
+
+
+ 255
+ 192
+ 192
+ 192
+
+
+ 255
+ 255
+ 255
+ 128
+
+
+ 255
+ 128
+ 192
+ 128
+
+
+ 255
+ 7
+ 146
+ 94
+
+
+ 255
+ 0
+ 128
+ 255
+
+
+ 255
+ 255
+ 128
+ 192
+
+
+ 255
+ 0
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 128
+
+
+ 255
+ 0
+ 128
+ 192
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 255
+ 0
+ 255
+
+
+ 255
+ 128
+ 64
+ 64
+
+
+ 255
+ 255
+ 128
+ 64
+
+
+ 255
+ 80
+ 240
+ 120
+
+
+ 255
+ 0
+ 64
+ 128
+
+
+ 255
+ 128
+ 0
+ 64
+
+
+ 255
+ 255
+ 0
+ 128
+
+
+ 255
+ 128
+ 128
+ 64
+
+
+ 255
+ 128
+ 128
+ 128
+
+
+ 255
+ 255
+ 128
+ 255
+
+
+ 255
+ 0
+ 64
+ 0
+
+
+ 255
+ 0
+ 0
+ 0
+
+
+ 255
+ 255
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 0
+
+
+
+ true
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+
+ row["count(device_id)"]
+
+ Text
+ Sum
+
+
+ Series 1
+
+
+ Orthogonal_Value
+
+ ,
+
+ Outside
+ false
+
+ onmouseover
+
+ Show_Tooltip
+
+
+ 200
+
+
+
+
+
+
+ 1
+
+ 255
+ 128
+ 128
+ 128
+
+ true
+
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ North
+
+ Rectangle
+
+
+ Text
+ Sum
+
+
+ Vertical
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+
+
+
+
+
+ 0.0
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+ Left
+
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ true
+
+
+
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+
+
+ 5
+ true
+
+
+ Min
+
+ 0.0
+
+
+ true
+ false
+
+
+
+
+
+
+
+
+ 255
+ 80
+ 166
+ 218
+
+
+ 255
+ 108
+ 222
+ 228
+
+ 90.0
+
+
+ 255
+ 242
+ 88
+ 106
+
+
+ 255
+ 232
+ 172
+ 57
+
+
+ 255
+ 128
+ 255
+ 128
+
+
+ 255
+ 64
+ 128
+ 128
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 170
+ 85
+ 85
+
+
+ 255
+ 128
+ 128
+ 0
+
+
+ 255
+ 192
+ 192
+ 192
+
+
+ 255
+ 255
+ 255
+ 128
+
+
+ 255
+ 128
+ 192
+ 128
+
+
+ 255
+ 7
+ 146
+ 94
+
+
+ 255
+ 0
+ 128
+ 255
+
+
+ 255
+ 255
+ 128
+ 192
+
+
+ 255
+ 0
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 128
+
+
+ 255
+ 0
+ 128
+ 192
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 255
+ 0
+ 255
+
+
+ 255
+ 128
+ 64
+ 64
+
+
+ 255
+ 255
+ 128
+ 64
+
+
+ 255
+ 80
+ 240
+ 120
+
+
+ 255
+ 0
+ 64
+ 128
+
+
+ 255
+ 128
+ 0
+ 64
+
+
+ 255
+ 255
+ 0
+ 128
+
+
+ 255
+ 128
+ 128
+ 64
+
+
+ 255
+ 128
+ 128
+ 128
+
+
+ 255
+ 255
+ 128
+ 255
+
+
+ 255
+ 0
+ 64
+ 0
+
+
+ 255
+ 0
+ 0
+ 0
+
+
+ 255
+ 255
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 0
+
+
+
+ true
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+
+ row["dt"]
+
+
+
+
+ Orthogonal_Value
+
+ ,
+
+ Outside
+ false
+
+
+ true
+ Text
+ Sum
+
+
+ Horizontal
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+
+
+
+
+
+ 45.0
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+ Below
+
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ true
+
+
+
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+
+
+ 5
+
+
+ Min
+
+ 0.0
+
+
+ true
+ true
+ false
+
+ Vertical
+ 50.0
+
+
+ -20.0
+ 45.0
+ 0.0
+ None
+
+
+
+]]>
+ SVG
+ false
+ 3.5625in
+ 8.0625in
+ active_device_by_date
+
+
+ count(device_id)
+ dataSetRow["count(device_id)"]
+ decimal
+
+
+ dt
+ dataSetRow["dt"]
+ string
+
+
+
+ |
+
+
+ 0.23958333333333334in
+
+ 3
+ 1
+
+ #808080
+ bold
+ #FFFFFF
+ 4pt
+ 4pt
+ 4pt
+ 4pt
+ 每日访问量
+
+ |
+
+
+ 3.6041666666666665in
+
+ 3
+ 1
+
+
+ 2.6.1
+ Bar Chart
+ Side-by-side
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ false
+
+
+ # of visiting by date
+
+ 16.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+ 5
+ 5
+
+
+
+ 0
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ false
+
+
+
+ 0
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 2.0
+ 2.0
+ 2.0
+ 2.0
+
+
+
+
+
+
+
+
+ Vertical
+ Top_Bottom
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+ Right
+ Series
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Above
+
+
+ 0.0
+ 0.0
+ 212.0
+ 130.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+
+ Two_Dimensional
+ Points
+ 10.0
+
+ enable.area.alt
+ false
+
+
+
+ A, B, C
+
+
+ 5,4,12
+ 0
+
+
+
+
+
+ This chart contains no data.
+
+
+ Center
+ Center
+
+
+
+
+ 64
+ 127
+ 127
+ 127
+
+
+
+ 128
+ 127
+ 127
+ 127
+
+ true
+
+
+ 10.0
+ 10.0
+ 10.0
+ 10.0
+
+ false
+
+
+ Text
+
+
+ X-Axis Title
+
+ 14.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Below
+
+ Linear
+
+
+ Y-Axis Title
+
+ 14.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Left
+
+
+
+
+
+
+
+ 255
+ 80
+ 166
+ 218
+
+
+ 255
+ 108
+ 222
+ 228
+
+ 90.0
+
+
+ 255
+ 242
+ 88
+ 106
+
+
+ 255
+ 232
+ 172
+ 57
+
+
+ 255
+ 128
+ 255
+ 128
+
+
+ 255
+ 64
+ 128
+ 128
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 170
+ 85
+ 85
+
+
+ 255
+ 128
+ 128
+ 0
+
+
+ 255
+ 192
+ 192
+ 192
+
+
+ 255
+ 255
+ 255
+ 128
+
+
+ 255
+ 128
+ 192
+ 128
+
+
+ 255
+ 7
+ 146
+ 94
+
+
+ 255
+ 0
+ 128
+ 255
+
+
+ 255
+ 255
+ 128
+ 192
+
+
+ 255
+ 0
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 128
+
+
+ 255
+ 0
+ 128
+ 192
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 255
+ 0
+ 255
+
+
+ 255
+ 128
+ 64
+ 64
+
+
+ 255
+ 255
+ 128
+ 64
+
+
+ 255
+ 80
+ 240
+ 120
+
+
+ 255
+ 0
+ 64
+ 128
+
+
+ 255
+ 128
+ 0
+ 64
+
+
+ 255
+ 255
+ 0
+ 128
+
+
+ 255
+ 128
+ 128
+ 64
+
+
+ 255
+ 128
+ 128
+ 128
+
+
+ 255
+ 255
+ 128
+ 255
+
+
+ 255
+ 0
+ 64
+ 0
+
+
+ 255
+ 0
+ 0
+ 0
+
+
+ 255
+ 255
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 0
+
+
+
+ true
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+
+ row["count(id)"]
+
+ Text
+ Sum
+
+
+ Series 1
+
+
+ Orthogonal_Value
+
+ ,
+
+ Outside
+ false
+
+ onmouseover
+
+ Show_Tooltip
+
+
+ 200
+
+
+
+
+
+
+ 1
+
+ 255
+ 128
+ 128
+ 128
+
+ true
+
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ North
+
+ Rectangle
+
+
+ Text
+ Sum
+
+
+ Vertical
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+ Left
+
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ true
+
+
+
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+
+
+ 5
+
+
+ Min
+
+ 0.0
+
+
+ true
+ false
+
+
+
+
+
+
+
+
+ 255
+ 80
+ 166
+ 218
+
+
+ 255
+ 108
+ 222
+ 228
+
+ 90.0
+
+
+ 255
+ 242
+ 88
+ 106
+
+
+ 255
+ 232
+ 172
+ 57
+
+
+ 255
+ 128
+ 255
+ 128
+
+
+ 255
+ 64
+ 128
+ 128
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 170
+ 85
+ 85
+
+
+ 255
+ 128
+ 128
+ 0
+
+
+ 255
+ 192
+ 192
+ 192
+
+
+ 255
+ 255
+ 255
+ 128
+
+
+ 255
+ 128
+ 192
+ 128
+
+
+ 255
+ 7
+ 146
+ 94
+
+
+ 255
+ 0
+ 128
+ 255
+
+
+ 255
+ 255
+ 128
+ 192
+
+
+ 255
+ 0
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 128
+
+
+ 255
+ 0
+ 128
+ 192
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 255
+ 0
+ 255
+
+
+ 255
+ 128
+ 64
+ 64
+
+
+ 255
+ 255
+ 128
+ 64
+
+
+ 255
+ 80
+ 240
+ 120
+
+
+ 255
+ 0
+ 64
+ 128
+
+
+ 255
+ 128
+ 0
+ 64
+
+
+ 255
+ 255
+ 0
+ 128
+
+
+ 255
+ 128
+ 128
+ 64
+
+
+ 255
+ 128
+ 128
+ 128
+
+
+ 255
+ 255
+ 128
+ 255
+
+
+ 255
+ 0
+ 64
+ 0
+
+
+ 255
+ 0
+ 0
+ 0
+
+
+ 255
+ 255
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 0
+
+
+
+ true
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+
+ row["dt"]
+
+
+
+
+ Orthogonal_Value
+
+ ,
+
+ Outside
+ false
+
+
+ true
+ Text
+ Sum
+
+
+ Horizontal
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+
+
+
+
+
+ 43.0
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+ Below
+
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ true
+
+
+
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+
+
+ 5
+ false
+
+
+ Min
+
+ 0.0
+
+
+ true
+ true
+ false
+
+ Vertical
+ 50.0
+
+
+ -20.0
+ 45.0
+ 0.0
+ None
+
+
+
+]]>
+ SVG
+ false
+ 3.1666666666666665in
+ 8.020833333333334in
+ visiting_by_date
+
+
+ count(id)
+ dataSetRow["count(id)"]
+ decimal
+
+
+ dt
+ dataSetRow["dt"]
+ string
+
+
+
+ |
+
+
+ 0.23958333333333334in
+
+ 3
+ 1
+
+ #808080
+ bold
+ #FFFFFF
+ 4pt
+ 4pt
+ 4pt
+ 4pt
+ 每日下载量
+
+ |
+
+
+ 3.8020833333333335in
+
+ 3
+ 1
+
+
+ 2.6.1
+ Bar Chart
+ Side-by-side
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ false
+
+
+ # of downloading start by date
+
+ 16.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+ 5
+ 5
+
+
+
+ 0
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ false
+
+
+
+ 0
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 2.0
+ 2.0
+ 2.0
+ 2.0
+
+
+
+
+
+
+
+
+ Vertical
+ Top_Bottom
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+ Right
+ Series
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Above
+
+
+ 0.0
+ 0.0
+ 212.0
+ 130.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+
+ Two_Dimensional
+ Points
+ 10.0
+
+ enable.area.alt
+ false
+
+
+
+ A, B, C
+
+
+ 5,4,12
+ 0
+
+
+
+
+
+ This chart contains no data.
+
+
+ Center
+ Center
+
+
+
+
+ 64
+ 127
+ 127
+ 127
+
+
+
+ 128
+ 127
+ 127
+ 127
+
+ true
+
+
+ 10.0
+ 10.0
+ 10.0
+ 10.0
+
+ false
+
+
+ Text
+
+
+ X-Axis Title
+
+ 14.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Below
+
+ Linear
+
+
+ Y-Axis Title
+
+ 14.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Left
+
+
+
+
+
+
+
+ 255
+ 80
+ 166
+ 218
+
+
+ 255
+ 108
+ 222
+ 228
+
+ 90.0
+
+
+ 255
+ 242
+ 88
+ 106
+
+
+ 255
+ 232
+ 172
+ 57
+
+
+ 255
+ 128
+ 255
+ 128
+
+
+ 255
+ 64
+ 128
+ 128
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 170
+ 85
+ 85
+
+
+ 255
+ 128
+ 128
+ 0
+
+
+ 255
+ 192
+ 192
+ 192
+
+
+ 255
+ 255
+ 255
+ 128
+
+
+ 255
+ 128
+ 192
+ 128
+
+
+ 255
+ 7
+ 146
+ 94
+
+
+ 255
+ 0
+ 128
+ 255
+
+
+ 255
+ 255
+ 128
+ 192
+
+
+ 255
+ 0
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 128
+
+
+ 255
+ 0
+ 128
+ 192
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 255
+ 0
+ 255
+
+
+ 255
+ 128
+ 64
+ 64
+
+
+ 255
+ 255
+ 128
+ 64
+
+
+ 255
+ 80
+ 240
+ 120
+
+
+ 255
+ 0
+ 64
+ 128
+
+
+ 255
+ 128
+ 0
+ 64
+
+
+ 255
+ 255
+ 0
+ 128
+
+
+ 255
+ 128
+ 128
+ 64
+
+
+ 255
+ 128
+ 128
+ 128
+
+
+ 255
+ 255
+ 128
+ 255
+
+
+ 255
+ 0
+ 64
+ 0
+
+
+ 255
+ 0
+ 0
+ 0
+
+
+ 255
+ 255
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 0
+
+
+
+ true
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+
+ row["count(id)"]
+
+ Text
+ Sum
+
+
+ Series 1
+
+
+ Orthogonal_Value
+
+ ,
+
+ Outside
+ false
+
+ onmouseover
+
+ Show_Tooltip
+
+
+ 200
+
+
+
+ Rectangle
+
+
+ Text
+ Sum
+
+
+ Vertical
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+ Left
+
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ true
+
+
+
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+
+
+ 5
+
+
+ Min
+
+ 0.0
+
+
+ true
+ false
+
+
+
+
+
+
+
+
+ 255
+ 80
+ 166
+ 218
+
+
+ 255
+ 108
+ 222
+ 228
+
+ 90.0
+
+
+ 255
+ 242
+ 88
+ 106
+
+
+ 255
+ 232
+ 172
+ 57
+
+
+ 255
+ 128
+ 255
+ 128
+
+
+ 255
+ 64
+ 128
+ 128
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 170
+ 85
+ 85
+
+
+ 255
+ 128
+ 128
+ 0
+
+
+ 255
+ 192
+ 192
+ 192
+
+
+ 255
+ 255
+ 255
+ 128
+
+
+ 255
+ 128
+ 192
+ 128
+
+
+ 255
+ 7
+ 146
+ 94
+
+
+ 255
+ 0
+ 128
+ 255
+
+
+ 255
+ 255
+ 128
+ 192
+
+
+ 255
+ 0
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 128
+
+
+ 255
+ 0
+ 128
+ 192
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 255
+ 0
+ 255
+
+
+ 255
+ 128
+ 64
+ 64
+
+
+ 255
+ 255
+ 128
+ 64
+
+
+ 255
+ 80
+ 240
+ 120
+
+
+ 255
+ 0
+ 64
+ 128
+
+
+ 255
+ 128
+ 0
+ 64
+
+
+ 255
+ 255
+ 0
+ 128
+
+
+ 255
+ 128
+ 128
+ 64
+
+
+ 255
+ 128
+ 128
+ 128
+
+
+ 255
+ 255
+ 128
+ 255
+
+
+ 255
+ 0
+ 64
+ 0
+
+
+ 255
+ 0
+ 0
+ 0
+
+
+ 255
+ 255
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 0
+
+
+
+ true
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+
+ row["dt"]
+
+
+
+
+ Orthogonal_Value
+
+ ,
+
+ Outside
+ false
+
+
+ true
+ Text
+ Sum
+
+
+ Horizontal
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+
+
+
+
+
+ 45.0
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+ Below
+
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ true
+
+
+
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+
+
+ 5
+
+
+ Min
+
+ 0.0
+
+
+ true
+ true
+ false
+
+ Vertical
+ 50.0
+
+
+ -20.0
+ 45.0
+ 0.0
+ None
+
+
+
+]]>
+ SVG
+ false
+ 3.3541666666666665in
+ 8.21875in
+ start_download_by_date
+
+
+ count(id)
+ dataSetRow["count(id)"]
+ decimal
+
+
+ dt
+ dataSetRow["dt"]
+ string
+
+
+
+ |
+
+
+ 0.3229166666666667in
+
+ 3
+ 1
+
+ #808080
+ bold
+ #FFFFFF
+ 4pt
+ 4pt
+ 4pt
+ 4pt
+ 每日杂志下载量
+
+ |
+
+
+ 3.46875in
+
+ 3
+ 1
+
+
+ 2.6.1
+ Bar Chart
+ Side-by-side
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ false
+
+
+ Download per magazine name by date
+
+ 16.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+ 5
+ 5
+
+
+
+ 0
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+
+
+
+ 0
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 2.0
+ 2.0
+ 2.0
+ 2.0
+
+
+
+
+
+
+
+
+ Vertical
+ Top_Bottom
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+ Right
+ Series
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Above
+
+
+ 0.0
+ 0.0
+ 212.0
+ 130.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+
+ Two_Dimensional
+ Points
+ 10.0
+
+ enable.area.alt
+ false
+
+
+
+ A, B, C
+
+
+ 5,4,12
+ 0
+
+
+
+
+
+ This chart contains no data.
+
+
+ Center
+ Center
+
+
+
+
+ 64
+ 127
+ 127
+ 127
+
+
+
+ 128
+ 127
+ 127
+ 127
+
+ true
+
+
+ 10.0
+ 10.0
+ 10.0
+ 10.0
+
+ false
+
+
+ Text
+
+
+ X-Axis Title
+
+ 14.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Below
+
+ Linear
+
+
+ Y-Axis Title
+
+ 14.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Left
+
+
+ row["MagazineName"]
+
+ Text
+
+
+
+
+
+ 255
+ 80
+ 166
+ 218
+
+
+ 255
+ 108
+ 222
+ 228
+
+ 90.0
+
+
+
+ 255
+ 242
+ 88
+ 106
+
+
+ 255
+ 255
+ 149
+ 117
+
+ 90.0
+
+
+
+ 255
+ 232
+ 172
+ 57
+
+
+ 255
+ 250
+ 209
+ 63
+
+ 90.0
+
+
+
+ 255
+ 98
+ 196
+ 117
+
+
+ 255
+ 128
+ 255
+ 128
+
+ 90.0
+
+
+
+ 255
+ 64
+ 128
+ 128
+
+
+ 255
+ 103
+ 205
+ 142
+
+ 90.0
+
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 159
+ 189
+ 203
+
+ 90.0
+
+
+ 255
+ 170
+ 85
+ 85
+
+
+ 255
+ 128
+ 128
+ 0
+
+
+ 255
+ 192
+ 192
+ 192
+
+
+ 255
+ 255
+ 255
+ 128
+
+
+ 255
+ 128
+ 192
+ 128
+
+
+ 255
+ 7
+ 146
+ 94
+
+
+ 255
+ 0
+ 128
+ 255
+
+
+ 255
+ 255
+ 128
+ 192
+
+
+ 255
+ 0
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 128
+
+
+ 255
+ 0
+ 128
+ 192
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 255
+ 0
+ 255
+
+
+ 255
+ 128
+ 64
+ 64
+
+
+ 255
+ 255
+ 128
+ 64
+
+
+ 255
+ 80
+ 240
+ 120
+
+
+ 255
+ 0
+ 64
+ 128
+
+
+ 255
+ 128
+ 0
+ 64
+
+
+ 255
+ 255
+ 0
+ 128
+
+
+ 255
+ 128
+ 128
+ 64
+
+
+ 255
+ 128
+ 128
+ 128
+
+
+ 255
+ 255
+ 128
+ 255
+
+
+ 255
+ 0
+ 64
+ 0
+
+
+ 255
+ 0
+ 0
+ 0
+
+
+ 255
+ 255
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 0
+
+
+
+ true
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+
+ row["count(magazine.MagazineId)"]
+
+ Text
+ Sum
+
+
+ Series 1
+
+
+ Orthogonal_Value
+
+ ,
+
+ Outside
+ false
+
+ onmouseover
+
+ Show_Tooltip
+
+
+ 200
+
+
+
+ Rectangle
+
+
+ Text
+ Sum
+
+
+ Vertical
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+ Left
+
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ true
+
+
+
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+
+
+ 5
+
+
+ Min
+
+ 0.0
+
+
+ true
+ false
+
+
+
+
+
+
+
+ 255
+ 80
+ 166
+ 218
+
+
+ 255
+ 242
+ 88
+ 106
+
+
+ 255
+ 232
+ 172
+ 57
+
+
+ 255
+ 128
+ 255
+ 128
+
+
+ 255
+ 64
+ 128
+ 128
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 170
+ 85
+ 85
+
+
+ 255
+ 128
+ 128
+ 0
+
+
+ 255
+ 192
+ 192
+ 192
+
+
+ 255
+ 255
+ 255
+ 128
+
+
+ 255
+ 128
+ 192
+ 128
+
+
+ 255
+ 7
+ 146
+ 94
+
+
+ 255
+ 0
+ 128
+ 255
+
+
+ 255
+ 255
+ 128
+ 192
+
+
+ 255
+ 0
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 128
+
+
+ 255
+ 0
+ 128
+ 192
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 255
+ 0
+ 255
+
+
+ 255
+ 128
+ 64
+ 64
+
+
+ 255
+ 255
+ 128
+ 64
+
+
+ 255
+ 80
+ 240
+ 120
+
+
+ 255
+ 0
+ 64
+ 128
+
+
+ 255
+ 128
+ 0
+ 64
+
+
+ 255
+ 255
+ 0
+ 128
+
+
+ 255
+ 128
+ 128
+ 64
+
+
+ 255
+ 128
+ 128
+ 128
+
+
+ 255
+ 255
+ 128
+ 255
+
+
+ 255
+ 0
+ 64
+ 0
+
+
+ 255
+ 0
+ 0
+ 0
+
+
+ 255
+ 255
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 0
+
+
+
+ true
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+
+ row["dt"]
+
+
+
+
+ Orthogonal_Value
+
+ ,
+
+ Outside
+ false
+
+
+ true
+ Text
+ Sum
+
+
+ Horizontal
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+
+
+
+
+
+ 45.0
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+ Below
+
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ true
+
+
+
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+
+
+ 5
+
+
+ Min
+
+ 0.0
+
+
+ true
+ true
+ false
+
+ Vertical
+ 50.0
+
+
+ -20.0
+ 45.0
+ 0.0
+ None
+
+
+
+]]>
+ SVG
+ false
+ 3.1979166666666665in
+ 8.125in
+ download_spec_magazine_by_date
+
+
+ dt
+ dataSetRow["dt"]
+ string
+
+
+ MagazineName
+ dataSetRow["MagazineName"]
+ string
+
+
+ count(magazine.MagazineId)
+ dataSetRow["count(magazine.MagazineId)"]
+ decimal
+
+
+
+ |
+
+
+ 0.3645833333333333in
+
+ 3
+ 1
+ |
+
+
+
+
+
+ report
+
+
+
diff --git a/crm/src/main/doc/nb-configuration.xml b/crm/src/main/doc/nb-configuration.xml
new file mode 100644
index 0000000..d2aae48
--- /dev/null
+++ b/crm/src/main/doc/nb-configuration.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+ none
+ JDK_1.7
+
+
diff --git a/crm/src/main/doc/nbactions-release-profile.xml b/crm/src/main/doc/nbactions-release-profile.xml
new file mode 100644
index 0000000..6b2c7a8
--- /dev/null
+++ b/crm/src/main/doc/nbactions-release-profile.xml
@@ -0,0 +1,83 @@
+
+
+
+ run
+
+ process-classes
+ org.codehaus.mojo:exec-maven-plugin:1.2.1:exec
+
+
+ Xms2048m -classpath %classpath ${packageClassName} account.xml
+ java
+
+
+
+ debug
+
+ process-classes
+ org.codehaus.mojo:exec-maven-plugin:1.2.1:exec
+
+
+ -Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} Xms2048m -classpath %classpath ${packageClassName} account.xml
+ java
+ true
+
+
+
+ profile
+
+ process-classes
+ org.codehaus.mojo:exec-maven-plugin:1.2.1:exec
+
+
+ ${profiler.args} Xms2048m -classpath %classpath ${packageClassName} account.xml
+ ${profiler.java}
+
+
+
+ build-with-dependencies
+ also-make
+
+ install
+
+
+ /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home
+
+
+
+ profile.single.main
+
+ process-classes
+ org.codehaus.mojo:exec-maven-plugin:1.2.1:exec
+
+
+ -classpath %classpath ${packageClassName}
+ java
+ ${classPathScope}
+ /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home
+
+
+
+ run.single.main
+
+ process-classes
+ org.codehaus.mojo:exec-maven-plugin:1.2.1:exec
+
+
+ -classpath %classpath ${packageClassName}
+ java
+ ${classPathScope}
+ /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home
+
+
+
+ rebuild
+
+ clean
+ install
+
+
+ /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home
+
+
+
diff --git a/crm/src/main/doc/nbactions.xml b/crm/src/main/doc/nbactions.xml
new file mode 100644
index 0000000..70b02d3
--- /dev/null
+++ b/crm/src/main/doc/nbactions.xml
@@ -0,0 +1,40 @@
+
+
+
+ run
+
+ process-classes
+ org.codehaus.mojo:exec-maven-plugin:1.2.1:exec
+
+
+ -Xms1024m -classpath %classpath com.rexen.crm.integration.DataImport contact_import.xml
+ java
+ /Users/Ralf/NetBeansProjects/dataloader
+
+
+
+ debug
+
+ process-classes
+ org.codehaus.mojo:exec-maven-plugin:1.2.1:exec
+
+
+ -Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -Xms1024m -classpath %classpath com.rexen.crm.integration.DataImport contact_import.xml
+ java
+ true
+ /Users/Ralf/NetBeansProjects/dataloader
+
+
+
+ profile
+
+ process-classes
+ org.codehaus.mojo:exec-maven-plugin:1.2.1:exec
+
+
+ ${profiler.args} -Xms1024m -classpath %classpath com.rexen.crm.integration.DataImport contact_import.xml
+ ${profiler.java}
+ /Users/Ralf/NetBeansProjects/dataloader
+
+
+
diff --git a/crm/src/main/doc/newCrmDB.xlsx b/crm/src/main/doc/newCrmDB.xlsx
new file mode 100644
index 0000000..e3e2a9c
Binary files /dev/null and b/crm/src/main/doc/newCrmDB.xlsx differ
diff --git a/crm/src/main/doc/pom.xml b/crm/src/main/doc/pom.xml
new file mode 100644
index 0000000..dba4d7b
--- /dev/null
+++ b/crm/src/main/doc/pom.xml
@@ -0,0 +1,87 @@
+
+ 4.0.0
+
+ crm
+ dataloader
+ 1.0
+ jar
+
+ dataloader
+ http://maven.apache.org
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 2.3.2
+
+ 1.7
+ 1.7
+ true
+
+
+
+
+ maven-assembly-plugin
+
+
+
+ dataloader.core.DataLoader
+
+
+
+ jar-with-dependencies
+
+
+
+
+ make-assembly
+ package
+
+ single
+
+
+
+
+
+
+
+
+ UTF-8
+
+
+
+
+ org.eclipse.persistence
+ eclipselink
+ 2.5.1
+
+
+ log4j
+ log4j
+ 1.2.17
+
+
+ org.jumpmind.symmetric
+ symmetric-csv
+ 3.5.9
+
+
+ mysql
+ mysql-connector-java
+ 5.1.26
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-checkstyle-plugin
+
+ config/sun_checks.xml
+
+
+
+
+
diff --git a/crm/src/main/doc/premium.rptdesign b/crm/src/main/doc/premium.rptdesign
new file mode 100644
index 0000000..48f188d
--- /dev/null
+++ b/crm/src/main/doc/premium.rptdesign
@@ -0,0 +1,5876 @@
+
+
+ Eclipse BIRT Designer Version 4.3.1.v201309091055 Build <4.3.1.v20130918-1142>
+
+
+ queryText
+ 108
+
+
+ queryTimeOut
+ 108
+
+
+ rowFetchSize
+ 108
+
+
+ in
+ /templates/grouped_listing.gif
+ org.eclipse.birt.report.designer.ui.cheatsheet.groupedlisting
+ auto layout
+ ltr
+ 96
+
+
+
+
+ metadataBidiFormatStr
+ ILYNN
+
+
+ disabledMetadataBidiFormatStr
+
+
+ contentBidiFormatStr
+ ILYNN
+
+
+ disabledContentBidiFormatStr
+
+
+ com.mysql.jdbc.Driver
+ jdbc:mysql://localhost:3306/analyzerdb
+ analyzer
+
+
+
+
+
+ metadataBidiFormatStr
+ ILYNN
+
+
+ disabledMetadataBidiFormatStr
+
+
+ contentBidiFormatStr
+ ILYNN
+
+
+ disabledContentBidiFormatStr
+
+
+ com.mysql.jdbc.Driver
+ jdbc:mysql://localhost:3306/analyzerdb
+ analyzer
+
+
+
+
+
+
+ deviceName
+ dimension
+ deviceName
+ deviceName
+
+
+ appId
+ measure
+ appId
+ appId
+
+
+ dldt
+ dimension
+ dldt
+ dldt
+
+
+ id
+ measure
+ id
+ id
+
+
+ appName
+ dimension
+ appName
+ appName
+
+
+
+
+
+
+ 1
+ deviceName
+ string
+
+
+ 2
+ appId
+ integer
+
+
+ 3
+ dldt
+ date-time
+
+
+ 4
+ id
+ integer
+
+
+ 5
+ appName
+ string
+
+
+
+ Data Source
+
+
+ 1
+ deviceName
+ deviceName
+ string
+
+
+ 2
+ appId
+ appId
+ integer
+
+
+ 3
+ dldt
+ dldt
+ date-time
+
+
+ 4
+ id
+ id
+ integer
+
+
+ 5
+ appName
+ appName
+ string
+
+
+ '2013-10-01' AND `analyzerdb`.`appinfo`.ID > 104
+]]>
+
+
+ 2.0
+
+
+
+
+
+
+ deviceName
+ 1
+
+ 12
+ 255
+ 0
+ Nullable
+
+ deviceName
+
+
+
+ deviceName
+
+ 255
+
+
+
+
+
+
+ appId
+ 2
+
+ 4
+ 9
+ 0
+ Nullable
+
+ appId
+
+
+
+ appId
+
+ 9
+
+
+
+
+
+
+ dldt
+ 3
+
+ 93
+ 19
+ 0
+ Nullable
+
+ dldt
+
+
+
+ dldt
+
+ 19
+
+
+
+
+
+
+ id
+ 4
+
+ 4
+ 9
+ 0
+ NotNullable
+
+ id
+
+
+
+ id
+
+ 9
+
+
+
+
+
+
+ appName
+ 5
+
+ 12
+ 255
+ 0
+ Nullable
+
+ appName
+
+
+
+ appName
+
+ 255
+
+
+
+
+
+
+
+ ]]>
+
+
+
+
+ COUNT_BY_APP
+ measure
+ COUNT_BY_APP
+ COUNT_BY_APP
+
+
+ appName
+ dimension
+ appName
+ appName
+
+
+
+
+
+
+ 1
+ COUNT_BY_APP
+ decimal
+
+
+ 2
+ appName
+ string
+
+
+
+ Data Source
+
+
+ 1
+ COUNT_BY_APP
+ COUNT_BY_APP
+ decimal
+
+
+ 2
+ appName
+ appName
+ string
+
+
+ '2013-10-01' AND `analyzerdb`.`appinfo`.ID > 104
+ GROUP BY `analyzerdb`.`appinfo`.APPNAME]]>
+
+
+ 2.0
+
+
+
+
+
+
+ COUNT_BY_APP
+ 1
+
+ -5
+ 21
+ 0
+ NotNullable
+
+ COUNT_BY_APP
+
+
+
+ COUNT_BY_APP
+
+ 21
+
+
+
+
+
+
+ appName
+ 2
+
+ 12
+ 255
+ 0
+ Nullable
+
+ appName
+
+
+
+ appName
+
+ 255
+
+
+
+
+
+
+
+ ]]>
+
+
+
+
+ COUNT(ID)
+ measure
+ COUNT(ID)
+ COUNT(ID)
+
+
+ DATE_FORMAT(DLDT, '%Y-%m-%d')
+ dimension
+ DATE_FORMAT(DLDT, '%Y-%m-%d')
+ DATE_FORMAT(DLDT, '%Y-%m-%d')
+
+
+
+
+
+
+ 1
+ COUNT(ID)
+ decimal
+
+
+ 2
+ DATE_FORMAT(DLDT, '%Y-%m-%d')
+ string
+
+
+
+ Data Source
+
+
+ 1
+ COUNT(ID)
+ COUNT(ID)
+ decimal
+
+
+ 2
+ DATE_FORMAT(DLDT, '%Y-%m-%d')
+ DATE_FORMAT(DLDT, '%Y-%m-%d')
+ string
+
+
+ '2013-10-01' AND APPID > 104
+ GROUP BY DATE_FORMAT(DLDT, '%Y-%m-%d')
+]]>
+
+
+ 2.0
+
+
+
+
+
+
+ COUNT(ID)
+ 1
+
+ -5
+ 21
+ 0
+ NotNullable
+
+ COUNT(ID)
+
+
+
+ COUNT(ID)
+
+ 21
+
+
+
+
+
+
+ DATE_FORMAT(DLDT, '%Y-%m-%d')
+ 2
+
+ 12
+ 10
+ 0
+ Nullable
+
+ DATE_FORMAT(DLDT, '%Y-%m-%d')
+
+
+
+ DATE_FORMAT(DLDT, '%Y-%m-%d')
+
+ 10
+
+
+
+
+
+
+
+ ]]>
+
+
+
+
+ COUNT_BY_DN
+ measure
+ COUNT_BY_DN
+ COUNT_BY_DN
+
+
+ deviceName
+ dimension
+ DEVICENAME
+ DEVICENAME
+
+
+
+
+
+
+ 1
+ COUNT_BY_DN
+ decimal
+
+
+ 2
+ deviceName
+ string
+
+
+
+ Data Source
+
+
+ 1
+ COUNT_BY_DN
+ COUNT_BY_DN
+ decimal
+
+
+ 2
+ deviceName
+ deviceName
+ string
+
+
+ '2013-10-01' AND APPID > 104
+ GROUP BY DEVICENAME
+]]>
+
+
+ 2.0
+
+
+
+
+
+
+ COUNT_BY_DN
+ 1
+
+ -5
+ 21
+ 0
+ NotNullable
+
+ COUNT_BY_DN
+
+
+
+ COUNT_BY_DN
+
+ 21
+
+
+
+
+
+
+ deviceName
+ 2
+
+ 12
+ 255
+ 0
+ Nullable
+
+ DEVICENAME
+
+
+
+ DEVICENAME
+
+ 255
+
+
+
+
+
+
+
+ ]]>
+
+
+
+
+ DATE_FORMAT(DLDT, '%Y-%m-%d')
+ dimension
+ DATE_FORMAT(DLDT, '%Y-%m-%d')
+ DATE_FORMAT(DLDT, '%Y-%m-%d')
+
+
+ deviceName
+ dimension
+ DEVICENAME
+ DEVICENAME
+
+
+ COUNT(ID)
+ measure
+ COUNT(ID)
+ COUNT(ID)
+
+
+
+
+
+
+ 1
+ DATE_FORMAT(DLDT, '%Y-%m-%d')
+ string
+
+
+ 2
+ deviceName
+ string
+
+
+ 3
+ COUNT(ID)
+ decimal
+
+
+
+ Data Source
+
+
+ 1
+ DATE_FORMAT(DLDT, '%Y-%m-%d')
+ DATE_FORMAT(DLDT, '%Y-%m-%d')
+ string
+
+
+ 2
+ deviceName
+ deviceName
+ string
+
+
+ 3
+ COUNT(ID)
+ COUNT(ID)
+ decimal
+
+
+ '2013-10-01' AND APPID > 104
+ GROUP BY DATE_FORMAT(DLDT, '%Y-%m-%d'),DEVICENAME
+]]>
+
+
+ 2.0
+
+
+
+
+
+
+ DATE_FORMAT(DLDT, '%Y-%m-%d')
+ 1
+
+ 12
+ 10
+ 0
+ Nullable
+
+ DATE_FORMAT(DLDT, '%Y-%m-%d')
+
+
+
+ DATE_FORMAT(DLDT, '%Y-%m-%d')
+
+ 10
+
+
+
+
+
+
+ deviceName
+ 2
+
+ 12
+ 255
+ 0
+ Nullable
+
+ DEVICENAME
+
+
+
+ DEVICENAME
+
+ 255
+
+
+
+
+
+
+ COUNT(ID)
+ 3
+
+ -5
+ 21
+ 0
+ NotNullable
+
+ COUNT(ID)
+
+
+
+ COUNT(ID)
+
+ 21
+
+
+
+
+
+
+
+ ]]>
+
+
+
+
+ CT
+ measure
+ CT
+ CT
+
+
+ dt
+ dimension
+ DT
+ DT
+
+
+
+
+
+ 1
+ CT
+ decimal
+
+
+ 2
+ dt
+ date
+
+
+
+ 109_105_47_77_analyzer
+
+
+ 1
+ CT
+ CT
+ decimal
+ -5
+
+
+ 2
+ dt
+ dt
+ date
+ 91
+
+
+ = '2013-11-01'
+ GROUP BY DT
+]]>
+
+
+ 2.0
+
+
+
+
+
+
+ CT
+ 1
+
+ -5
+ 21
+ 0
+ NotNullable
+
+ CT
+
+
+
+ CT
+
+ 21
+
+
+
+
+
+
+ dt
+ 2
+
+ 91
+ 10
+ 0
+ Nullable
+
+ DT
+
+
+
+ DT
+
+ 10
+
+
+
+
+
+
+
+ ]]>
+
+
+
+
+ COUNT(*)
+ measure
+ COUNT(*)
+ COUNT(*)
+
+
+ site
+ dimension
+ SITE
+ SITE
+
+
+ page
+ dimension
+ PAGE
+ PAGE
+
+
+ trackdatetime
+ dimension
+ trackdatetime
+ trackdatetime
+
+
+
+
+
+ 1
+ COUNT(*)
+ decimal
+
+
+ 2
+ site
+ string
+
+
+ 3
+ page
+ string
+
+
+ 4
+ trackdatetime
+ date
+
+
+
+ 109_105_47_77_analyzer
+
+
+ 1
+ COUNT(*)
+ COUNT(*)
+ decimal
+ -5
+
+
+ 2
+ site
+ site
+ string
+ 12
+
+
+ 3
+ page
+ page
+ string
+ 12
+
+
+ 4
+ trackdatetime
+ trackdatetime
+ date
+ 91
+
+
+
+
+
+ 2.0
+
+
+
+
+
+
+ COUNT(*)
+ 1
+
+ -5
+ 21
+ 0
+ NotNullable
+
+ COUNT(*)
+
+
+
+ COUNT(*)
+
+ 21
+
+
+
+
+
+
+ site
+ 2
+
+ 12
+ 255
+ 0
+ Nullable
+
+ SITE
+
+
+
+ SITE
+
+ 255
+
+
+
+
+
+
+ page
+ 3
+
+ 12
+ 255
+ 0
+ Nullable
+
+ PAGE
+
+
+
+ PAGE
+
+ 255
+
+
+
+
+
+
+ trackdatetime
+ 4
+
+ 91
+ 10
+ 0
+ Nullable
+
+ trackdatetime
+
+
+
+ trackdatetime
+
+ 10
+
+
+
+
+
+
+
+ ]]>
+
+
+
+
+ COUNT_OF_ROW
+ measure
+ COUNT_OF_ROW
+ COUNT_OF_ROW
+
+
+
+
+
+
+ 1
+ COUNT_OF_ROW
+ decimal
+
+
+
+ 109_105_47_77_analyzer
+
+
+ 1
+ COUNT_OF_ROW
+ COUNT_OF_ROW
+ decimal
+ -5
+
+
+ '2013-10-01' AND APPID > 104
+]]>
+
+
+ 2.0
+
+
+
+
+
+
+ COUNT_OF_ROW
+ 1
+
+ -5
+ 21
+ 0
+ NotNullable
+
+ COUNT_OF_ROW
+
+
+
+ COUNT_OF_ROW
+
+ 21
+
+
+
+
+
+
+
+ ]]>
+
+
+ nulls lowest
+
+
+ adt
+ dimension
+ dt
+ dt
+
+
+ ct
+ measure
+ ct
+ ct
+
+
+
+
+
+
+ 1
+ adt
+ date
+
+
+ 2
+ ct
+ decimal
+
+
+
+ 109_105_47_77_analyzer
+
+
+ 1
+ adt
+ adt
+ date
+ 91
+
+
+ 2
+ ct
+ ct
+ decimal
+ -5
+
+
+ ='2013-11-01' group by adt) as a
+left JOIN (
+SELECT COUNT(ID) as bct, DATE_FORMAT(DLDT, '%Y-%m-%d')
+as bdt
+FROM `analyzerdb`.`dl`
+ WHERE DLDT >= '2013-11-01'
+ AND APPID > 104
+ GROUP BY DATE_FORMAT(DLDT, '%Y-%m-%d')) as b
+ on a.adt=b.bdt) as c;]]>
+
+
+ 2.0
+
+
+
+
+
+
+ id
+ 1
+
+ 4
+ 9
+ 0
+ NotNullable
+
+ id
+
+
+
+ id
+
+ 9
+
+
+
+
+
+
+ dt
+ 2
+
+ 91
+ 10
+ 0
+ Nullable
+
+ dt
+
+
+
+ dt
+
+ 10
+
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+ 0in
+
+
+ 100%
+
+
+
+
+ html
+ new Date()]]>
+
+ |
+
+
+
+
+
+
+
+ 18.34375in
+ 9.59375in
+
+ 9.59375in
+
+
+ 0.23958333333333334in
+
+
+ 12pt
+ bold
+ Download report for Premium Pack
+
+ |
+
+
+ 0.2708333333333333in
+
+
+ total_downloading
+
+
+ COUNT_OF_ROW
+ COUNT_OF_ROW
+ dataSetRow["COUNT_OF_ROW"]
+ decimal
+
+
+ "Total number of download: "+row["COUNT_OF_ROW"]
+ html
+
+ |
+
+
+ 0.375in
+
+
+ #808080
+ bold
+ #FFFFFF
+ 4pt
+ 2pt
+ 2pt
+ Page view
+
+ |
+
+
+ 3.9166666666666665in
+
+
+
+ 2.6.1
+ Bar Chart
+ Side-by-side
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ false
+
+
+ Chart Title
+
+ 16.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+ 5
+ 5
+
+
+
+ 0
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ false
+
+
+
+ 0
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 2.0
+ 2.0
+ 2.0
+ 2.0
+
+
+
+
+
+
+
+
+ Vertical
+ Top_Bottom
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+ Right
+ Series
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Above
+
+
+ 0.0
+ 0.0
+ 212.0
+ 130.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+
+ Two_Dimensional
+ Points
+ 10.0
+
+ enable.area.alt
+ false
+
+
+
+ 01/05/2000,02/01/2000,04/12/2000,03/12/2000,02/29/2000
+
+
+ 5,4,12
+ 0
+
+
+
+
+
+ This chart contains no data.
+
+
+ Center
+ Center
+
+
+
+
+ 64
+ 127
+ 127
+ 127
+
+
+
+ 128
+ 127
+ 127
+ 127
+
+ true
+
+
+ 10.0
+ 10.0
+ 10.0
+ 10.0
+
+ false
+
+
+ DateTime
+
+
+ X-Axis Title
+
+ 14.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Below
+
+ Linear
+
+
+ Y-Axis Title
+
+ 14.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Left
+
+
+
+
+
+
+
+ 255
+ 80
+ 166
+ 218
+
+
+ 255
+ 108
+ 222
+ 228
+
+ 90.0
+
+
+ 255
+ 242
+ 88
+ 106
+
+
+ 255
+ 232
+ 172
+ 57
+
+
+ 255
+ 128
+ 255
+ 128
+
+
+ 255
+ 64
+ 128
+ 128
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 170
+ 85
+ 85
+
+
+ 255
+ 128
+ 128
+ 0
+
+
+ 255
+ 192
+ 192
+ 192
+
+
+ 255
+ 255
+ 255
+ 128
+
+
+ 255
+ 128
+ 192
+ 128
+
+
+ 255
+ 7
+ 146
+ 94
+
+
+ 255
+ 0
+ 128
+ 255
+
+
+ 255
+ 255
+ 128
+ 192
+
+
+ 255
+ 0
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 128
+
+
+ 255
+ 0
+ 128
+ 192
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 255
+ 0
+ 255
+
+
+ 255
+ 128
+ 64
+ 64
+
+
+ 255
+ 255
+ 128
+ 64
+
+
+ 255
+ 80
+ 240
+ 120
+
+
+ 255
+ 0
+ 64
+ 128
+
+
+ 255
+ 128
+ 0
+ 64
+
+
+ 255
+ 255
+ 0
+ 128
+
+
+ 255
+ 128
+ 128
+ 64
+
+
+ 255
+ 128
+ 128
+ 128
+
+
+ 255
+ 255
+ 128
+ 255
+
+
+ 255
+ 0
+ 64
+ 0
+
+
+ 255
+ 0
+ 0
+ 0
+
+
+ 255
+ 255
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 0
+
+
+
+ true
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+
+ row["COUNT(*)"]
+
+ Text
+ Sum
+
+
+ Series 1
+
+
+ Orthogonal_Value
+
+ ,
+
+ Outside
+ false
+
+ onmouseover
+
+ Show_Tooltip
+
+
+ 200
+
+
+
+
+
+
+ 1
+
+ 255
+ 128
+ 128
+ 128
+
+ true
+
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ North
+
+ Rectangle
+
+
+ Text
+ Sum
+
+
+ Vertical
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+ Left
+
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ true
+
+
+
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+
+
+ 5
+
+
+ Min
+
+ 0.0
+
+
+ true
+ false
+
+
+
+
+
+
+
+
+ 255
+ 80
+ 166
+ 218
+
+
+ 255
+ 108
+ 222
+ 228
+
+ 90.0
+
+
+ 255
+ 242
+ 88
+ 106
+
+
+ 255
+ 232
+ 172
+ 57
+
+
+ 255
+ 128
+ 255
+ 128
+
+
+ 255
+ 64
+ 128
+ 128
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 170
+ 85
+ 85
+
+
+ 255
+ 128
+ 128
+ 0
+
+
+ 255
+ 192
+ 192
+ 192
+
+
+ 255
+ 255
+ 255
+ 128
+
+
+ 255
+ 128
+ 192
+ 128
+
+
+ 255
+ 7
+ 146
+ 94
+
+
+ 255
+ 0
+ 128
+ 255
+
+
+ 255
+ 255
+ 128
+ 192
+
+
+ 255
+ 0
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 128
+
+
+ 255
+ 0
+ 128
+ 192
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 255
+ 0
+ 255
+
+
+ 255
+ 128
+ 64
+ 64
+
+
+ 255
+ 255
+ 128
+ 64
+
+
+ 255
+ 80
+ 240
+ 120
+
+
+ 255
+ 0
+ 64
+ 128
+
+
+ 255
+ 128
+ 0
+ 64
+
+
+ 255
+ 255
+ 0
+ 128
+
+
+ 255
+ 128
+ 128
+ 64
+
+
+ 255
+ 128
+ 128
+ 128
+
+
+ 255
+ 255
+ 128
+ 255
+
+
+ 255
+ 0
+ 64
+ 0
+
+
+ 255
+ 0
+ 0
+ 0
+
+
+ 255
+ 255
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 0
+
+
+
+ true
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+
+ row["trackdatetime"]
+
+
+
+
+ Orthogonal_Value
+
+ ,
+
+ Outside
+ false
+
+
+ true
+ Days
+ DateTime
+ Sum
+
+
+ en_US
+
+ Horizontal
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+
+
+
+
+
+ 45.0
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+
+ yyyy-MM-dd
+
+ Below
+
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ true
+
+
+
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+
+
+ 5
+ false
+
+
+ Min
+
+ 0.0
+
+
+ true
+ true
+ false
+
+ Vertical
+ 50.0
+
+
+ -20.0
+ 45.0
+ 0.0
+ None
+
+
+ false
+
+]]>
+ SVG
+ false
+ 3.6041666666666665in
+ 8.135416666666666in
+ pageview
+
+
+ COUNT(*)
+ dataSetRow["COUNT(*)"]
+ decimal
+
+
+ site
+ dataSetRow["site"]
+ string
+
+
+ page
+ dataSetRow["page"]
+ string
+
+
+ trackdatetime
+ dataSetRow["trackdatetime"]
+ date
+
+
+
+ |
+
+
+ 0.3541666666666667in
+
+
+ #808080
+ bold
+ #FFFFFF
+ 4pt
+ 2pt
+ 2pt
+ Download by app
+
+ |
+
+
+ 4.40625in
+
+
+
+ 2.6.1
+ Pie Chart
+ Standard
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ false
+
+
+ Chart Title
+
+ 16.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+ 5
+ 5
+
+
+
+ 0
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+
+
+
+ 0
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 2.0
+ 2.0
+ 2.0
+ 2.0
+
+
+
+
+
+
+
+
+ Vertical
+ Top_Bottom
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+ Right
+ Categories
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Above
+
+
+ 0.0
+ 0.0
+ 212.0
+ 130.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+
+ Two_Dimensional_With_Depth
+ Points
+ 10.0
+ 0
+
+ enable.area.alt
+ false
+
+
+
+ 'A','B','C','D','E'
+
+
+ 6,4,12,8,10
+ 0
+
+
+
+
+
+ This chart contains no data.
+
+
+ Center
+ Center
+
+
+
+
+ 64
+ 127
+ 127
+ 127
+
+
+
+ 128
+ 127
+ 127
+ 127
+
+ true
+
+
+ 10.0
+ 10.0
+ 10.0
+ 10.0
+
+ false
+
+
+
+
+
+
+
+ 255
+ 80
+ 166
+ 218
+
+
+ 255
+ 242
+ 88
+ 106
+
+
+ 255
+ 232
+ 172
+ 57
+
+
+ 255
+ 128
+ 255
+ 128
+
+
+ 255
+ 64
+ 128
+ 128
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 170
+ 85
+ 85
+
+
+ 255
+ 128
+ 128
+ 0
+
+
+ 255
+ 192
+ 192
+ 192
+
+
+ 255
+ 255
+ 255
+ 128
+
+
+ 255
+ 128
+ 192
+ 128
+
+
+ 255
+ 7
+ 146
+ 94
+
+
+ 255
+ 0
+ 128
+ 255
+
+
+ 255
+ 255
+ 128
+ 192
+
+
+ 255
+ 0
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 128
+
+
+ 255
+ 0
+ 128
+ 192
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 255
+ 0
+ 255
+
+
+ 255
+ 128
+ 64
+ 64
+
+
+ 255
+ 255
+ 128
+ 64
+
+
+ 255
+ 80
+ 240
+ 120
+
+
+ 255
+ 0
+ 64
+ 128
+
+
+ 255
+ 128
+ 0
+ 64
+
+
+ 255
+ 255
+ 0
+ 128
+
+
+ 255
+ 128
+ 128
+ 64
+
+
+ 255
+ 128
+ 128
+ 128
+
+
+ 255
+ 255
+ 128
+ 255
+
+
+ 255
+ 0
+ 64
+ 0
+
+
+ 255
+ 0
+ 0
+ 0
+
+
+ 255
+ 255
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 0
+
+
+
+
+
+
+
+
+ 255
+ 80
+ 166
+ 218
+
+
+ 255
+ 242
+ 88
+ 106
+
+
+ 255
+ 232
+ 172
+ 57
+
+
+ 255
+ 128
+ 255
+ 128
+
+
+ 255
+ 64
+ 128
+ 128
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 170
+ 85
+ 85
+
+
+ 255
+ 128
+ 128
+ 0
+
+
+ 255
+ 192
+ 192
+ 192
+
+
+ 255
+ 255
+ 255
+ 128
+
+
+ 255
+ 128
+ 192
+ 128
+
+
+ 255
+ 7
+ 146
+ 94
+
+
+ 255
+ 0
+ 128
+ 255
+
+
+ 255
+ 255
+ 128
+ 192
+
+
+ 255
+ 0
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 128
+
+
+ 255
+ 0
+ 128
+ 192
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 255
+ 0
+ 255
+
+
+ 255
+ 128
+ 64
+ 64
+
+
+ 255
+ 255
+ 128
+ 64
+
+
+ 255
+ 80
+ 240
+ 120
+
+
+ 255
+ 0
+ 64
+ 128
+
+
+ 255
+ 128
+ 0
+ 64
+
+
+ 255
+ 255
+ 0
+ 128
+
+
+ 255
+ 128
+ 128
+ 64
+
+
+ 255
+ 128
+ 128
+ 128
+
+
+ 255
+ 255
+ 128
+ 255
+
+
+ 255
+ 0
+ 64
+ 0
+
+
+ 255
+ 0
+ 0
+ 0
+
+
+ 255
+ 255
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 0
+
+
+
+ true
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+
+ row["COUNT_BY_APP"]
+
+ Text
+ Sum
+
+
+
+
+ Orthogonal_Value
+
+
+ Percentile_Orthogonal_Value
+
+ (
+ %)
+ 100.0
+ 2
+
+
+
+ Base_Value
+
+
+
+ Outside
+ false
+
+ onmouseover
+
+ Show_Tooltip
+
+
+ 200
+
+
+
+ 0
+
+
+
+
+ 16.0
+ true
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+ Below
+
+
+ 1
+ true
+
+ 10.0
+
+
+ Text
+ Sum
+
+
+
+ true
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+
+ row["appName"]
+
+
+
+
+ Orthogonal_Value
+
+ ,
+
+ Outside
+ false
+
+
+ true
+ Text
+ Sum
+
+
+
+]]>
+ SVG
+ false
+ 4.125in
+ 8.0625in
+ dl_by_app
+
+
+ COUNT_BY_APP
+ dataSetRow["COUNT_BY_APP"]
+ decimal
+
+
+ appName
+ dataSetRow["appName"]
+ string
+
+
+
+ |
+
+
+
+
+ #808080
+ bold
+ #FFFFFF
+ 4pt
+ 2pt
+ 2pt
+ auto
+
+
+ |
+
+
+ 3.2083333333333335in
+
+
+
+ 2.6.1
+ Bar Chart
+ Side-by-side
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ false
+
+
+ Chart Title
+
+ 16.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+ 5
+ 5
+
+
+
+ 0
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ false
+
+
+
+ 0
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 2.0
+ 2.0
+ 2.0
+ 2.0
+
+
+
+
+
+
+
+
+ Vertical
+ Top_Bottom
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+ Right
+ Series
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Above
+
+
+ 0.0
+ 0.0
+ 212.0
+ 130.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+
+ Two_Dimensional
+ Points
+ 10.0
+
+ enable.area.alt
+ false
+
+
+
+ 01/05/2000,02/01/2000,04/12/2000,03/12/2000,02/29/2000
+
+
+ 5,4,12
+ 0
+
+
+
+
+
+ This chart contains no data.
+
+
+ Center
+ Center
+
+
+
+
+ 64
+ 127
+ 127
+ 127
+
+
+
+ 128
+ 127
+ 127
+ 127
+
+ true
+
+
+ 10.0
+ 10.0
+ 10.0
+ 10.0
+
+ false
+
+
+ DateTime
+
+
+ X-Axis Title
+
+ 14.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Below
+
+ Linear
+
+
+ Y-Axis Title
+
+ 14.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Left
+
+
+
+
+
+
+
+ 255
+ 80
+ 166
+ 218
+
+
+ 255
+ 108
+ 222
+ 228
+
+ 90.0
+
+
+ 255
+ 242
+ 88
+ 106
+
+
+ 255
+ 232
+ 172
+ 57
+
+
+ 255
+ 128
+ 255
+ 128
+
+
+ 255
+ 64
+ 128
+ 128
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 170
+ 85
+ 85
+
+
+ 255
+ 128
+ 128
+ 0
+
+
+ 255
+ 192
+ 192
+ 192
+
+
+ 255
+ 255
+ 255
+ 128
+
+
+ 255
+ 128
+ 192
+ 128
+
+
+ 255
+ 7
+ 146
+ 94
+
+
+ 255
+ 0
+ 128
+ 255
+
+
+ 255
+ 255
+ 128
+ 192
+
+
+ 255
+ 0
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 128
+
+
+ 255
+ 0
+ 128
+ 192
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 255
+ 0
+ 255
+
+
+ 255
+ 128
+ 64
+ 64
+
+
+ 255
+ 255
+ 128
+ 64
+
+
+ 255
+ 80
+ 240
+ 120
+
+
+ 255
+ 0
+ 64
+ 128
+
+
+ 255
+ 128
+ 0
+ 64
+
+
+ 255
+ 255
+ 0
+ 128
+
+
+ 255
+ 128
+ 128
+ 64
+
+
+ 255
+ 128
+ 128
+ 128
+
+
+ 255
+ 255
+ 128
+ 255
+
+
+ 255
+ 0
+ 64
+ 0
+
+
+ 255
+ 0
+ 0
+ 0
+
+
+ 255
+ 255
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 0
+
+
+
+ true
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+
+ row["COUNT(ID)"]
+
+ Text
+ Sum
+
+
+ Series 1
+
+
+ Orthogonal_Value
+
+ ,
+
+ Outside
+ false
+
+ onmouseover
+
+ Show_Tooltip
+
+
+ 200
+
+
+
+
+
+
+ 1
+
+ 255
+ 128
+ 128
+ 128
+
+ true
+
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ North
+
+ Rectangle
+
+
+ Text
+ Sum
+
+
+ Vertical
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+ Left
+
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ true
+
+
+
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+
+
+ 5
+
+
+ Min
+
+ 0.0
+
+
+ true
+ false
+
+
+
+
+
+
+
+
+ 255
+ 80
+ 166
+ 218
+
+
+ 255
+ 108
+ 222
+ 228
+
+ 90.0
+
+
+ 255
+ 242
+ 88
+ 106
+
+
+ 255
+ 232
+ 172
+ 57
+
+
+ 255
+ 128
+ 255
+ 128
+
+
+ 255
+ 64
+ 128
+ 128
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 170
+ 85
+ 85
+
+
+ 255
+ 128
+ 128
+ 0
+
+
+ 255
+ 192
+ 192
+ 192
+
+
+ 255
+ 255
+ 255
+ 128
+
+
+ 255
+ 128
+ 192
+ 128
+
+
+ 255
+ 7
+ 146
+ 94
+
+
+ 255
+ 0
+ 128
+ 255
+
+
+ 255
+ 255
+ 128
+ 192
+
+
+ 255
+ 0
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 128
+
+
+ 255
+ 0
+ 128
+ 192
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 255
+ 0
+ 255
+
+
+ 255
+ 128
+ 64
+ 64
+
+
+ 255
+ 255
+ 128
+ 64
+
+
+ 255
+ 80
+ 240
+ 120
+
+
+ 255
+ 0
+ 64
+ 128
+
+
+ 255
+ 128
+ 0
+ 64
+
+
+ 255
+ 255
+ 0
+ 128
+
+
+ 255
+ 128
+ 128
+ 64
+
+
+ 255
+ 128
+ 128
+ 128
+
+
+ 255
+ 255
+ 128
+ 255
+
+
+ 255
+ 0
+ 64
+ 0
+
+
+ 255
+ 0
+ 0
+ 0
+
+
+ 255
+ 255
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 0
+
+
+
+ true
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+
+ row["DATE_FORMAT(DLDT, '%Y-%m-%d')"]
+
+
+
+
+ Orthogonal_Value
+
+ ,
+
+ Outside
+ false
+
+
+ true
+ Days
+ DateTime
+ Sum
+
+
+
+ Horizontal
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+
+
+
+
+
+ 46.0
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+
+ Y-M-d
+
+ Below
+
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ true
+
+
+
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+
+
+ 5
+
+
+ Min
+
+ 0.0
+
+
+ true
+ true
+ false
+
+ Vertical
+ 50.0
+
+
+ -20.0
+ 45.0
+ 0.0
+ None
+
+
+
+]]>
+ SVG
+ false
+ 3.6in
+ 8.135416666666666in
+ dl_by_date
+
+
+ COUNT(ID)
+ dataSetRow["COUNT(ID)"]
+ decimal
+
+
+ DATE_FORMAT(DLDT, '%Y-%m-%d')
+ dataSetRow["DATE_FORMAT(DLDT, '%Y-%m-%d')"]
+ date
+
+
+
+ |
+
+
+ 0.23958333333333334in
+
+
+ #808080
+ bold
+ #FFFFFF
+ 4pt
+ 2pt
+ 2pt
+ Download per device by date
+
+ |
+
+
+ 2.4270833333333335in
+
+
+
+ 2.6.1
+ Bar Chart
+ Side-by-side
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ false
+
+
+ Chart Title
+
+ 16.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+ 5
+ 5
+
+
+
+ 0
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+
+
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+
+
+
+ 0
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 2.0
+ 2.0
+ 2.0
+ 2.0
+
+
+
+
+
+
+
+
+ Vertical
+ Top_Bottom
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+ Right
+ Series
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Above
+
+
+ 0.0
+ 0.0
+ 212.0
+ 130.0
+
+
+ 3.0
+ 3.0
+ 3.0
+ 3.0
+
+ -1
+ -1
+ -1
+ -1
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+ true
+
+ Two_Dimensional
+ Points
+ 10.0
+
+ enable.area.alt
+ false
+
+
+
+ 01/05/2000,02/01/2000,04/12/2000,03/12/2000,02/29/2000
+
+
+ 5,4,12
+ 0
+
+
+
+
+
+ This chart contains no data.
+
+
+ Center
+ Center
+
+
+
+
+ 64
+ 127
+ 127
+ 127
+
+
+
+ 128
+ 127
+ 127
+ 127
+
+ true
+
+
+ 10.0
+ 10.0
+ 10.0
+ 10.0
+
+ false
+
+
+ DateTime
+
+
+ X-Axis Title
+
+ 14.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Below
+
+ Linear
+
+
+ Y-Axis Title
+
+ 14.0
+ true
+
+ Center
+ Center
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+ Left
+
+
+ row["deviceName"]
+
+ Text
+
+
+
+
+
+ 255
+ 80
+ 166
+ 218
+
+
+ 255
+ 108
+ 222
+ 228
+
+ 90.0
+
+
+ 255
+ 242
+ 88
+ 106
+
+
+ 255
+ 232
+ 172
+ 57
+
+
+ 255
+ 128
+ 255
+ 128
+
+
+ 255
+ 64
+ 128
+ 128
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 170
+ 85
+ 85
+
+
+ 255
+ 128
+ 128
+ 0
+
+
+ 255
+ 192
+ 192
+ 192
+
+
+ 255
+ 255
+ 255
+ 128
+
+
+ 255
+ 128
+ 192
+ 128
+
+
+ 255
+ 7
+ 146
+ 94
+
+
+ 255
+ 0
+ 128
+ 255
+
+
+ 255
+ 255
+ 128
+ 192
+
+
+ 255
+ 0
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 128
+
+
+ 255
+ 0
+ 128
+ 192
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 255
+ 0
+ 255
+
+
+ 255
+ 128
+ 64
+ 64
+
+
+ 255
+ 255
+ 128
+ 64
+
+
+ 255
+ 80
+ 240
+ 120
+
+
+ 255
+ 0
+ 64
+ 128
+
+
+ 255
+ 128
+ 0
+ 64
+
+
+ 255
+ 255
+ 0
+ 128
+
+
+ 255
+ 128
+ 128
+ 64
+
+
+ 255
+ 128
+ 128
+ 128
+
+
+ 255
+ 255
+ 128
+ 255
+
+
+ 255
+ 0
+ 64
+ 0
+
+
+ 255
+ 0
+ 0
+ 0
+
+
+ 255
+ 255
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 0
+
+
+
+ true
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+
+ row["COUNT(ID)"]
+
+ Text
+ Sum
+
+
+ Series 1
+
+
+ Orthogonal_Value
+
+ ,
+
+ Outside
+ false
+
+ onmouseover
+
+ Show_Tooltip
+
+
+ 200
+
+
+
+ Rectangle
+
+
+ Text
+ Sum
+
+
+ Vertical
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+ Left
+
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ true
+
+
+
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+
+
+ 5
+
+
+ Min
+
+ 0.0
+
+
+ true
+ false
+
+
+
+
+
+
+
+ 255
+ 80
+ 166
+ 218
+
+
+ 255
+ 242
+ 88
+ 106
+
+
+ 255
+ 232
+ 172
+ 57
+
+
+ 255
+ 128
+ 255
+ 128
+
+
+ 255
+ 64
+ 128
+ 128
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 170
+ 85
+ 85
+
+
+ 255
+ 128
+ 128
+ 0
+
+
+ 255
+ 192
+ 192
+ 192
+
+
+ 255
+ 255
+ 255
+ 128
+
+
+ 255
+ 128
+ 192
+ 128
+
+
+ 255
+ 7
+ 146
+ 94
+
+
+ 255
+ 0
+ 128
+ 255
+
+
+ 255
+ 255
+ 128
+ 192
+
+
+ 255
+ 0
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 128
+
+
+ 255
+ 0
+ 128
+ 192
+
+
+ 255
+ 128
+ 128
+ 192
+
+
+ 255
+ 255
+ 0
+ 255
+
+
+ 255
+ 128
+ 64
+ 64
+
+
+ 255
+ 255
+ 128
+ 64
+
+
+ 255
+ 80
+ 240
+ 120
+
+
+ 255
+ 0
+ 64
+ 128
+
+
+ 255
+ 128
+ 0
+ 64
+
+
+ 255
+ 255
+ 0
+ 128
+
+
+ 255
+ 128
+ 128
+ 64
+
+
+ 255
+ 128
+ 128
+ 128
+
+
+ 255
+ 255
+ 128
+ 255
+
+
+ 255
+ 0
+ 64
+ 0
+
+
+ 255
+ 0
+ 0
+ 0
+
+
+ 255
+ 255
+ 255
+ 255
+
+
+ 255
+ 255
+ 128
+ 0
+
+
+
+ true
+
+
+
+
+
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ false
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ false
+
+
+ row["DATE_FORMAT(DLDT, '%Y-%m-%d')"]
+
+
+
+
+ Orthogonal_Value
+
+ ,
+
+ Outside
+ false
+
+
+ true
+ Days
+ DateTime
+ Sum
+
+ Ascending
+
+ row["DATE_FORMAT(DLDT, '%Y-%m-%d')"]
+
+
+ Horizontal
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+ true
+
+
+
+
+
+
+ 41.0
+
+
+
+ 0
+ 255
+ 255
+ 255
+
+
+
+ 1
+
+ 255
+ 0
+ 0
+ 0
+
+
+
+ 0.0
+ 2.0
+ 0.0
+ 3.0
+
+ true
+
+
+ Y-M-dd
+
+ Below
+
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 196
+ 196
+ 196
+
+ true
+
+
+
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+ Across
+
+
+ 1
+
+ 255
+ 225
+ 225
+ 225
+
+ false
+
+
+
+ 5
+
+
+ Min
+
+ 0.0
+
+
+ true
+ true
+ false
+
+ Vertical
+ 50.0
+
+
+ -20.0
+ 45.0
+ 0.0
+ None
+
+
+
+]]>
+ SVG
+ false
+ 3.6in
+ 8.114583333333334in
+ dl_by_dn_date
+
+
+ DATE_FORMAT(DLDT, '%Y-%m-%d')
+ dataSetRow["DATE_FORMAT(DLDT, '%Y-%m-%d')"]
+ date
+
+
+ deviceName
+ dataSetRow["deviceName"]
+ string
+
+
+ COUNT(ID)
+ dataSetRow["COUNT(ID)"]
+ decimal
+
+
+
+ |
+
+
+
+
diff --git a/crm/src/main/doc/user_position_import.csv b/crm/src/main/doc/user_position_import.csv
new file mode 100644
index 0000000..99a8756
--- /dev/null
+++ b/crm/src/main/doc/user_position_import.csv
@@ -0,0 +1 @@
+PositionExternalId,EmployeeNumber,ExternalId,Ƿ
E1131031001,101SH218,E1131031001101SH218,
NT131031001,101BJ144,NT131031001101BJ144,
NE131031001,101LN098,NE131031001101LN098,
\ No newline at end of file
diff --git a/crm/src/main/doc/userinfo_import.csv b/crm/src/main/doc/userinfo_import.csv
new file mode 100644
index 0000000..edb49d8
--- /dev/null
+++ b/crm/src/main/doc/userinfo_import.csv
@@ -0,0 +1 @@
+,email,employeeNumber,¼,Password,û״̬,Ƿ
ʢ,sample@mail.com,101SH218,101SH218,12345,Ч,Ѽ
,sample@mail.com,101BJ144,101BJ144,12345,Ч,Ѽ
,sample@qq.com,101LN098,101LN098,12345,Ч,Ѽ
\ No newline at end of file
diff --git a/crm/src/main/java/com/rex/crm/AccountPage.html b/crm/src/main/java/com/rex/crm/AccountPage.html
new file mode 100755
index 0000000..1ae9b30
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/AccountPage.html
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/crm/src/main/java/com/rex/crm/AccountPage.java b/crm/src/main/java/com/rex/crm/AccountPage.java
new file mode 100644
index 0000000..51e7e31
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/AccountPage.java
@@ -0,0 +1,202 @@
+package com.rex.crm;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.request.IRequestParameters;
+import org.apache.wicket.util.string.StringValue;
+
+import com.google.common.collect.Lists;
+import com.rex.crm.beans.AdvancedSearchFilter;
+import com.rex.crm.beans.Choice;
+import com.rex.crm.common.Entity;
+import com.rex.crm.common.Field;
+import com.rex.crm.common.FilterPanel;
+import com.rex.crm.common.PageableTablePanel;
+import com.rex.crm.common.advancedSearch.AdvancedSearchPage;
+import com.rex.crm.common.advancedSearch.AdvancedSearchPanel;
+import com.rex.crm.db.DAOImpl;
+import com.rexen.crm.beans.UserRole;
+import com.rex.crm.util.Configuration;
+
+/**
+ * @author Feiyun Zhou
+ */
+public class AccountPage extends TemplatePage
+{
+ private static final Logger logger = Logger.getLogger(AccountPage.class);
+ private String search_target = "";
+
+ /**
+ * Constructor
+ */
+ public AccountPage()
+ {
+ //PageParameters pp = new PageParameters();
+ //IRequestParameters params = this.getRequestCycle().getRequest().getRequestParameters();
+ initPage(null, null);
+ }
+
+ public AccountPage(Map map, List tdata)
+ {
+ initPage(map, tdata);
+ }
+
+ public AccountPage( List tdata)
+ {
+ initPage(null, tdata);
+ }
+
+ private void initPage(final Map filter, List tdata)
+ {
+ Map entities = Configuration.getEntityTable();
+ final Entity entity = entities.get("account");
+ setPageTitle(entity.getDisplay());
+ // List mapList = DAOImpl.queryEntityList(entity.getSql(), 0, 1000);
+ // TODO get userId from request's session
+ final String positionId = ((SignIn2Session) getSession()).getPositionId();
+ final int roleId = ((SignIn2Session) getSession()).getRoleId();
+
+ Form form = new Form("form")
+ {
+
+ @Override
+ protected void onSubmit()
+ {
+ String sql = entity.getSql();
+ switch (roleId)
+ {
+ case 1:
+ sql = entity.getSqlAdmin();
+ break;
+ case 2:
+ sql = entity.getSqlManager();
+ break;
+ case 3:
+ sql = entity.getSql();
+ break;
+ }
+
+ search_target = (search_target == null || search_target.equalsIgnoreCase("*")) ? "" : search_target;
+
+ List searchableFields = entity.getSearchableFields();
+ String joint = " like '%" + search_target + "%'";
+ String likequery = "";
+ for (Field sf : searchableFields)
+ {
+ likequery = likequery + " OR " + sf.getName() + joint;
+ }
+ sql = sql + " where name like '%" + search_target + "%' " + likequery;
+ System.out.println(sql);
+ List datalist = null;
+
+ switch (roleId)
+ {
+ case UserRole.USER_ROLE_MANAGER:
+ datalist = DAOImpl.queryEntityRelationList(sql, positionId, positionId, positionId);
+ break;
+ case UserRole.USER_ROLE_SALES:
+ datalist = DAOImpl.queryEntityRelationList(sql, positionId, positionId);
+ break;
+ case UserRole.USER_ROLE_ADMINISTRATOR:
+ datalist = DAOImpl.queryEntityRelationList(sql);
+ }
+
+ setResponsePage(new AccountPage(filter, datalist));
+
+ }
+
+ };
+ add(form);
+
+ TextField search_input = new TextField("search_input", new PropertyModel(this, "search_target"));
+ form.add(search_input);
+ form.add(new Link("ad_search_link"){
+ @Override
+ public void onClick() {
+ setResponsePage(new AdvancedSearchPage(entity.getName(),null));
+
+ }
+
+ } );
+// add(new AdvancedPanel("advancedSearch",entity));
+ String sql = entity.getSql();
+ switch (roleId)
+ {
+ case 1:
+ sql = entity.getSqlAdmin();
+ break;
+ case 2:
+ sql = entity.getSqlManager();
+ break;
+ case 3:
+ sql = entity.getSql();
+ break;
+ }
+ if (tdata == null || tdata.size() == 0)
+ {
+
+ if (filter == null)
+ {
+// if(params != null){
+// StringValue ad_search_sql_value = params.getParameterValue("ad_search_sql");
+// if( !ad_search_sql_value.isNull() && !ad_search_sql_value.isEmpty()){
+// sql = sql + " where " + ad_search_sql_value.toString();
+// logger.debug("sql is: " + sql);
+// }
+// }
+ switch (roleId)
+ {
+ case UserRole.USER_ROLE_ADMINISTRATOR:
+ tdata = DAOImpl.queryEntityRelationList(sql);
+ break;
+ case UserRole.USER_ROLE_MANAGER:
+ tdata = DAOImpl.queryEntityRelationList(sql, positionId, positionId, positionId);
+ break;
+ case UserRole.USER_ROLE_SALES:
+ tdata = DAOImpl.queryEntityRelationList(sql, positionId, positionId);
+ }
+
+ }
+ else
+ {
+ List ft = Lists.newArrayList();
+ for (String k : filter.keySet())
+ {
+ if (filter.get(k))
+ ft.add(k);
+ }
+
+ switch (roleId)
+ {
+ case UserRole.USER_ROLE_ADMINISTRATOR:
+ tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft);
+ break;
+ case UserRole.USER_ROLE_MANAGER:
+ tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft, positionId, positionId, positionId);
+ break;
+ case UserRole.USER_ROLE_SALES:
+ tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft, positionId,positionId);
+ }
+
+ }
+ }
+ // add(new AdvancedSearchPanel("advancedSearch","account"));
+
+ add(new PageableTablePanel("datalist", entity, tdata, null));
+
+ List choices = DAOImpl.queryPickList(entity.getFieldByName(entity.getFilterField()).getPicklist());
+
+ add(new FilterPanel("filterPanel", choices, filter, AccountPage.class,entity));
+
+
+
+
+ }
+
+}
\ No newline at end of file
diff --git a/crm/src/main/java/com/rex/crm/ActivitedUser.html b/crm/src/main/java/com/rex/crm/ActivitedUser.html
new file mode 100644
index 0000000..c77886b
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/ActivitedUser.html
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/crm/src/main/java/com/rex/crm/ActivitedUser.java b/crm/src/main/java/com/rex/crm/ActivitedUser.java
new file mode 100644
index 0000000..f5e6c1f
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/ActivitedUser.java
@@ -0,0 +1,90 @@
+package com.rex.crm;
+
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.apache.wicket.behavior.AttributeAppender;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.PasswordTextField;
+import org.apache.wicket.markup.html.list.AbstractItem;
+import org.apache.wicket.markup.repeater.RepeatingView;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.util.string.StringValue;
+
+import com.google.common.collect.Maps;
+import com.rex.crm.beans.CRMUser;
+import com.rex.crm.beans.UserInfo;
+import com.rex.crm.common.ErrorPromptPage;
+import com.rex.crm.db.DAOImpl;
+
+public class ActivitedUser extends WebPage{
+
+ private static final long serialVersionUID = 7417410502168544421L;
+ private static final Logger logger = Logger.getLogger(UpdateSignPassword.class);
+ final Map models = Maps.newHashMap();
+ public ActivitedUser(){
+ logger.debug("activitedUser");
+ String activitedCode = this.getRequest().getRequestParameters().getParameterValue("activitedCode").toString();
+ logger.debug("loginName:"+activitedCode);
+ String [] strs=activitedCode.split("_");
+ logger.debug("str:"+strs[0]);
+ long createTime = Long.parseLong(strs[0]);
+ int userID =Integer.parseInt(strs[1]);
+ UserInfo userInfo = DAOImpl.getUserByActivation(userID,createTime);
+ /*if(userInfo.IsActivited()==0){
+ initPage(userID,createTime);
+ }else{
+ setResponsePage(new ErrorPromptPage());
+ }*/
+ }
+ public void initPage(final int userID,final long createTime){
+ logger.debug("init");
+ UserInfo userInfo = DAOImpl.getUserByActivation(userID,createTime);;
+ final int userId = userInfo.getId();
+ final String userLoginName = userInfo.getLoginName();
+ //此时获取到对象,接收客户端的数据
+ final Label promptLabel = new Label("prompt","操作失败重新输入!");
+ Form form = new Form("form"){
+ @Override
+ protected void onSubmit() {
+ System.out.println("submit");
+ String password = models.get("password").getObject() == null? null:String.valueOf(models.get("password").getObject());
+ logger.debug("pwd:"+password);
+ if(DAOImpl.updateCrmUserPassword(userId, password)){
+ //修改crmuser的激活状态为已激活
+ DAOImpl.updateUserActivited(userId);
+ //用此用户登录
+ SignIn2Session session = getMysession();
+ session.setUser(null);
+ if (session.signIn(userLoginName, password))
+ {
+ setResponsePage(getApplication().getHomePage());
+ }else{
+ promptLabel.add(new AttributeAppender("style",new Model("display:block;"),";"));
+ }
+ }else{
+ promptLabel.add(new AttributeAppender("style",new Model("display:block;"),";"));
+ }
+ }
+ };
+ add(form);
+ add(promptLabel);
+ form.add(new Label("userName",userInfo.getName()));
+ IModel textModel = new Model("");
+ form.add(new Label("loginName",userInfo.getLoginName()));
+ PasswordTextField password = new PasswordTextField("password",textModel);
+ models.put("password",textModel);
+ form.add(password);
+ IModel textModelPassword = new Model("");
+ PasswordTextField newPassword = new PasswordTextField("newPassword",textModel);
+ models.put("newPassword",textModelPassword);
+ form.add(newPassword);
+ }
+ private SignIn2Session getMysession()
+ {
+ return (SignIn2Session)getSession();
+ }
+}
diff --git a/crm/src/main/java/com/rex/crm/ActivityPage.html b/crm/src/main/java/com/rex/crm/ActivityPage.html
new file mode 100755
index 0000000..0703701
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/ActivityPage.html
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/crm/src/main/java/com/rex/crm/ActivityPage.java b/crm/src/main/java/com/rex/crm/ActivityPage.java
new file mode 100644
index 0000000..f6aed34
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/ActivityPage.java
@@ -0,0 +1,164 @@
+package com.rex.crm;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.model.PropertyModel;
+
+import com.google.common.collect.Lists;
+import com.rex.crm.beans.Choice;
+import com.rex.crm.common.Entity;
+import com.rex.crm.common.Field;
+import com.rex.crm.common.FilterPanel;
+import com.rex.crm.common.PageableTablePanel;
+import com.rex.crm.common.advancedSearch.AdvancedSearchPage;
+import com.rex.crm.db.DAOImpl;
+import com.rexen.crm.beans.UserRole;
+import com.rex.crm.util.Configuration;
+
+
+/**
+ * @author Feiyun Zhou
+ */
+public class ActivityPage extends TemplatePage
+{
+ private String search_target = "";
+ public ActivityPage(){
+ init(null,null);
+ }
+ public ActivityPage(final Map filter,List tdata){
+ init(filter,tdata);
+ }
+
+ public ActivityPage(List tdata){
+ init(null,tdata);
+ }
+
+ public void init(final Map filter,List tdata)
+ {
+ Map entities = Configuration.getEntityTable();
+ final Entity entity = entities.get("activity");
+ setPageTitle(entity.getDisplay());
+ //List mapList = DAOImpl.queryEntityList(entity.getSql(), 0, 1000);
+ //TODO get userId from request's session
+ final String posId = ((SignIn2Session)getSession()).getPositionId();
+ final int roleId = ((SignIn2Session)getSession()).getRoleId();
+
+
+ Form form = new Form("form"){
+
+ @Override
+ protected void onSubmit() {
+
+ String sql = entity.getSql();
+ switch(roleId){
+ case UserRole.USER_ROLE_ADMINISTRATOR:
+ sql = entity.getSqlAdmin();
+ break;
+ case UserRole.USER_ROLE_MANAGER:
+ sql = entity.getSqlManager();
+ break;
+ case UserRole.USER_ROLE_SALES:
+ sql = entity.getSql();
+ break;
+ }
+
+ search_target = (search_target==null || search_target.equalsIgnoreCase("*"))? "":search_target;
+
+ //sql = sql + " where title like '%"+search_target+"%'";
+ List searchableFields = entity.getSearchableFields();
+ String joint = " like '%"+search_target+"%'";
+ String likequery = "";
+ for(Field sf:searchableFields){
+ likequery = likequery + " OR "+ sf.getName() + joint;
+ }
+ sql = sql + " where title like '%"+search_target+"%' " + likequery;
+ List datalist = null;
+ switch(roleId){
+ case UserRole.USER_ROLE_ADMINISTRATOR:
+ datalist = DAOImpl.queryEntityRelationList(sql);
+ break;
+ case UserRole.USER_ROLE_MANAGER:
+ datalist = DAOImpl.queryEntityRelationList(sql,posId,posId);
+ break;
+ case UserRole.USER_ROLE_SALES:
+ datalist = DAOImpl.queryEntityRelationList(sql,posId);
+ }
+ setResponsePage(new ActivityPage(filter,datalist));
+
+ }
+
+ };
+ add(form);
+ form.add(new Link("ad_search_link"){
+ @Override
+ public void onClick() {
+ setResponsePage(new AdvancedSearchPage(entity.getName(),null));
+
+ }
+ });
+ TextField search_input = new TextField("search_input", new PropertyModel(this,"search_target"));
+ form.add(search_input);
+ String sql = entity.getSql();
+ switch(roleId){
+ case UserRole.USER_ROLE_ADMINISTRATOR:
+ sql = entity.getSqlAdmin();
+ break;
+ case UserRole.USER_ROLE_MANAGER:
+ sql = entity.getSqlManager();
+ break;
+ case UserRole.USER_ROLE_SALES:
+ sql = entity.getSql();
+ break;
+ }
+
+ if(tdata == null || tdata.size() == 0){
+
+ if(filter == null){
+
+ switch(roleId){
+ case UserRole.USER_ROLE_ADMINISTRATOR:
+ tdata = DAOImpl.queryEntityRelationList(sql);
+ break;
+ case UserRole.USER_ROLE_MANAGER:
+ tdata = DAOImpl.queryEntityRelationList(sql,posId,posId);
+ break;
+ case UserRole.USER_ROLE_SALES:
+ tdata = DAOImpl.queryEntityRelationList(sql, posId);
+ }
+
+
+ }else{
+ List ft = Lists.newArrayList();
+ for (String k : filter.keySet()) {
+ if(filter.get(k)) ft.add(k);
+ }
+
+ switch(roleId){
+ case UserRole.USER_ROLE_ADMINISTRATOR:
+ tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft);
+ break;
+ case UserRole.USER_ROLE_MANAGER:
+ tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft,posId,posId);
+ break;
+ case UserRole.USER_ROLE_SALES:
+ tdata =DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft, posId);
+ }
+
+
+ }
+
+
+ }
+ add(new PageableTablePanel("datalist",entity,tdata,null));
+
+
+
+ List choices = DAOImpl.queryPickList(entity.getFieldByName(entity.getFilterField()).getPicklist());
+ add(new FilterPanel("filterPanel",choices ,filter,ActivityPage.class,entity));
+ }
+}
\ No newline at end of file
diff --git a/crm/src/main/java/com/rex/crm/ActivitySelectPage.html b/crm/src/main/java/com/rex/crm/ActivitySelectPage.html
new file mode 100644
index 0000000..179d8fa
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/ActivitySelectPage.html
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
diff --git a/crm/src/main/java/com/rex/crm/ActivitySelectPage.java b/crm/src/main/java/com/rex/crm/ActivitySelectPage.java
new file mode 100644
index 0000000..f14d40d
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/ActivitySelectPage.java
@@ -0,0 +1,59 @@
+package com.rex.crm;
+
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Button;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.markup.html.list.AbstractItem;
+import org.apache.wicket.markup.html.panel.Fragment;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.markup.repeater.RepeatingView;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.util.string.StringValue;
+
+import com.google.common.collect.Maps;
+import com.rex.crm.common.CreateDataPage;
+
+public class ActivitySelectPage extends TemplatePage{
+ /**
+ * Constructor
+ */
+ public ActivitySelectPage(){
+ //传参时间和实体名
+ StringValue entityName = getRequest().getRequestParameters().getParameterValue("entityName");
+ final String createAddress = getRequest().getRequestParameters().getParameterValue("createAddress").toString();
+ final String name = entityName.toString();
+ Set names = getRequest().getRequestParameters().getParameterNames();
+ final Map map = Maps.newHashMap();
+ for(String nm:names){
+ StringValue sv = getRequest().getRequestParameters().getParameterValue(nm);
+ map.put(nm, sv.toString());
+ }
+ if(("activity").equals(name)){
+ initPage(name,map,createAddress);
+ }else{
+ Form form = new Form("buttonForm");
+ form.add(new Button("callCoachBtn") {
+ @Override
+ public void onSubmit() {
+ setResponsePage(new CreateDataPage("coaching", map,createAddress));
+ }
+ });
+ form.add(new Link("willCoachBtn") {
+ @Override
+ public void onClick() {
+ setResponsePage(new CreateDataPage("willcoaching", map,createAddress));
+ }
+ });
+ add(form);
+ }
+ }
+ public void initPage(final String name,final Map params,String createAddress){
+ setResponsePage(new CreateDataPage(name,params,createAddress));
+ }
+}
diff --git a/crm/src/main/java/com/rex/crm/AlertPage.html b/crm/src/main/java/com/rex/crm/AlertPage.html
new file mode 100644
index 0000000..bb86255
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/AlertPage.html
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/crm/src/main/java/com/rex/crm/AlertPage.java b/crm/src/main/java/com/rex/crm/AlertPage.java
new file mode 100644
index 0000000..bb88baf
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/AlertPage.java
@@ -0,0 +1,157 @@
+package com.rex.crm;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.model.PropertyModel;
+
+import com.google.common.collect.Lists;
+import com.rex.crm.admin.AdminTemplatePage;
+import com.rex.crm.beans.Choice;
+import com.rex.crm.common.Entity;
+import com.rex.crm.common.Field;
+import com.rex.crm.common.FilterPanel;
+import com.rex.crm.common.PageableTablePanel;
+import com.rex.crm.common.advancedSearch.AdvancedSearchPage;
+import com.rex.crm.db.DAOImpl;
+import com.rex.crm.util.Configuration;
+import com.rexen.crm.beans.UserRole;
+
+public class AlertPage extends AdminTemplatePage{
+ private String search_target = "";
+ public AlertPage(){
+ init(null,null);
+ }
+ public AlertPage(final Map filter,List tdata){
+ init(filter,tdata);
+ }
+
+ public void init(final Map filter,List tdata)
+ {
+ Map entities = Configuration.getEntityTable();
+ final Entity entity = entities.get("alert");
+ setPageTitle("系统管理-信息发布");
+ //List mapList = DAOImpl.queryEntityList(entity.getSql(), 0, 1000);
+ //TODO get userId from request's session
+ final String posId = ((SignIn2Session)getSession()).getPositionId();
+ final int roleId = ((SignIn2Session)getSession()).getRoleId();
+
+
+ Form form = new Form("form"){
+
+ @Override
+ protected void onSubmit() {
+
+ String sql = entity.getSql();
+ switch(roleId){
+ case UserRole.USER_ROLE_ADMINISTRATOR:
+ sql = entity.getSqlAdmin();
+ break;
+ case UserRole.USER_ROLE_MANAGER:
+ sql = entity.getSqlManager();
+ break;
+ case UserRole.USER_ROLE_SALES:
+ sql = entity.getSql();
+ break;
+ }
+ search_target = (search_target == null || search_target.equalsIgnoreCase("*")) ? "" : search_target;
+
+ List searchableFields = entity.getSearchableFields();
+ String joint = " like '%" + search_target + "%'";
+ String likequery = "";
+ for (Field sf : searchableFields)
+ {
+ likequery = likequery + " OR " + sf.getName() + joint;
+ }
+ sql = sql + " where name like '%" + search_target + "%' " + likequery;
+ System.out.println(sql);
+ List datalist = null;
+ switch(roleId){
+ case UserRole.USER_ROLE_ADMINISTRATOR:
+ datalist = DAOImpl.queryEntityRelationList(sql);
+ break;
+ case UserRole.USER_ROLE_MANAGER:
+ datalist = DAOImpl.queryEntityRelationList(sql,posId,posId);
+ break;
+ case UserRole.USER_ROLE_SALES:
+ datalist = DAOImpl.queryEntityRelationList(sql,posId);
+ }
+ setResponsePage(new AlertPage(filter,datalist));
+
+ }
+
+ };
+ add(form);
+ form.add(new Link("ad_search_link"){
+ @Override
+ public void onClick() {
+ setResponsePage(new AdvancedSearchPage(entity.getName(),null));
+
+ }
+ });
+ TextField search_input = new TextField("search_input", new PropertyModel(this,"search_target"));
+ form.add(search_input);
+ String sql = entity.getSql();
+ switch(roleId){
+ case UserRole.USER_ROLE_ADMINISTRATOR:
+ sql = entity.getSqlAdmin();
+ break;
+ case UserRole.USER_ROLE_MANAGER:
+ sql = entity.getSqlManager();
+ break;
+ case UserRole.USER_ROLE_SALES:
+ sql = entity.getSql();
+ break;
+ }
+
+ if(tdata == null || tdata.size() == 0){
+
+ if(filter == null){
+
+ switch(roleId){
+ case UserRole.USER_ROLE_ADMINISTRATOR:
+ tdata = DAOImpl.queryEntityRelationList(sql);
+ break;
+ case UserRole.USER_ROLE_MANAGER:
+ tdata = DAOImpl.queryEntityRelationList(sql,posId,posId);
+ break;
+ case UserRole.USER_ROLE_SALES:
+ tdata = DAOImpl.queryEntityRelationList(sql, posId);
+ }
+
+
+ }else{
+ List ft = Lists.newArrayList();
+ for (String k : filter.keySet()) {
+ if(filter.get(k)) ft.add(k);
+ }
+
+ switch(roleId){
+ case UserRole.USER_ROLE_ADMINISTRATOR:
+ tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft);
+ break;
+ case UserRole.USER_ROLE_MANAGER:
+ tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft,posId,posId);
+ break;
+ case UserRole.USER_ROLE_SALES:
+ tdata =DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft, posId);
+ }
+
+
+ }
+
+
+ }
+ add(new PageableTablePanel("datalist",entity,tdata,null));
+
+
+
+ List choices = DAOImpl.queryPickList(entity.getFieldByName(entity.getFilterField()).getPicklist());
+ add(new FilterPanel("filterPanel",choices ,filter,AlertPage.class,entity));
+ }
+}
+
diff --git a/crm/src/main/java/com/rex/crm/AreaPage.html b/crm/src/main/java/com/rex/crm/AreaPage.html
new file mode 100644
index 0000000..9e91925
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/AreaPage.html
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/crm/src/main/java/com/rex/crm/AreaPage.java b/crm/src/main/java/com/rex/crm/AreaPage.java
new file mode 100644
index 0000000..2fa4c83
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/AreaPage.java
@@ -0,0 +1,108 @@
+package com.rex.crm;
+
+import java.util.List;
+import java.util.Map;
+
+
+
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.model.PropertyModel;
+
+import com.google.common.collect.Lists;
+import com.rex.crm.common.Entity;
+import com.rex.crm.common.Field;
+import com.rex.crm.common.PageableTablePanel;
+import com.rex.crm.common.advancedSearch.AdvancedSearchPage;
+import com.rex.crm.db.DAOImpl;
+import com.rex.crm.util.Configuration;
+import com.rex.crm.admin.AdminTemplatePage;
+/**
+ * @author Sam sun
+ */
+public class AreaPage extends AdminTemplatePage{
+ private String search_target = "";
+
+ public AreaPage()
+ {
+ initPage(null, null);
+ }
+
+ public AreaPage(final Map filter, List tdata)
+ {
+ initPage(filter, tdata);
+ }
+ public void initPage(final Map filter, List tdata)
+ {
+ Map entities = Configuration.getEntityTable();
+ final Entity entity = entities.get("province");
+ setPageTitle("系统管理-区域管理");
+
+
+ Form form = new Form("form")
+ {
+
+ @Override
+ protected void onSubmit()
+ {
+ String sql = entity.getSql();
+
+
+ search_target = (search_target == null || search_target.equalsIgnoreCase("*")) ? "" : search_target;
+
+ // sql = sql + " AND name like '%"+search_target+"%'";
+ List searchableFields = entity.getSearchableFields();
+ String joint = " like '%" + search_target + "%'";
+ String likequery = "";
+ for (Field sf : searchableFields)
+ {
+ likequery = likequery + " OR " + sf.getName() + joint;
+ }
+
+ sql = sql + " where val like '%" + search_target + "%' " + likequery;
+ List datalist = null;
+ datalist = DAOImpl.queryEntityRelationList(sql);
+ setResponsePage(new AreaPage(filter, datalist));
+
+ }
+
+ };
+ add(form);
+ form.add(new Link("ad_search_link"){
+ @Override
+ public void onClick() {
+ setResponsePage(new AdvancedSearchPage(entity.getName(),null));
+
+ }
+ });
+ TextField search_input = new TextField("search_input", new PropertyModel(this, "search_target"));
+ form.add(search_input);
+
+ String sql = entity.getSql();
+ // List mapList = DAOImpl.queryEntityList(entity.getSql(), 0, 1000);
+ if (tdata == null || tdata.size() == 0)
+ {
+ tdata = DAOImpl.queryEntityRelationList(sql);
+
+ if (filter == null)
+ {
+ tdata = DAOImpl.queryEntityRelationList(sql);
+ }
+ else
+ {
+ List ft = Lists.newArrayList();
+ for (String k : filter.keySet())
+ {
+ if (filter.get(k))
+ ft.add(k);
+ }
+ tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft);
+ }
+
+ }
+ add(new PageableTablePanel("datalist", entity, tdata, null));
+
+
+ }
+}
diff --git a/crm/src/main/java/com/rex/crm/AuthenticatedWebPage.java b/crm/src/main/java/com/rex/crm/AuthenticatedWebPage.java
new file mode 100755
index 0000000..2ff4df9
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/AuthenticatedWebPage.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.rex.crm;
+
+import org.apache.wicket.markup.html.WebPage;
+
+
+/**
+ * Base class to check access to a page. If user is not logged in, redirect to the log-in page.
+ *
+ * @author Jonathan Locke
+ */
+public class AuthenticatedWebPage extends WebPage
+{
+}
diff --git a/crm/src/main/java/com/rex/crm/CalendarPage.html b/crm/src/main/java/com/rex/crm/CalendarPage.html
new file mode 100755
index 0000000..9d8fe9a
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/CalendarPage.html
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/crm/src/main/java/com/rex/crm/CalendarPage.java b/crm/src/main/java/com/rex/crm/CalendarPage.java
new file mode 100644
index 0000000..4a2ead2
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/CalendarPage.java
@@ -0,0 +1,44 @@
+package com.rex.crm;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+
+import org.apache.wicket.markup.head.IHeaderResponse;
+import org.apache.wicket.markup.head.JavaScriptHeaderItem;
+import org.apache.wicket.markup.html.internal.HtmlHeaderContainer;
+import org.apache.wicket.protocol.http.WebApplication;
+
+import com.rex.crm.common.CalendarPanel;
+import com.rex.crm.common.Entity;
+import com.rex.crm.common.TableDataPanel;
+import com.rex.crm.db.DAOImpl;
+import com.rex.crm.util.Configuration;
+
+
+/**
+ * @author Feiyun Zhou
+ */
+public class CalendarPage extends TemplatePage
+{
+ /**
+ * Constructor
+ */
+ public CalendarPage()
+ {
+ Map entities = Configuration.getEntityTable();
+ //Entity entity = entities.get("activity");
+ setPageTitle("日历");
+
+
+ add(new CalendarPanel("datalist"));
+
+
+ }
+
+
+
+
+
+}
\ No newline at end of file
diff --git a/crm/src/main/java/com/rex/crm/CoachScoringPage.html b/crm/src/main/java/com/rex/crm/CoachScoringPage.html
new file mode 100644
index 0000000..e312326
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/CoachScoringPage.html
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/crm/src/main/java/com/rex/crm/CoachScoringPage.java b/crm/src/main/java/com/rex/crm/CoachScoringPage.java
new file mode 100644
index 0000000..8db47f6
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/CoachScoringPage.java
@@ -0,0 +1,12 @@
+package com.rex.crm;
+
+public class CoachScoringPage extends TemplatePage{
+ private static final long serialVersionUID = 3655394922203975705L;
+
+ public CoachScoringPage(int activity){
+ initPage(activity);
+ }
+ public void initPage(int activity){
+
+ }
+}
diff --git a/crm/src/main/java/com/rex/crm/CoachingPage.html b/crm/src/main/java/com/rex/crm/CoachingPage.html
new file mode 100644
index 0000000..6fb1dad
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/CoachingPage.html
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/crm/src/main/java/com/rex/crm/CoachingPage.java b/crm/src/main/java/com/rex/crm/CoachingPage.java
new file mode 100644
index 0000000..da07747
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/CoachingPage.java
@@ -0,0 +1,165 @@
+package com.rex.crm;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.model.PropertyModel;
+
+import com.google.common.collect.Lists;
+import com.rex.crm.beans.Choice;
+import com.rex.crm.common.Entity;
+import com.rex.crm.common.Field;
+import com.rex.crm.common.FilterPanel;
+import com.rex.crm.common.PageableTablePanel;
+import com.rex.crm.common.advancedSearch.AdvancedSearchPage;
+import com.rex.crm.db.DAOImpl;
+import com.rexen.crm.beans.UserRole;
+import com.rex.crm.util.Configuration;
+
+
+/**
+ * @author Feiyun Zhou
+ */
+public class CoachingPage extends TemplatePage
+{
+ private String search_target = "";
+ public CoachingPage(){
+ init(null,null);
+ }
+ public CoachingPage(final Map filter,List tdata){
+ init(filter,tdata);
+ }
+
+ public CoachingPage(List tdata){
+ init(null,tdata);
+ }
+ public void init(final Map filter,List tdata)
+ {
+ Map entities = Configuration.getEntityTable();
+ final Entity entity = entities.get("coaching");
+ setPageTitle(entity.getDisplay());
+ //List mapList = DAOImpl.queryEntityList(entity.getSql(), 0, 1000);
+ //TODO get userId from request's session
+ final String posId = ((SignIn2Session)getSession()).getPositionId();
+ final int roleId = ((SignIn2Session)getSession()).getRoleId();
+
+
+ Form form = new Form("form"){
+
+ @Override
+ protected void onSubmit() {
+
+ String sql = entity.getSql();
+ switch(roleId){
+ case UserRole.USER_ROLE_ADMINISTRATOR:
+ sql = entity.getSqlAdmin();
+ break;
+ case UserRole.USER_ROLE_MANAGER:
+ sql = entity.getSqlManager();
+ break;
+ case UserRole.USER_ROLE_SALES:
+ sql = entity.getSql();
+ break;
+ }
+
+ search_target = (search_target==null || search_target.equalsIgnoreCase("*"))? "":search_target;
+
+ //sql = sql + " where title like '%"+search_target+"%'";
+ List searchableFields = entity.getSearchableFields();
+ String joint = " like '%"+search_target+"%'";
+ String likequery = "";
+ for(Field sf:searchableFields){
+ likequery = likequery + " OR "+ sf.getName() + joint;
+ }
+ sql = sql + " where title like '%"+search_target+"%' " + likequery;
+ System.out.println("sql:"+sql);
+ List datalist = null;
+ switch(roleId){
+ case UserRole.USER_ROLE_ADMINISTRATOR:
+ datalist = DAOImpl.queryEntityRelationList(sql);
+ break;
+ case UserRole.USER_ROLE_MANAGER:
+ datalist = DAOImpl.queryEntityRelationList(sql,posId,posId);
+ break;
+ case UserRole.USER_ROLE_SALES:
+ datalist = DAOImpl.queryEntityRelationList(sql,posId);
+ }
+ setResponsePage(new CoachingPage(filter,datalist));
+
+ }
+
+ };
+ add(form);
+ form.add(new Link("ad_search_link"){
+ @Override
+ public void onClick() {
+ setResponsePage(new AdvancedSearchPage(entity.getName(),null));
+
+ }
+ });
+ TextField search_input = new TextField("search_input", new PropertyModel(this,"search_target"));
+ form.add(search_input);
+ String sql = entity.getSql();
+ switch(roleId){
+ case UserRole.USER_ROLE_ADMINISTRATOR:
+ sql = entity.getSqlAdmin();
+ break;
+ case UserRole.USER_ROLE_MANAGER:
+ sql = entity.getSqlManager();
+ break;
+ case UserRole.USER_ROLE_SALES:
+ sql = entity.getSql();
+ break;
+ }
+
+ if(tdata == null || tdata.size() == 0){
+
+ if(filter == null){
+
+ switch(roleId){
+ case UserRole.USER_ROLE_ADMINISTRATOR:
+ tdata = DAOImpl.queryEntityRelationList(sql);
+ break;
+ case UserRole.USER_ROLE_MANAGER:
+ tdata = DAOImpl.queryEntityRelationList(sql,posId,posId);
+ break;
+ case UserRole.USER_ROLE_SALES:
+ tdata = DAOImpl.queryEntityRelationList(sql, posId);
+ }
+
+
+ }else{
+ List ft = Lists.newArrayList();
+ for (String k : filter.keySet()) {
+ if(filter.get(k)) ft.add(k);
+ }
+
+ switch(roleId){
+ case UserRole.USER_ROLE_ADMINISTRATOR:
+ tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft);
+ break;
+ case UserRole.USER_ROLE_MANAGER:
+ tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft,posId,posId);
+ break;
+ case UserRole.USER_ROLE_SALES:
+ tdata =DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft, posId);
+ }
+
+
+ }
+
+
+ }
+ add(new PageableTablePanel("datalist",entity,tdata,null));
+
+
+ List choices = DAOImpl.queryPickList(entity.getFieldByName(entity.getFilterField()).getPicklist());
+
+ add(new FilterPanel("filterPanel",choices ,filter,CoachingPage.class,entity));
+
+ }
+}
\ No newline at end of file
diff --git a/crm/src/main/java/com/rex/crm/ContactPage.html b/crm/src/main/java/com/rex/crm/ContactPage.html
new file mode 100755
index 0000000..4341365
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/ContactPage.html
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/crm/src/main/java/com/rex/crm/ContactPage.java b/crm/src/main/java/com/rex/crm/ContactPage.java
new file mode 100644
index 0000000..2cbb7af
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/ContactPage.java
@@ -0,0 +1,181 @@
+package com.rex.crm;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.model.PropertyModel;
+
+import com.google.common.collect.Lists;
+import com.rex.crm.beans.Choice;
+import com.rex.crm.common.Entity;
+import com.rex.crm.common.Field;
+import com.rex.crm.common.FilterPanel;
+import com.rex.crm.common.PageableTablePanel;
+import com.rex.crm.common.TableDataPanel;
+import com.rex.crm.common.advancedSearch.AdvancedSearchPage;
+import com.rex.crm.db.DAOImpl;
+import com.rexen.crm.beans.UserRole;
+import com.rex.crm.util.Configuration;
+
+
+/**
+ * @author Feiyun Zhou
+ */
+public class ContactPage extends TemplatePage
+{
+
+ private String search_target = "";
+ /**
+ * Constructor
+ */
+ public ContactPage()
+ {
+ initPage(null,null);
+
+ }
+
+ public ContactPage(Map filter,List tdata)
+ {
+
+ initPage(filter,tdata);
+
+ }
+ public ContactPage(List tdata)
+ {
+
+ initPage(null,tdata);
+
+ }
+
+ public ContactPage(Map map){
+ initPage(map,null);
+ }
+
+ private void initPage(final Map filter,List tdata){
+ Map entities = Configuration.getEntityTable();
+ final Entity entity = entities.get("contact");
+ setPageTitle(entity.getDisplay());
+ //List mapList = DAOImpl.queryEntityList(entity.getSql(), 0, 1000);
+ //TODO get userId from request's session
+ final String posId = ((SignIn2Session)getSession()).getPositionId();
+ final int roleId = ((SignIn2Session)getSession()).getRoleId();
+
+ Form form = new Form("form"){
+
+ @Override
+ protected void onSubmit() {
+ String sql = entity.getSql();
+ switch(roleId){
+ case UserRole.USER_ROLE_ADMINISTRATOR:
+ sql = entity.getSqlAdmin();
+ break;
+ case UserRole.USER_ROLE_MANAGER:
+ sql = entity.getSqlManager();
+ break;
+ case UserRole.USER_ROLE_SALES:
+ sql = entity.getSql();
+ break;
+ }
+
+ search_target = (search_target==null || search_target.equalsIgnoreCase("*"))? "":search_target;
+
+ List searchableFields = entity.getSearchableFields();
+ String joint = " like '%"+search_target+"%'";
+ String likequery = "";
+ for(Field sf:searchableFields){
+ likequery = likequery + " OR "+ sf.getName() + joint;
+ }
+ sql = sql + " where name like '%"+search_target+"%' " + likequery;
+ System.out.println("TEST:"+sql);
+ List datalist = null;
+
+ switch(roleId){
+ case UserRole.USER_ROLE_ADMINISTRATOR:
+ datalist = DAOImpl.queryEntityRelationList(sql);
+ break;
+ case UserRole.USER_ROLE_MANAGER:
+ datalist = DAOImpl.queryEntityRelationList(sql, posId);
+ break;
+ case UserRole.USER_ROLE_SALES:
+ datalist = DAOImpl.queryEntityRelationList(sql, posId);
+ }
+ setResponsePage(new ContactPage(filter,datalist));
+
+ }
+
+ };
+ add(form);
+
+ TextField search_input = new TextField("search_input", new PropertyModel(this,"search_target"));
+ form.add(search_input);
+ form.add(new Link("ad_search_link"){
+ @Override
+ public void onClick() {
+ setResponsePage(new AdvancedSearchPage(entity.getName(),null));
+
+ }
+
+} );
+ String sql = entity.getSql();
+ switch(roleId){
+ case UserRole.USER_ROLE_ADMINISTRATOR:
+ sql = entity.getSqlAdmin();
+ break;
+ case UserRole.USER_ROLE_MANAGER:
+ sql = entity.getSqlManager();
+ break;
+ case UserRole.USER_ROLE_SALES:
+ sql = entity.getSql();
+ break;
+ }
+ if (tdata == null || tdata.size() == 0) {
+
+
+
+ if (filter == null) {
+
+ switch(roleId){
+ case UserRole.USER_ROLE_ADMINISTRATOR:
+ tdata = DAOImpl.queryEntityRelationList(sql);
+ break;
+ case UserRole.USER_ROLE_MANAGER:
+ tdata = DAOImpl.queryEntityRelationList(sql, posId);
+ break;
+ case UserRole.USER_ROLE_SALES:
+ tdata = DAOImpl.queryEntityRelationList(sql, posId);
+ }
+
+
+ } else {
+
+ List ft = Lists.newArrayList();
+ for (String k : filter.keySet()) {
+ if (filter.get(k))
+ ft.add(k);
+ }
+ switch(roleId){
+ case UserRole.USER_ROLE_ADMINISTRATOR:
+ tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft);
+ break;
+ case UserRole.USER_ROLE_MANAGER:
+ tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft, posId);
+ break;
+ case UserRole.USER_ROLE_SALES:
+ tdata =DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft, posId);
+ }
+
+ }
+ }
+ add(new PageableTablePanel("datalist",entity,tdata,null));
+
+
+ List choices = DAOImpl.queryPickList(entity.getFieldByName(entity.getFilterField()).getPicklist());
+
+ add(new FilterPanel("filterPanel",choices ,filter,ContactPage.class,entity));
+
+ }
+}
\ No newline at end of file
diff --git a/crm/src/main/java/com/rex/crm/CreateEventPage.html b/crm/src/main/java/com/rex/crm/CreateEventPage.html
new file mode 100755
index 0000000..6c72672
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/CreateEventPage.html
@@ -0,0 +1,379 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/crm/src/main/java/com/rex/crm/CreateEventPage.java b/crm/src/main/java/com/rex/crm/CreateEventPage.java
new file mode 100644
index 0000000..7bc483a
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/CreateEventPage.java
@@ -0,0 +1,377 @@
+package com.rex.crm;
+
+import java.io.Serializable;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.behavior.AttributeAppender;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.HiddenField;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+import org.apache.wicket.markup.html.form.Radio;
+import org.apache.wicket.markup.html.form.RadioGroup;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+import org.apache.wicket.markup.html.list.AbstractItem;
+import org.apache.wicket.markup.repeater.RepeatingView;
+import org.apache.wicket.model.AbstractReadOnlyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.util.string.StringValue;
+
+import com.rex.crm.beans.CRMUser;
+import com.rex.crm.beans.Choice;
+import com.rex.crm.beans.UserInfo;
+import com.rex.crm.common.Entity;
+import com.rex.crm.db.DAOImpl;
+import com.rex.crm.util.Configuration;
+
+/**
+ * @author Feiyun Zhou
+ */
+public class CreateEventPage extends TemplatePage {
+
+ private static final Logger logger = Logger.getLogger(CreateEventPage.class);
+ public Date startDate;
+ protected String endDate;
+ protected String endTime;
+ protected String startTime;
+ protected String contact_select;
+ protected String hidden_contact_select;
+ protected String hidden_select_user;
+ protected Choice visiting_purpose = new Choice(1L, "");
+ protected Choice feature_product = new Choice(1L, "");
+ protected Choice activity_type = new Choice(1L, "");
+ protected Choice selected_event_type = new Choice(1L, "拜访");
+ protected String act_title_input = "";
+ protected Integer event_type = 1;
+ protected String selected_user = "";
+ protected String status = "计划中"; /*new Choice(1L,"计划中");*/
+ protected String location = "";
+ protected int total_score;
+ protected Choice planing = new Choice(0L, "");
+ protected Choice openling = new Choice(0L, "");
+ protected Choice enquery_listening = new Choice(0L, "");
+ protected Choice deliverable = new Choice(0L, "");
+ protected Choice objection_handing = new Choice(0L, "");
+ protected Choice summary = new Choice(0L, "");
+ protected String owner = "";
+ protected String whenadded = "";
+ protected String crmuserId = "";
+ /**
+ * Constructor
+ */
+ public CreateEventPage() {
+ initPage(0);
+ }
+
+ public CreateEventPage(int type) {
+ initPage(type);
+ }
+
+ public void initPage(final int type) {
+ Map entities = Configuration.getEntityTable();
+ Entity entity = entities.get("activity");
+ setPageTitle(entity.getDisplay());
+ final String posId = ((SignIn2Session) getSession()).getPositionId();
+ final String user = ((SignIn2Session) getSession()).getUser();
+ final String userId = ((SignIn2Session) getSession()).getUserId();
+ final int roleId = ((SignIn2Session) getSession()).getRoleId();
+ CRMUser crmUser = DAOImpl.getCRMUserInfoById(Integer.parseInt(posId));
+ final String crmUserName = crmUser.getName();
+ //add prompt
+ final RepeatingView div = new RepeatingView("promptDiv");
+ final AbstractItem divitem = new AbstractItem(div.newChildId());
+ final Label promptButton = new Label("promptButton","X");
+ divitem.add(promptButton);
+ final Label promptLabel = new Label("prompt","红色字体字段为必填项,请输入!");
+ divitem.add(promptLabel);
+ div.add(new AttributeAppender("style",new Model("display:none"),";"));
+ divitem.add(new AttributeAppender("style",new Model("display:none"),";"));
+ div.add(divitem);
+ add(div);
+ //set event type
+ RadioGroup event_type_group = new RadioGroup("event_type_group", new PropertyModel(this, "event_type"));
+ final Radio callRadio = new Radio("radio1", new Model(1L));
+ event_type_group.add(callRadio);
+ final Radio coachingRadio = new Radio("radio2", new Model(2L));
+ if (roleId == 3) {
+ coachingRadio.add(new AttributeAppender("disabled", "true"));
+ }
+ final AttributeModifier redioModifier = new AttributeModifier("checked","checked");
+ //辅导名称拼接字段
+ final StringBuffer concahName = new StringBuffer();
+ Form form = new Form("form") {
+ @Override
+ protected void onSubmit() {
+ logger.debug("this form was submitted!");
+ String sd = getRequest().getPostParameters().getParameterValue("start_date").toString();
+ String ed = getRequest().getPostParameters().getParameterValue("end_date").toString();
+ String visit_type = String.valueOf(activity_type);
+ logger.debug("opening:" + String.valueOf(openling.getId()));
+ SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
+ String sdt = sd;
+ String edt = ed;
+ int contactId = 0;
+ int coacheeId = 0;
+ Date startdt = null;
+ Date enddt = null;
+ boolean flag = true;
+ try {
+ startdt = dateformat.parse(sdt);
+ enddt = dateformat.parse(edt);
+ } catch (ParseException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ if(event_type==1){
+ if (null == hidden_contact_select) {
+ contactId = 0;
+ div.add(new AttributeAppender("style",new Model("display:block"),";"));
+ divitem.add(new AttributeAppender("style",new Model("display:block"),";"));
+ promptLabel.add(new AttributeAppender("style",new Model("display:block"),";"));
+ promptButton.add(new AttributeAppender("style",new Model("display:block"),";"));
+ callRadio.add(redioModifier);
+ coachingRadio.add(redioModifier.remove("checked"));
+ flag = false;
+ } else {
+ contactId = Integer.parseInt(hidden_contact_select);
+ }
+ }else{
+ if(null==hidden_select_user){
+ coacheeId = 0;
+ div.add(new AttributeAppender("style",new Model("display:block"),";"));
+ divitem.add(new AttributeAppender("style",new Model("display:block"),";"));
+ promptLabel.add(new AttributeAppender("style",new Model("display:block"),";"));
+ promptButton.add(new AttributeAppender("style",new Model("display:block"),";"));
+ coachingRadio.add(redioModifier);
+ callRadio.add(redioModifier.remove("checked"));
+ flag = false;
+ }else{
+ coacheeId = Integer.parseInt(hidden_select_user);
+ }
+ }
+ if(flag){
+ if (null == act_title_input) {
+ if (event_type == 1) {
+ concahName.append("拜访:");
+ //根据医生Id获取医生对象
+ act_title_input = concahName.append(DAOImpl.getContactById(contactId).getName()).toString();
+ } else {
+ concahName.append(crmUserName);
+ concahName.append(sd);
+ concahName.append("拜访辅导");
+ act_title_input = concahName.toString();
+
+ }
+ }
+ try {
+ int crmuserId = 0;
+ String participants = user;
+ if (event_type == 1) {
+ //visiting
+ crmuserId = Integer.parseInt(posId);
+ } else if (event_type == 2) {
+ //coaching
+ crmuserId = Integer.parseInt(posId);;
+ participants = participants + ", " + selected_user;
+ contactId = -1;
+ concahName.append("拜访辅导");
+ visiting_purpose = new Choice(8L, "");
+ }
+ System.out.println("拜访类型:"+String.valueOf(visiting_purpose.getId()));
+ //insert the event, and return the generated id of the event
+ long generatedkey = DAOImpl.addCalendarEventForCoach(crmuserId, contactId, String.valueOf(activity_type.getId()),
+ act_title_input, String.valueOf(startdt.getTime() / 1000),
+ String.valueOf(enddt.getTime() / 1000), 1, user, user, user,
+ String.valueOf(visiting_purpose.getId()),
+ String.valueOf(feature_product.getId()), event_type.intValue(), participants,
+ coacheeId, location, total_score, String.valueOf(planing.getId()), String.valueOf(openling.getId()), String.valueOf(enquery_listening.getId()), String.valueOf(deliverable.getId()), String.valueOf(objection_handing.getId()), String.valueOf(summary.getId()));
+ logger.debug("generatedkey:" + generatedkey);
+ if (generatedkey > 0) {
+ if (event_type == 1) {
+ //if it is a visiting, we only send this event to the owner;
+ DAOImpl.insert2UserRelationTable("activity",userId, posId ,String.valueOf(coacheeId),String.valueOf(generatedkey));
+ } else if (event_type == 2) {
+ //if it is a coaching, we need send this event to the manager and sales
+ //add new record for the manager
+ logger.debug("key:" + String.valueOf(generatedkey));
+ DAOImpl.insert2UserRelationTable("activity",userId, posId,String.valueOf(coacheeId), String.valueOf(generatedkey));
+ //add new record for the sales
+ DAOImpl.insert2UserRelationTable("activity", userId,hidden_select_user,String.valueOf(coacheeId), String.valueOf(generatedkey));
+ }
+ }
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ if (type == 0) {
+ setResponsePage(PageFactory.createPage("calendar"));
+ } else {
+ setResponsePage(new ActivityPage());
+ }
+ }
+
+ }
+ };
+ add(form);
+ //辅导者
+ TextField coach = new TextField("crmuserId", new PropertyModel(this, "crmuserId"));
+ coach.add(new AttributeModifier("value", crmUser.getName()));
+ form.add(coach);
+ //创建人
+ TextField owner = new TextField("owner", new PropertyModel(this, "owner"));
+ owner.add(new AttributeModifier("value", crmUser.getName()));
+ form.add(owner);
+ //创建时间
+ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
+ TextField whenadded = new TextField("whenadded", new PropertyModel(this, "whenadded"));
+ whenadded.add(new AttributeModifier("value", df.format(new Date())));
+ form.add(whenadded);
+ //状态默认为计划中
+ TextField status = new TextField("status", new PropertyModel(this, "status"));
+ form.add(status);
+ //计划地点
+ TextField location = new TextField("location", new PropertyModel(this, "location"));
+ form.add(location);
+ //分数
+ TextField total_score = new TextField("total_score", new PropertyModel(this, "total_score"));
+ form.add(total_score);
+ StringValue startdateValue = this.getRequest().getRequestParameters().getParameterValue("startdate");
+
+ String startdate = null;
+ long current = System.currentTimeMillis();
+ Date current_date_time = new Date(current);
+ SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
+ //set default time to current time
+ if (startdateValue != null && !startdateValue.isEmpty() && !startdateValue.isNull()) {
+ startdate = startdateValue.toString();
+ } else {
+ startdate = dateformat.format(current_date_time);
+ }
+ SimpleDateFormat timeformatter = new SimpleDateFormat("HH:mm");
+ WebMarkupContainer start_date_input = new WebMarkupContainer("start_date_input");
+ form.add(start_date_input);
+ start_date_input.add(new AttributeModifier("value", startdate.substring(0, 10) + "T" + timeformatter.format(current_date_time)));
+ SimpleDateFormat dateformat2 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
+ Date sDate = current_date_time;
+ try {
+ sDate = dateformat2.parse(startdate + "T" + timeformatter.format(current_date_time));
+ } catch (ParseException e) {
+ logger.warn("failed to parse date:", e);
+ }
+ Date next_date_time = new Date(sDate.getTime() + 3600 * 1000);
+ WebMarkupContainer end_date_input = new WebMarkupContainer("end_date_input");
+ form.add(end_date_input);
+ end_date_input.add(new AttributeModifier("value", dateformat.format(next_date_time)));
+// PopupSettings popupSettings = new PopupSettings("查找").setLeft(150).setTop(200);
+ form.add(new BookmarkablePageLink("search_btn", SearchContactPage.class));
+ form.add(new HiddenField("hidden_contact_select", new PropertyModel(this, "hidden_contact_select")));
+ form.add(new TextField("contact_select", new Model("")));
+ PageParameters params = new PageParameters();
+ params.set("mid", posId);
+ form.add(new BookmarkablePageLink("search_user_btn", SelectCRMUserPage.class, params));
+ form.add(new HiddenField("hidden_select_user", new PropertyModel(this, "hidden_select_user")));
+ form.add(new TextField("selected_user", new PropertyModel(this, "selected_user")));
+ IModel visiting_purpose_choices_model = new AbstractReadOnlyModel() {
+ @Override
+ public List getObject() {
+ List choices = new ArrayList();
+ return DAOImpl.queryPickListByFilter("activity_visiting_purpose_pl", "activity_type", String.valueOf(activity_type.getId()));
+ }
+ };
+ //visiting purpose choice
+ final DropDownChoice visiting_purpose_choice = createDropDownListFromPickList("visiting_purpose_input", "com_visiting_purpose_pl", visiting_purpose_choices_model, new PropertyModel(this, "visiting_purpose"));
+ visiting_purpose_choice.setOutputMarkupId(true);
+ form.add(visiting_purpose_choice);
+ //event type choice
+ DropDownChoice activity_type_choice = createDropDownListFromPickList("activity_type_input", "activity_activity_types_pl", null, new PropertyModel(this, "activity_type"));
+ activity_type_choice.setOutputMarkupId(true);
+ form.add(activity_type_choice);
+ activity_type_choice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected void onUpdate(AjaxRequestTarget target) {
+ target.add(visiting_purpose_choice);
+ }
+ });
+
+ event_type_group.add(coachingRadio);
+ form.add(event_type_group);
+ form.add(createDropDownListFromPickList("feature_product_input", "activity_feature_product_pl", null, new PropertyModel(this, "feature_product")));
+ form.add(createDropDownListFromPickList("planing_input", "score1_pl", null, new PropertyModel(this, "planing")));
+ form.add(createDropDownListFromPickList("openling_input", "score1_pl", null, new PropertyModel(this, "openling")));
+ form.add(createDropDownListFromPickList("enquery_listening_input", "score1_pl", null, new PropertyModel(this, "enquery_listening")));
+ form.add(createDropDownListFromPickList("deliverable_input", "score2_pl", null, new PropertyModel(this, "deliverable")));
+ form.add(createDropDownListFromPickList("objection_handing_input", "score1_pl", null, new PropertyModel(this, "objection_handing")));
+ form.add(createDropDownListFromPickList("summary_input", "score2_pl", null, new PropertyModel(this, "summary")));
+ form.add(new TextField("act_title_input", new PropertyModel(this, "act_title_input")));
+ //拜访辅导。辅导者,状态,
+ }
+
+ private DropDownChoice createDropDownListFromPickList(String markupId, String picklistName, IModel choices, PropertyModel default_model) {
+ if (choices == null) {
+ choices = Model.ofList(DAOImpl.queryPickList(picklistName));
+ }
+ return new DropDownChoice(markupId, default_model, choices,
+ new IChoiceRenderer() {
+ @Override
+ public Object getDisplayValue(Choice choice) {
+ // TODO Auto-generated method stub
+ return choice.getVal();
+ }
+
+ @Override
+ public String getIdValue(Choice choice, int index) {
+ // TODO Auto-generated method stub
+ return String.valueOf(choice.getId());
+ }
+ });
+ }
+
+ class SelectOption implements Serializable {
+
+ private int key;
+ private String value;
+
+ public SelectOption(int key, String value) {
+ this.key = key;
+ this.value = value;
+ }
+
+ public SelectOption() {
+ }
+
+ public int getKey() {
+ return key;
+ }
+
+ public void setKey(int key) {
+ this.key = key;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+ }
+}
diff --git a/crm/src/main/java/com/rex/crm/DataManagement.html b/crm/src/main/java/com/rex/crm/DataManagement.html
new file mode 100644
index 0000000..3ca3587
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/DataManagement.html
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ data table
+
+
+
+
+
+
+
diff --git a/crm/src/main/java/com/rex/crm/DataManagement.java b/crm/src/main/java/com/rex/crm/DataManagement.java
new file mode 100644
index 0000000..cbdbd02
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/DataManagement.java
@@ -0,0 +1,102 @@
+package com.rex.crm;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang3.tuple.Pair;
+
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextField;
+
+import org.apache.wicket.model.PropertyModel;
+
+import com.google.common.collect.Lists;
+
+import com.rex.crm.common.Entity;
+
+import com.rex.crm.common.Field;
+import com.rex.crm.common.FilterPanel;
+import com.rex.crm.common.PageableTablePanel;
+
+import com.rex.crm.db.DAOImpl;
+import com.rexen.crm.beans.UserRole;
+import com.rex.crm.util.Configuration;
+
+
+/**
+ * @author Feiyun Zhou
+ */
+public class DataManagement extends TemplatePage
+{
+ private String search_target = "";
+ public DataManagement(){
+ init(null,null);
+ }
+ public DataManagement(final Map filter,List tdata){
+ init(filter,tdata);
+ }
+
+ public void init(final Map filter,List tdata)
+ {
+ Map entities = Configuration.getEntityTable();
+ final Entity entity = entities.get("data_exchange_teample");
+ setPageTitle(entity.getDisplay());
+ //List mapList = DAOImpl.queryEntityList(entity.getSql(), 0, 1000);
+ //TODO get userId from request's session
+ final String userId = ((SignIn2Session)getSession()).getUserId();
+ final int roleId = ((SignIn2Session)getSession()).getRoleId();
+
+
+// Form form = new Form("form"){
+//
+// @Override
+// protected void onSubmit() {
+//
+// String sql = entity.getSql();
+//
+// search_target = (search_target==null || search_target.equalsIgnoreCase("*"))? "":search_target;
+//
+// //sql = sql + " where title like '%"+search_target+"%'";
+// List searchableFields = entity.getSearchableFields();
+// String joint = " like '%"+search_target+"%'";
+// String likequery = "";
+// for(Field sf:searchableFields){
+// likequery = likequery + " OR "+ sf.getName() + joint;
+// }
+// sql = sql + " where title like '%"+search_target+"%' " + likequery;
+// List datalist = null;
+// datalist = DAOImpl.queryEntityRelationList(sql);
+// setResponsePage(new DataManagement(filter,datalist));
+// }
+//
+// };
+// add(form);
+
+// TextField search_input = new TextField("search_input", new PropertyModel(this,"search_target"));
+// form.add(search_input);
+ String sql = entity.getSql();
+ if(tdata == null || tdata.size() == 0){
+
+ if(filter == null){
+ tdata = DAOImpl.queryEntityRelationList(sql);
+ }
+ else{
+ List ft = Lists.newArrayList();
+ for (String k : filter.keySet()) {
+ if(filter.get(k)) ft.add(k);
+ }
+
+ tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft);
+ }
+
+ }
+ add(new PageableTablePanel("datalist",entity,tdata,null));
+
+
+// //for the side bar
+// List>> types = null;
+// types = DAOImpl.queryFilters(sql, entity.getFilterField(), entity.getFieldByName(entity.getFilterField()).getPicklist());
+// add(new FilterPanel("filterPanel",types ,filter,DataManagement.class));
+
+ }
+}
\ No newline at end of file
diff --git a/crm/src/main/java/com/rex/crm/EventCoachEditorPage.html b/crm/src/main/java/com/rex/crm/EventCoachEditorPage.html
new file mode 100644
index 0000000..4fa99bd
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/EventCoachEditorPage.html
@@ -0,0 +1,276 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/crm/src/main/java/com/rex/crm/EventCoachEditorPage.java b/crm/src/main/java/com/rex/crm/EventCoachEditorPage.java
new file mode 100644
index 0000000..71936ae
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/EventCoachEditorPage.java
@@ -0,0 +1,315 @@
+package com.rex.crm;
+
+import java.io.Serializable;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.behavior.AttributeAppender;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.HiddenField;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+import org.apache.wicket.markup.html.link.PopupSettings;
+import org.apache.wicket.markup.html.list.AbstractItem;
+import org.apache.wicket.markup.repeater.RepeatingView;
+import org.apache.wicket.model.AbstractReadOnlyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.util.string.StringValue;
+
+import com.rex.crm.beans.CRMUser;
+import com.rex.crm.beans.Choice;
+import com.rex.crm.beans.UserInfo;
+import com.rex.crm.common.Entity;
+import com.rex.crm.db.DAOImpl;
+import com.rex.crm.util.Configuration;
+
+public class EventCoachEditorPage extends TemplatePage{
+ private static final Logger logger = Logger.getLogger(EventCoachEditorPage.class);
+ public Date startDate;
+ protected String endDate;
+ protected String endTime;
+ protected String startTime;
+ protected String crmuserId = "";
+ protected String location = "";
+ protected int total_score;
+ protected Choice planing = new Choice(0L,"");
+ protected Choice openling = new Choice(0L,"");
+ protected Choice enquery_listening = new Choice(0L,"");
+ protected Choice deliverable = new Choice(0L,"");
+ protected Choice objection_handing = new Choice(0L,"");
+ protected Choice summary = new Choice(0L,"");
+ protected String owner = "";
+ protected String whenadded = "";
+ protected String modifier = "";
+ protected String modifier_time = "";
+ protected String act_name_input = "";
+ protected String selected_user = "";
+ protected Choice feature_product = new Choice(1L, "");
+ protected String status = "计划中";
+ protected String hidden_select_user;
+ /**
+ * Constructor
+ */
+ public EventCoachEditorPage(final long eventId) {
+ Map entities = Configuration.getEntityTable();
+ Entity entity = entities.get("activity");
+ setPageTitle(entity.getDisplay());
+ final String posId = ((SignIn2Session) getSession()).getPositionId();
+ final String user = ((SignIn2Session) getSession()).getUser();
+ CRMUser crmUser = DAOImpl.getCRMUserInfoById(Integer.parseInt(posId));
+ Map entity_data = DAOImpl.queryEntityById(entity.getSql_ent(),String.valueOf(eventId));
+ //add prompt
+ final RepeatingView div = new RepeatingView("promptDiv");
+ final AbstractItem divitem = new AbstractItem(div.newChildId());
+ final Label promptButton = new Label("promptButton","X");
+ divitem.add(promptButton);
+ final Label promptLabel = new Label("prompt","红色输入框为必填项,请输入!");
+ divitem.add(promptLabel);
+ div.add(new AttributeAppender("style",new Model("display:none"),";"));
+ divitem.add(new AttributeAppender("style",new Model("display:none"),";"));
+ div.add(divitem);
+ add(div);
+ //辅导名称拼接字段
+ final String crmuserName = crmUser.getName();
+ final StringBuffer concahName = new StringBuffer();
+ Form form = new Form("form") {
+ @Override
+ protected void onSubmit() {
+ String sd = getRequest().getPostParameters()
+ .getParameterValue("start_date").toString();
+ String ed = getRequest().getPostParameters()
+ .getParameterValue("end_date").toString();
+ String visit_type = String.valueOf(2);
+ SimpleDateFormat dateformat = new SimpleDateFormat(
+ "yyyy-MM-dd'T'HH:mm");
+ Date act_endtime = new Date(System.currentTimeMillis());
+ String sdt = sd;
+ String edt = ed;
+ Date startdt = null;
+ Date enddt = null;
+ int coachId = 0;
+ try {
+ startdt = dateformat.parse(sdt);
+ enddt = dateformat.parse(edt);
+ } catch (ParseException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ if(null==act_name_input){
+ concahName.append(crmuserName);
+ concahName.append(sd);
+ concahName.append("拜访辅导");
+ act_name_input = concahName.toString();
+ }
+ if(null==hidden_select_user){
+ coachId = 0;
+ }else{
+ coachId = Integer.parseInt(hidden_select_user);
+ }
+ boolean flag = true;
+ //验证字段是否为空如果为空则做页面提示
+ if(coachId==0){
+ div.add(new AttributeAppender("style",new Model("display:block"),";"));
+ divitem.add(new AttributeAppender("style",new Model("display:block"),";"));
+ promptLabel.add(new AttributeAppender("style",new Model("display:block"),";"));
+ promptButton.add(new AttributeAppender("style",new Model("display:block"),";"));
+ flag = false;
+ }
+ if(flag){
+ try {
+ DAOImpl.updateCalendarEventForCoach(String.valueOf(eventId),hidden_select_user,
+ String.valueOf(startdt.getTime() / 1000),
+ String.valueOf(enddt.getTime() / 1000),user,coachId,location,total_score,String.valueOf(planing.getId()),String.valueOf(openling.getId()),String.valueOf(enquery_listening.getId()),String.valueOf(deliverable.getId()),String.valueOf(objection_handing.getId()),String.valueOf(summary.getId()),act_name_input);
+
+ } catch (NumberFormatException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ setResponsePage(PageFactory.createPage("calendar"));
+ }
+ }
+ };
+ add(form);
+
+ StringValue startdateValue = this.getRequest().getRequestParameters()
+ .getParameterValue("startdate");
+
+ SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
+ Date startDate = new Date(
+ ((Number) entity_data.get("starttime")).longValue());
+ String startdate = dateformat.format(startDate);
+
+ logger.debug("startdate:" + startdate);
+
+ WebMarkupContainer start_date_input = new WebMarkupContainer(
+ "start_date_input");
+ form.add(start_date_input);
+ start_date_input.add(new AttributeModifier("value", startdate));
+ Date endDate = new Date(
+ ((Number) entity_data.get("endtime")).longValue());
+ WebMarkupContainer end_date_input = new WebMarkupContainer(
+ "end_date_input");
+ form.add(end_date_input);
+ end_date_input.add(new AttributeModifier("value", dateformat
+ .format(endDate)));
+ feature_product.setId(((Number) entity_data.get("feature_product"))
+ .longValue());
+ form.add(createDropDownListFromPickList("feature_product",
+ "activity_feature_product_pl", null, new PropertyModel(this,
+ "feature_product")));
+ //辅导者
+ //获取辅导者对象
+ CRMUser crmuser = DAOImpl.getCrmUserById((int) entity_data.get("crmuserId"));
+ crmuserId = crmuser.getName();
+ form.add(new TextField("crmuserId", new PropertyModel(this,
+ "crmuserId")));
+
+
+ hidden_select_user = String.valueOf(entity_data.get("crmuserId"));
+ form.add(new HiddenField("hidden_select_user",
+ new PropertyModel(this, "hidden_select_user")));
+ //被辅导者
+ int selected_userId = (int)entity_data.get("coacheeId");
+ selected_user = DAOImpl.getCrmUserById(selected_userId).getName();
+ form.add(new TextField("selected_user" ,new PropertyModel(this,"selected_user")));
+
+
+ PopupSettings popupSettings = new PopupSettings("查找").setHeight(470)
+ .setWidth(850).setLeft(150).setTop(200);
+ PageParameters params = new PageParameters();
+ params.set("mid", posId);
+ form.add(new BookmarkablePageLink("search_user_btn", SelectCRMUserPage.class,params ).setPopupSettings(popupSettings));
+ //form.add(new HiddenField("hidden_select_user" ,new PropertyModel(this,"hidden_select_user")));
+ //地址
+ location = (String)entity_data.get("location");
+ form.add(new TextField("location", new PropertyModel(this,
+ "location")));
+ //评分一系列分数
+ total_score = (int)entity_data.get("total_score");
+ form.add(new TextField("total_score", new PropertyModel(this,
+ "total_score")));
+
+ planing.setId(((Number) entity_data.get("planing"))
+ .longValue());
+ form.add(createDropDownListFromPickList("planing_input",
+ "score1_pl", null, new PropertyModel(this,
+ "planing")));
+ openling.setId(((Number) entity_data.get("openling"))
+ .longValue());
+ form.add(createDropDownListFromPickList("openling_input",
+ "score1_pl", null, new PropertyModel(this,
+ "openling")));
+ enquery_listening.setId(((Number) entity_data.get("enquery_listening"))
+ .longValue());
+ form.add(createDropDownListFromPickList("enquery_listening_input",
+ "score1_pl", null, new PropertyModel(this,
+ "enquery_listening")));
+ deliverable.setId(((Number) entity_data.get("deliverable"))
+ .longValue());
+ form.add(createDropDownListFromPickList("deliverable_input",
+ "score2_pl", null, new PropertyModel(this,
+ "deliverable")));
+ objection_handing.setId(((Number) entity_data.get("objection_handing"))
+ .longValue());
+ form.add(createDropDownListFromPickList("objection_handing_input",
+ "score2_pl", null, new PropertyModel(this,
+ "objection_handing")));
+ summary.setId(((Number) entity_data.get("summary"))
+ .longValue());
+ form.add(createDropDownListFromPickList("summary_input",
+ "score2_pl", null, new PropertyModel(this,
+ "summary")));
+ owner = (String) entity_data.get("owner");
+ form.add(new TextField("owner", new PropertyModel(this,
+ "owner")));
+ Date createTime = (Date)entity_data.get("whenadded");
+ whenadded = createTime.toString();
+ form.add(new TextField("whenadded", new PropertyModel(this,
+ "whenadded")));
+ act_name_input = (String) entity_data.get("title");
+
+ form.add(new TextField("act_name_input", new PropertyModel(this,
+ "act_name_input")));
+ TextField modifier = new TextField("modifier", new PropertyModel(this,"modifier"));
+ modifier.add(new AttributeModifier("value",crmUser.getName()));
+ form.add(modifier);
+ //创建时间
+ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
+ TextField modifier_time = new TextField("modifier_time", new PropertyModel(this,"modifier_time"));
+ modifier_time.add(new AttributeModifier("value",df.format(new Date())));
+ form.add(modifier_time);
+ TextField statusField = new TextField("status", new PropertyModel(this,"status"));
+ form.add(statusField);
+ }
+ private DropDownChoice createDropDownListFromPickList(String markupId,
+ String picklistName, IModel choices, PropertyModel default_model) {
+
+ if (choices == null) {
+ choices = Model.ofList(DAOImpl.queryPickList(picklistName));
+ }
+
+ return new DropDownChoice(markupId, default_model, choices,
+ new IChoiceRenderer() {
+
+ @Override
+ public Object getDisplayValue(Choice choice) {
+ // TODO Auto-generated method stub
+ return choice.getVal();
+ }
+
+ @Override
+ public String getIdValue(Choice choice, int index) {
+ // TODO Auto-generated method stub
+ return String.valueOf(choice.getId());
+ }
+
+ });
+ }
+ class SelectOption implements Serializable {
+ private int key;
+ private String value;
+
+ public SelectOption(int key, String value) {
+ this.key = key;
+ this.value = value;
+ }
+
+ public SelectOption() {
+
+ }
+
+ public int getKey() {
+ return key;
+ }
+
+ public void setKey(int key) {
+ this.key = key;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+ }
+}
diff --git a/crm/src/main/java/com/rex/crm/EventEditorPage.html b/crm/src/main/java/com/rex/crm/EventEditorPage.html
new file mode 100755
index 0000000..9b285bf
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/EventEditorPage.html
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/crm/src/main/java/com/rex/crm/EventEditorPage.java b/crm/src/main/java/com/rex/crm/EventEditorPage.java
new file mode 100644
index 0000000..55cce22
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/EventEditorPage.java
@@ -0,0 +1,292 @@
+package com.rex.crm;
+
+import java.io.Serializable;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+
+import org.apache.log4j.Logger;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.Component;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.behavior.AttributeAppender;
+import org.apache.wicket.extensions.markup.html.form.DateTextField;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.ChoiceRenderer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.HiddenField;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+import org.apache.wicket.markup.html.link.PopupSettings;
+import org.apache.wicket.markup.html.list.AbstractItem;
+import org.apache.wicket.markup.repeater.RepeatingView;
+import org.apache.wicket.model.AbstractReadOnlyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.util.string.StringValue;
+import org.apache.wicket.util.template.PackageTextTemplate;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.rex.crm.beans.Account;
+import com.rex.crm.beans.Choice;
+import com.rex.crm.beans.Contact;
+import com.rex.crm.common.Entity;
+import com.rex.crm.db.DAOImpl;
+import com.rex.crm.util.Configuration;
+
+/**
+ * @author Feiyun Zhou
+ */
+public class EventEditorPage extends TemplatePage {
+
+ private static final Logger logger = Logger
+ .getLogger(EventEditorPage.class);
+ public Date startDate;
+ protected String endDate;
+ protected String endTime;
+ protected String startTime;
+ protected String hidden_contact_select;
+ protected String contact_name;
+ protected Choice visiting_purpose = new Choice(1L, "");
+ protected Choice feature_product = new Choice(1L, "");
+ ;
+ protected Choice activity_type = new Choice(1L, "");
+ ;
+ protected String act_title_input = "";
+
+ /**
+ * Constructor
+ */
+ public EventEditorPage(final long eventId) {
+
+ Map entities = Configuration.getEntityTable();
+ final Entity entity = entities.get("activity");
+ setPageTitle(entity.getDisplay());
+ //final String posId = ((SignIn2Session) getSession()).getPositionId();
+ final String user = ((SignIn2Session) getSession()).getUser();
+
+ Map entity_data = DAOImpl.queryEntityById(entity.getSql_ent(),
+ String.valueOf(eventId));
+ //add prompt
+ final RepeatingView div = new RepeatingView("promptDiv");
+ final AbstractItem divitem = new AbstractItem(div.newChildId());
+ final Label promptButton = new Label("promptButton","X");
+ divitem.add(promptButton);
+ final Label promptLabel = new Label("prompt","红色输入框为必填项,请输入!");
+ divitem.add(promptLabel);
+ div.add(new AttributeAppender("style",new Model("display:none"),";"));
+ divitem.add(new AttributeAppender("style",new Model("display:none"),";"));
+ div.add(divitem);
+ add(div);
+ Form form = new Form("form") {
+ @Override
+ protected void onSubmit() {
+ logger.debug("the form was submitted!");
+
+ // logger.debug("startDate:"+ startDate);
+ String sd = getRequest().getPostParameters()
+ .getParameterValue("start_date").toString();
+ String ed = getRequest().getPostParameters()
+ .getParameterValue("end_date").toString();
+ String visit_type = String.valueOf(activity_type.getId());
+ SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
+ Date act_endtime = new Date(System.currentTimeMillis());
+ String sdt = sd;
+ String edt = ed;
+ Date startdt = null;
+ Date enddt = null;
+ int contactId = 0;
+ //标识
+ boolean flag = true;
+ try {
+ startdt = dateformat.parse(sdt);
+ enddt = dateformat.parse(edt);
+ } catch (ParseException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ logger.debug(String.format("time info %s %s", sd, ed));
+ logger.debug("contact id:" + hidden_contact_select);
+ logger.debug("visit_type:" + visit_type);
+ logger.debug("usersereaser:" + user);
+ if(null==hidden_contact_select){
+ contactId = 0;
+ }else{
+ contactId = Integer.parseInt(hidden_contact_select);
+ }
+ if(contactId==0){
+ div.add(new AttributeAppender("style",new Model("display:block"),";"));
+ divitem.add(new AttributeAppender("style",new Model("display:block"),";"));
+ promptLabel.add(new AttributeAppender("style",new Model("display:block"),";"));
+ promptButton.add(new AttributeAppender("style",new Model("display:block"),";"));
+ flag = false;
+ }
+ System.out.println("title:"+act_title_input);
+ try {
+ DAOImpl.updateCalendarEvent(String.valueOf(eventId),
+ hidden_contact_select, visit_type, act_title_input,
+ String.valueOf(startdt.getTime() / 1000),String.valueOf(enddt.getTime() / 1000), 1, user,
+ String.valueOf(visiting_purpose.getId()),
+ String.valueOf(feature_product.getId()));
+
+ } catch (NumberFormatException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ setResponsePage(new EventViewerPage(String.valueOf(eventId)));
+ }
+ };
+ add(form);
+
+ StringValue startdateValue = this.getRequest().getRequestParameters().getParameterValue("startdate");
+
+ SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd");
+ Date startDate = new Date( ((Number) entity_data.get("starttime")).longValue());
+ String startdate = dateformat.format(startDate);
+
+ logger.debug("startdate:" + startdate);
+
+ WebMarkupContainer start_date_input = new WebMarkupContainer("start_date_input");
+ // startDate = startdate;
+ // DateTextField start_date_input = new
+ // DateTextField("start_date_input", new
+ // PropertyModel(this,"startDate"));
+ form.add(start_date_input);
+ SimpleDateFormat timeformatter = new SimpleDateFormat("HH:mm");
+ start_date_input.add(new AttributeModifier("value", startdate + "T" + timeformatter.format(startDate)));
+
+ Date endDate = new Date(((Number) entity_data.get("endtime")).longValue());
+ WebMarkupContainer end_date_input = new WebMarkupContainer("end_date_input");
+ form.add(end_date_input);
+ end_date_input.add(new AttributeModifier("value", dateformat.format(endDate) + "T" + timeformatter.format(endDate)));
+
+ PopupSettings popupSettings = new PopupSettings("查找").setHeight(470)
+ .setWidth(850).setLeft(150).setTop(200);
+ form.add(new BookmarkablePageLink("search_btn",
+ SearchContactPage.class).setPopupSettings(popupSettings));
+
+ hidden_contact_select = String.valueOf(entity_data.get("contactId"));
+ form.add(new HiddenField("hidden_contact_select",
+ new PropertyModel(this, "hidden_contact_select")));
+ contact_name = String.valueOf(entity_data.get("cn"));
+ form.add(new TextField("contact_select", new PropertyModel(
+ this, "contact_name")));
+
+ IModel visiting_purpose_choices_model = new AbstractReadOnlyModel() {
+ @Override
+ public List getObject() {
+ List choices = new ArrayList();
+ return DAOImpl.queryPickListByFilter(
+ "activity_visiting_purpose_pl", "activity_type",
+ String.valueOf(activity_type.getId()));
+ }
+ };
+
+ // visiting purpose choice
+ visiting_purpose.setId(((Number) entity_data.get("visiting_purpose"))
+ .longValue());
+ final DropDownChoice visiting_purpose_choice = createDropDownListFromPickList(
+ "visiting_purpose_input", "com_visiting_purpose_pl",
+ visiting_purpose_choices_model, new PropertyModel(this,
+ "visiting_purpose"));
+ visiting_purpose_choice.setOutputMarkupId(true);
+ form.add(visiting_purpose_choice);
+
+ // event type choice
+ activity_type.setId(((Number) entity_data.get("act_type")).longValue());
+ DropDownChoice activity_type_choice = createDropDownListFromPickList(
+ "activity_type_input", "activity_activity_types_pl", null,
+ new PropertyModel(this, "activity_type"));
+ activity_type_choice.setOutputMarkupId(true);
+ form.add(activity_type_choice);
+
+ activity_type_choice.add(new AjaxFormComponentUpdatingBehavior(
+ "onchange") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected void onUpdate(AjaxRequestTarget target) {
+ target.add(visiting_purpose_choice);
+ }
+ });
+
+ feature_product.setId(((Number) entity_data.get("feature_product"))
+ .longValue());
+ form.add(createDropDownListFromPickList("feature_product_input",
+ "activity_feature_product_pl", null, new PropertyModel(this,
+ "feature_product")));
+ act_title_input = (String) entity_data.get("title");
+ form.add(new TextField("act_title_input", new PropertyModel(this,
+ "act_title_input")));
+
+ }
+
+ private DropDownChoice createDropDownListFromPickList(String markupId,
+ String picklistName, IModel choices, PropertyModel default_model) {
+
+ if (choices == null) {
+ choices = Model.ofList(DAOImpl.queryPickList(picklistName));
+ }
+
+ return new DropDownChoice(markupId, default_model, choices,
+ new IChoiceRenderer() {
+ @Override
+ public Object getDisplayValue(Choice choice) {
+ // TODO Auto-generated method stub
+ return choice.getVal();
+ }
+
+ @Override
+ public String getIdValue(Choice choice, int index) {
+ // TODO Auto-generated method stub
+ return String.valueOf(choice.getId());
+ }
+ });
+ }
+
+ class SelectOption implements Serializable {
+
+ private int key;
+ private String value;
+
+ public SelectOption(int key, String value) {
+ this.key = key;
+ this.value = value;
+ }
+
+ public SelectOption() {
+ }
+
+ public int getKey() {
+ return key;
+ }
+
+ public void setKey(int key) {
+ this.key = key;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+ }
+}
diff --git a/crm/src/main/java/com/rex/crm/EventViewerPage.html b/crm/src/main/java/com/rex/crm/EventViewerPage.html
new file mode 100755
index 0000000..2238443
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/EventViewerPage.html
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/crm/src/main/java/com/rex/crm/EventViewerPage.java b/crm/src/main/java/com/rex/crm/EventViewerPage.java
new file mode 100644
index 0000000..a1cfdca
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/EventViewerPage.java
@@ -0,0 +1,308 @@
+package com.rex.crm;
+
+import java.io.Serializable;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+
+import org.apache.log4j.Logger;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.extensions.markup.html.form.DateTextField;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.ChoiceRenderer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.HiddenField;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.util.string.StringValue;
+import org.apache.wicket.util.template.PackageTextTemplate;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.rex.crm.beans.Account;
+import com.rex.crm.beans.CalendarEvent;
+import com.rex.crm.beans.Contact;
+import com.rex.crm.common.EditDataPage;
+import com.rex.crm.common.Entity;
+import com.rex.crm.common.EntityDetailPanel;
+import com.rex.crm.db.DAOImpl;
+import com.rex.crm.util.Configuration;
+
+
+/**
+ * @author Feiyun Zhou
+ */
+public class EventViewerPage extends TemplatePage
+{
+
+ private static final Logger logger = Logger.getLogger(EventViewerPage.class);
+ public Date startDate;
+ protected String endDate;
+ protected String endTime;
+ protected String startTime;
+ protected String hidden_contact_select;
+ /**
+ * Constructor
+ */
+ public EventViewerPage()
+ {
+ System.out.println("无参数");
+ Map entities = Configuration.getEntityTable();
+ Entity entity = entities.get("activity");
+ setPageTitle(entity.getDisplay());
+ final String posId = ((SignIn2Session)getSession()).getPositionId();
+ final int roleId = ((SignIn2Session)getSession()).getRoleId();
+ StringValue eventIdValue = this.getRequest().getRequestParameters().getParameterValue("eventid");
+ //final long eventId
+ long eid = 0;
+ if(!eventIdValue.isEmpty() && !eventIdValue.isNull()){
+ eid = eventIdValue.toLong();
+ }
+ final long eventId = eid;
+ System.out.println("eventID:"+eventId);
+ Map map = DAOImpl.queryEntityById(entity.getSql_ent(), String.valueOf(eventId));
+ //if the complete and edit button visible;
+ boolean write_btn_visible = true;
+ //get the event status
+ int status = 2;
+ if(map != null){
+ Object st = map.get("act_status");
+ status = ((Number)st).intValue();
+ }
+
+ if(status == 1){
+ write_btn_visible =true;
+ }else{
+ write_btn_visible =false;
+ }
+
+ if (map != null) {
+ int eventType = ((Number) map.get("event_type")).intValue();
+ logger.debug("eventType:"+eventType);
+ if (eventType == 2 && roleId == 3) {
+ // for the sales rep, no permission to edit the coaching event
+ write_btn_visible = false;
+ }
+ }
+
+ Form form = new Form("form"){
+ @Override
+ protected void onSubmit()
+ {
+ //update status of calenderEvent mark it to be completed
+ Date act_end_datetime = new Date();
+ DAOImpl.updateStatusOfCalendarEvent((int)eventId, 2,act_end_datetime);
+ setResponsePage(PageFactory.createPage("calendar"));
+
+ }
+ };
+ add(form);
+ int eventType = 0;
+ if(map != null){
+ eventType = ((Number) map.get("event_type")).intValue();
+ logger.debug("eventType:"+eventType);
+ }
+ final int event_type = eventType;
+ System.out.println("event_type:"+eventType);
+ Link edit_event_btn = new Link("edit_event_btn") {
+ @Override
+ public void onClick() {
+ //判断活动类型
+ if(event_type==1){
+ setResponsePage(new EventEditorPage(eventId));
+ }else{
+ setResponsePage(new EventCoachEditorPage(eventId));
+ }
+
+ }
+ };
+ edit_event_btn.setVisible(write_btn_visible);
+ form.addOrReplace(edit_event_btn);
+
+ Link delete_event_btn = new Link("delete_event_btn") {
+
+ @Override
+ public void onClick() {
+ DAOImpl.deleteRecord( String.valueOf(eventId), "activity");
+ setResponsePage(PageFactory.createPage("calendar"));
+ }
+ };
+ delete_event_btn.setVisible(write_btn_visible);
+ form.addOrReplace(delete_event_btn);
+ if(map!= null){
+ //获取当前时间
+ Date currentDate = new Date();
+ logger.debug("currentDate:"+currentDate);;
+ //获取开始时间
+ Date startDate = new Date(((Number)map.get("starttime")).longValue());
+ logger.debug("startDate:"+startDate);
+ //如果两个时间比较大于0则开始时间大于当前时间
+ if(startDate.compareTo(currentDate)>0){
+ logger.debug("计划时间晚于当前时间");
+ write_btn_visible = false;
+ }
+ }
+ WebMarkupContainer complete_btn = new WebMarkupContainer("complete_btn");
+ complete_btn.setVisible(write_btn_visible);
+ form.add(complete_btn);
+
+ // List events = DAOImpl.getEventsByUserId(Integer.parseInt(uid));
+ logger.debug("eventID is:"+ eventId);
+
+ //add(new Label("name",String.valueOf(map.get("name"))));
+ add(new EntityDetailPanel("detailed",entity,map,String.valueOf(eventId),1,"calendar"));
+ }
+
+ public EventViewerPage(String id)
+ {
+ System.out.println("id:"+id);
+ Map entities = Configuration.getEntityTable();
+ final Entity entity = entities.get("activity");
+ setPageTitle(entity.getDisplay());
+ final int roleId = ((SignIn2Session)getSession()).getRoleId();
+ final int eventId = Integer.parseInt(id);
+ logger.debug("entity"+entity);
+ Map map = DAOImpl.queryEntityById(entity.getSql_ent(), String.valueOf(eventId));
+ logger.debug("entity.getSql_ent()"+entity.getSql_ent());
+ //if the complete and edit button visible;
+ boolean write_btn_visible = true;
+ //get the event status
+ int status = 2;
+
+ if(map != null){
+ Object st = map.get("act_status");
+ status = ((Number)st).intValue();
+ }
+
+ if(status == 1){
+ write_btn_visible =true;
+ }else{
+ write_btn_visible =false;
+ }
+
+ if (map != null) {
+ int eventType = ((Number) map.get("event_type")).intValue();
+ if (eventType == 2 && roleId == 3) {
+ // for the sales rep, no permission to edit the coaching event
+ write_btn_visible = false;
+ }
+ }// logger.debug("roleId" + roleId);
+
+ Form form = new Form("form"){
+ @Override
+ protected void onSubmit()
+ {
+ //update status of calenderEvent mark it to be completed
+ Date act_end_datetime = new Date();
+ DAOImpl.updateStatusOfCalendarEvent((int)eventId, 2,act_end_datetime);
+ if(entity.getName().equals("activity")){
+ setResponsePage(new ActivityPage());
+ }else{
+ setResponsePage(PageFactory.createPage("calendar"));
+ }
+ }
+ };
+ add(form);
+ int eventType = 0;
+ if(map != null){
+ eventType = ((Number) map.get("event_type")).intValue();
+ logger.debug("eventType:"+eventType);
+ }
+ final int event_type = eventType;
+ System.out.println("event_type:"+eventType);
+ Link edit_event_btn = new Link("edit_event_btn") {
+
+ @Override
+ public void onClick() {
+ if(event_type==1){
+ setResponsePage(new EventEditorPage(eventId));
+ }else{
+ setResponsePage(new EventCoachEditorPage(eventId));
+ }
+ }
+ };
+ edit_event_btn.setVisible(write_btn_visible);
+ form.addOrReplace(edit_event_btn);
+
+ Link delete_event_btn = new Link("delete_event_btn") {
+
+ @Override
+ public void onClick() {
+
+ DAOImpl.deleteRecord( String.valueOf(eventId), "activity");
+ if(entity.getName().equals("activity")){
+ setResponsePage(new ActivityPage());
+ }else{
+ setResponsePage(PageFactory.createPage("calendar"));
+ }
+ }
+ };
+ delete_event_btn.setVisible(write_btn_visible);
+ form.addOrReplace(delete_event_btn);
+ if(map!= null){
+ //获取当前时间
+ Date currentDate = new Date();
+ logger.debug("currentDate:"+currentDate);;
+ //获取开始时间
+ Date startDate = new Date(((Number)map.get("starttime")).longValue());
+ logger.debug("startDate:"+startDate);
+ //如果两个时间比较大于0则开始时间大于当前时间
+ if(startDate.compareTo(currentDate)>0){
+ logger.debug("计划时间晚于当前时间");
+ write_btn_visible = false;
+ }
+ }
+ WebMarkupContainer complete_btn = new WebMarkupContainer("complete_btn");
+ complete_btn.setVisible(write_btn_visible);
+ form.add(complete_btn);
+
+ // List events = DAOImpl.getEventsByUserId(Integer.parseInt(uid));
+ logger.debug("eventID is:"+ eventId);
+
+ //add(new Label("name",String.valueOf(map.get("name"))));
+ add(new EntityDetailPanel("detailed",entity,map,String.valueOf(eventId),1,"calendar"));
+
+
+ }
+
+ class SelectOption implements Serializable{
+ private int key;
+ private String value;
+
+ public SelectOption(int key, String value) {
+ this.key = key;
+ this.value = value;
+ }
+ public SelectOption() {
+
+ }
+
+ public int getKey() {
+ return key;
+ }
+
+ public void setKey(int key) {
+ this.key = key;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+ }
+}
+
+
+
diff --git a/crm/src/main/java/com/rex/crm/FolderResource.java b/crm/src/main/java/com/rex/crm/FolderResource.java
new file mode 100644
index 0000000..bbe2d5a
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/FolderResource.java
@@ -0,0 +1,38 @@
+package com.rex.crm;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.log4j.Logger;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.request.resource.IResource;
+import org.apache.wicket.request.resource.ResourceStreamResource;
+import org.apache.wicket.util.resource.FileResourceStream;
+import org.apache.wicket.util.resource.IResourceStream;
+
+public class FolderResource implements IResource {
+ private static final Logger logger = Logger.getLogger(FolderResource.class);
+ private final File rootFolder;
+
+ public FolderResource(File rootFolder) {
+ this.rootFolder = rootFolder;
+ }
+
+ @Override
+ public void respond(Attributes attributes) {
+ PageParameters parameters = attributes.getParameters();
+ logger.debug(parameters.getNamedKeys());
+ String fileName = parameters.get(0).toString();
+ File file = new File(rootFolder, fileName);
+ try {
+ logger.debug("file:"+file.getCanonicalPath());
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ FileResourceStream fileResourceStream = new FileResourceStream(file);
+ ResourceStreamResource resource = new ResourceStreamResource(fileResourceStream);
+ resource.respond(attributes);
+
+ }
+}
\ No newline at end of file
diff --git a/crm/src/main/java/com/rex/crm/HomePage.html b/crm/src/main/java/com/rex/crm/HomePage.html
new file mode 100644
index 0000000..f302ad6
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/HomePage.html
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/crm/src/main/java/com/rex/crm/HomePage.java b/crm/src/main/java/com/rex/crm/HomePage.java
new file mode 100644
index 0000000..9bcd19f
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/HomePage.java
@@ -0,0 +1,335 @@
+package com.rex.crm;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.behavior.AttributeAppender;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.ChoiceRenderer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+
+import com.rex.crm.beans.CRMUser;
+import com.rex.crm.beans.Choice;
+import com.rex.crm.common.CreateDataPage;
+import com.rex.crm.common.Entity;
+import com.rex.crm.common.Field;
+import com.rex.crm.common.PageableTablePanel;
+import com.rex.crm.db.DAOImpl;
+import com.rex.crm.db.DBHelper;
+import com.rex.crm.reporter.ReportingTablePanel;
+import com.rex.crm.reporter.VisitingReporter;
+import com.rex.crm.util.Configuration;
+import com.rexen.crm.beans.UserRole;
+
+import java.sql.Connection;
+
+import org.apache.commons.dbutils.QueryRunner;
+import org.apache.commons.dbutils.handlers.MapHandler;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.PropertyModel;
+
+public class HomePage extends TemplatePage {
+ private static final long serialVersionUID = 1L;
+ private String search_target = "";//add
+ private final Map models = Maps.newHashMap();
+ public static long getNumOfAccountOfUser(String userId) {
+ long size = 0;
+ Connection conn = null;
+ String sql = "select count(distinct account.id) as num_of_account from " +
+ "accountcrmuser,account where accountcrmuser.crmuserId=? AND account.id=accountcrmuser.accountId";
+ try {
+ QueryRunner run = new QueryRunner();
+ conn = DBHelper.getConnection();
+ Map map = run.query(conn, sql, new MapHandler(), userId);
+ size = (long) map.get("num_of_account");
+ } catch (Exception e) {
+
+ } finally {
+ DBHelper.closeConnection(conn);
+ }
+
+ return size;
+ }
+
+
+ public HomePage() {
+ super();
+ setPageTitle("主页");
+
+ final String posId = ((SignIn2Session)getSession()).getPositionId();
+ final int roleId = ((SignIn2Session)getSession()).getRoleId();
+
+ // 业务概览注释
+// add(new Label("num_of_account_cell",DAOImpl.getNumOfAccountOfUser(posId)));
+// add(new Label("num_of_contact_cell",DAOImpl.getNumOfContactOfUser(posId)));
+// add(new Label("num_of_activity_cell",DAOImpl.getNumOfActivityOfUser(posId)));
+//
+// BookmarkablePageLink contact_link = new BookmarkablePageLink("contact_link", ContactPage.class);
+// add(contact_link);
+// BookmarkablePageLink account_link = new BookmarkablePageLink("account_link", AccountPage.class);
+// add(account_link);
+// BookmarkablePageLink activity_link = new BookmarkablePageLink("activity_link", CalendarPage.class);
+// add(activity_link);
+//
+
+
+ //quick creation bar
+ PageParameters param = new PageParameters();
+ param.add("entityName", "contact");
+ BookmarkablePageLink contact_create_link = new BookmarkablePageLink("contact_create_link", CreateDataPage.class,param );
+ add(contact_create_link);
+
+ WebMarkupContainer userInfo_create_li = new WebMarkupContainer("userInfo_create_li");
+ param = new PageParameters();
+ param.set("entityName", "userinfo");
+ BookmarkablePageLink userInfo_create_link = new BookmarkablePageLink("userInfo_create_link", CreateDataPage.class,param);
+ userInfo_create_li.setVisible(false);
+ userInfo_create_li.add(userInfo_create_link);
+ add(userInfo_create_li);
+
+ if(roleId == 1){
+ userInfo_create_li.setVisible(true);
+ }
+
+ /* param = new PageParameters();
+ param.add("entityName", "activity");
+ BookmarkablePageLink activity_create_link = new BookmarkablePageLink("activity_create_link", CreateDataPage.class,param);
+ add(activity_create_link);*/
+
+
+ WebMarkupContainer activity_create_li = new WebMarkupContainer("activity_create_li");
+ param = new PageParameters();
+ param.set("en", "contact");
+ param.set("excludeName", "activity");
+ param.set("target",-1);
+ BookmarkablePageLink activity_create_link = new BookmarkablePageLink("activity_create_link", SelectActivityContactPage.class,param);
+ activity_create_li.setVisible(false);
+ activity_create_li.add(activity_create_link);
+ add(activity_create_li);
+
+ if(roleId == 3){
+ activity_create_li.setVisible(true);
+ }
+
+
+ WebMarkupContainer coaching_create_li = new WebMarkupContainer("coaching_create_li");
+ param = new PageParameters();
+ param.add("entityName", "coaching");
+ BookmarkablePageLink coaching_create_link = new BookmarkablePageLink("coaching_create_link", ActivitySelectPage.class,param);
+ coaching_create_li.setVisible(false);
+ coaching_create_li.add(coaching_create_link);
+ add(coaching_create_li);
+
+ if(roleId == 2){
+ coaching_create_li.setVisible(true);
+ }
+
+ WebMarkupContainer account_create_li = new WebMarkupContainer("account_create_li");
+ param = new PageParameters();
+ param.add("entityName", "account");
+ BookmarkablePageLink account_create_link = new BookmarkablePageLink("account_create_link", CreateDataPage.class,param);
+ account_create_li.setVisible(false);
+ account_create_li.add(account_create_link);
+ add(account_create_li);
+
+ if(roleId == 1){
+ account_create_li.setVisible(true);
+ }
+
+ WebMarkupContainer position_create_li = new WebMarkupContainer("position_create_li");
+ param = new PageParameters();
+ param.add("entityName", "crmuser");
+ BookmarkablePageLink position_create_link = new BookmarkablePageLink("position_create_link", CreateDataPage.class,param);
+ position_create_li.setVisible(false);
+ position_create_li.add(position_create_link);
+ add(position_create_li);
+
+ if(roleId == 1){
+ position_create_li.setVisible(true);
+ }
+
+
+
+
+ Map entities = Configuration.getEntityTable();
+ final Entity entity = entities.get("alert");
+ final String positionId = ((SignIn2Session) getSession()).getPositionId();
+ List entitys = Configuration.getEntities();
+
+
+ IModel selected_model = new Model(new Choice(0l,"account"));
+ List entityChoice = new ArrayList();
+ final Map entityList = new HashMap();
+ for(Entity entityName :entitys){
+ if(entityName.isGlobalsearch()){
+ Choice choice =new Choice();
+ choice.setVal(entityName.getDisplay());
+ choice.setName(entityName.getName());
+ entityChoice.add(choice);
+ entityList.put(String.valueOf(entityName.getName()), entityName);
+ }
+ }
+ TextField search_input = new TextField("search_input", new PropertyModel(this, "search_target"));
+ DropDownChoice search_select = new DropDownChoice("search_select",selected_model,entityChoice, new IChoiceRenderer() {
+ @Override
+ public Object getDisplayValue(Choice choice) {
+ // TODO Auto-generated method stub
+ return choice.getVal();
+ }
+ @Override
+ public String getIdValue(Choice choice, int index) {
+ // TODO Auto-generated method stub
+ return String.valueOf(choice.getName());
+ }
+
+
+ });
+ models.put("entityName", selected_model);
+ search_select.setNullValid(false);
+
+ Form form = new Form("form")
+ {
+
+ @Override
+ protected void onSubmit()
+ {
+ String entityName = String.valueOf(((Choice) models.get("entityName").getObject()).getName());
+ Entity en = entityList.get(entityName);
+ String sql = en.getSql();
+ switch (roleId)
+ {
+ case UserRole.USER_ROLE_MANAGER:
+ sql = en.getSqlManager();
+ break;
+ case UserRole.USER_ROLE_SALES:
+ sql = en.getSql();
+ break;
+ case UserRole.USER_ROLE_ADMINISTRATOR:
+ sql = en.getSqlAdmin();
+ System.err.print(sql);
+ }
+ search_target = (search_target == null || search_target.equalsIgnoreCase("*")) ? "" : search_target;
+
+ List searchableFields = en.getSearchableFields();
+ String joint = " like '%" + search_target + "%'";
+ String likequery = "";
+ for (Field sf : searchableFields)
+ {
+ likequery = likequery + " OR " + sf.getName() + joint;
+ }
+ if(en.getName().equalsIgnoreCase("coaching")||en.getName().equalsIgnoreCase("activity")||en.getName().equalsIgnoreCase("willcoaching")){
+ sql = sql + " where title like '%" + search_target + "%' " + likequery;
+ } else{
+ sql = sql + " where name like '%" + search_target + "%' " + likequery;
+ }
+ System.out.println(sql);
+ List datalist = null;
+
+ switch (roleId)
+ {
+ case UserRole.USER_ROLE_MANAGER:
+
+ if(en.getName().equalsIgnoreCase("account")){
+ datalist = DAOImpl.queryEntityRelationList(sql, positionId, positionId,positionId);
+ }else if(en.getName().equalsIgnoreCase("contact")){
+ datalist = DAOImpl.queryEntityRelationList(sql,positionId);
+ }else if(en.getName().equalsIgnoreCase("coaching")||en.getName().equalsIgnoreCase("activity")||en.getName().equalsIgnoreCase("willcoaching")){
+ datalist = DAOImpl.queryEntityRelationList(sql,positionId,positionId);
+ }
+ break;
+ case UserRole.USER_ROLE_SALES:
+ if(en.getName().equalsIgnoreCase("account")){
+ datalist = DAOImpl.queryEntityRelationList(sql, positionId,positionId);
+ }else if(en.getName().equalsIgnoreCase("coaching")||en.getName().equalsIgnoreCase("activity")
+ ||en.getName().equalsIgnoreCase("willcoaching")||en.getName().equalsIgnoreCase("contact")){
+ datalist = DAOImpl.queryEntityRelationList(sql,positionId);
+ }
+ break;
+ case UserRole.USER_ROLE_ADMINISTRATOR:
+ datalist = DAOImpl.queryEntityRelationList(sql);
+ System.err.print(sql);
+ }
+
+ if(entityName.equals("account")){
+ setResponsePage(new AccountPage(datalist));
+ }else if(entityName.equals("contact")){
+ setResponsePage(new ContactPage(datalist));
+ }else if(entityName.equals("activity")){
+ setResponsePage(new ActivityPage(datalist));
+ }else if(entityName.equals("coaching")){
+ setResponsePage(new CoachingPage(datalist));
+ }else if(entityName.equals("willcoaching")){
+ setResponsePage(new CoachingPage(datalist));
+ }
+
+ }
+
+ };
+// ChoiceRenderer choiceRenderer = new ChoiceRenderer("name","URL");
+
+ add(form);
+ form.add(search_select);
+ form.add(search_input);
+
+
+ String sql = "";
+
+ switch (roleId)
+ {
+ case 1:
+ sql = "SELECT * from alert where expired > now() and publishDate < now() ORDER BY whenadded DESC";
+ break;
+ case 2:
+ sql = entity.getSqlManager();
+ break;
+ case 3:
+ sql = entity.getSql();
+ break;
+ }
+ List tdata = null;
+ //获取登录用户的positonID,从而获取crmuser获取大区
+ if(((SignIn2Session)getSession()).getRoleId()!=1){
+ CRMUser user = DAOImpl.getCrmUserById(((SignIn2Session)getSession()).getPositionId());
+ tdata = DAOImpl.queryEntityRelationList(sql,String.valueOf(user.getPl5()));
+ }else{
+ tdata = DAOImpl.queryEntityRelationList(sql);
+ }
+ add(new PageableTablePanel("datalist", entity, tdata, null));
+ System.out.println("ds:"+((SignIn2Session)getSession()).getRoleId());
+
+ if(((SignIn2Session)getSession()).getRoleId()==3){
+ final Entity entityAct = entities.get("todolist");
+ String userName = ((SignIn2Session) getSession()).getUser();
+ String sql2="SELECT * FROM crmdb.activity_alert where name='"+userName+"'";
+ List tdataAct = DAOImpl.queryEntityRelationList(sql2);
+ //Entity Fordetail = entities.get("activity");
+ add(new PageableTablePanel("datalistAct", entityAct, tdataAct, null));
+ }else if(((SignIn2Session)getSession()).getRoleId()==2){
+ final Entity entityAct = entities.get("todolistcoach");
+ String userName = ((SignIn2Session) getSession()).getUser();
+ String sql2="SELECT * FROM crmdb.activity_alert where name='"+userName+"'";
+ List tdataAct = DAOImpl.queryEntityRelationList(sql2);
+ //Entity Fordetail = entities.get("activity");
+ add(new PageableTablePanel("datalistAct", entityAct, tdataAct, null));
+ }
+ else{
+ WebMarkupContainer container_label = new WebMarkupContainer("datalistAct");
+ container_label.setVisible(false);
+ add( container_label);
+ }
+
+ }
+}
diff --git a/crm/src/main/java/com/rex/crm/NullPosition.html b/crm/src/main/java/com/rex/crm/NullPosition.html
new file mode 100644
index 0000000..89f7933
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/NullPosition.html
@@ -0,0 +1,11 @@
+
+
+ 登出
+
+
+
+ 您暂时没有岗位,请联系管理员为您分配岗位!
+ 再见!
+ 回主页
+
+
diff --git a/crm/src/main/java/com/rex/crm/NullPosition.java b/crm/src/main/java/com/rex/crm/NullPosition.java
new file mode 100644
index 0000000..ad8527b
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/NullPosition.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.rex.crm;
+
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+
+public class NullPosition extends WebPage
+{
+ public NullPosition(final PageParameters parameters)
+ {
+
+ getSession().invalidate();
+ }
+}
diff --git a/crm/src/main/java/com/rex/crm/PageFactory.java b/crm/src/main/java/com/rex/crm/PageFactory.java
new file mode 100644
index 0000000..cfcc8ec
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/PageFactory.java
@@ -0,0 +1,55 @@
+package com.rex.crm;
+
+import org.apache.wicket.Page;
+
+import com.rex.crm.admin.PositionPage;
+import com.rex.crm.admin.ProductPage;
+import com.rex.crm.admin.ProductTreePage;
+import com.rex.crm.admin.UserPage;
+import com.rex.crm.common.EntityDetailPage;
+
+public class PageFactory {
+
+ public static Page createPage(String name){
+ if(name.equalsIgnoreCase("account")){
+ return new AccountPage();
+ }else if(name.equalsIgnoreCase("contact")){
+ return new ContactPage();
+ }else if(name.equalsIgnoreCase("calendar")){
+ return new CalendarPage();
+ }else if(name.equalsIgnoreCase("activity")){
+ return new ActivityPage();
+ }else if(name.equalsIgnoreCase("crmuser")){
+ return new PositionPage();
+ }else if(name.equalsIgnoreCase("coaching")||name.equalsIgnoreCase("willCoaching")){
+ return new CoachingPage();
+ }else if(name.equalsIgnoreCase("userInfo")){
+ return new UserPage();
+ }else if(name.equalsIgnoreCase("alert")){
+ return new AlertPage();
+ }else if(name.equalsIgnoreCase("productline")||name.equalsIgnoreCase("product")||name.equalsIgnoreCase("productcategory")){
+ return new ProductPage();
+ }else if(name.equalsIgnoreCase("province")||name.equalsIgnoreCase("city")){
+ return new AreaPage();
+ }
+ else{
+ return new HomePage();
+ }
+ }
+ public static Page createPageToDetail(String EntityName,String id){
+ return new EntityDetailPage(EntityName,id);
+ }
+ public static Page createPageTree(String EntityName,String id){
+
+ return new ProductTreePage(id,EntityName);
+ }
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/crm/src/main/java/com/rex/crm/SearchCRMUserPage.html b/crm/src/main/java/com/rex/crm/SearchCRMUserPage.html
new file mode 100755
index 0000000..4e8227b
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/SearchCRMUserPage.html
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/crm/src/main/java/com/rex/crm/SearchCRMUserPage.java b/crm/src/main/java/com/rex/crm/SearchCRMUserPage.java
new file mode 100755
index 0000000..d1098cf
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/SearchCRMUserPage.java
@@ -0,0 +1,226 @@
+package com.rex.crm;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.behavior.AttributeAppender;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Check;
+import org.apache.wicket.markup.html.form.CheckGroup;
+import org.apache.wicket.markup.html.form.CheckGroupSelector;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.list.AbstractItem;
+import org.apache.wicket.markup.repeater.RepeatingView;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.util.string.StringValue;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.rex.crm.beans.Contact;
+import com.rex.crm.common.EntityDetailPage;
+import com.rex.crm.common.Field;
+import com.rex.crm.common.NewDataFormPanel;
+import com.rex.crm.db.DAOImpl;
+import org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigator;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.PageableListView;
+
+/**
+ *
+ *
+ * @author Feiyun
+ */
+public class SearchCRMUserPage extends WebPage {
+
+ private static final Logger logger = Logger.getLogger(SearchCRMUserPage.class);
+ private String search_target;
+ List selectedUserIds = Lists.newArrayList();
+ private String entityId;
+ private String uid;
+// private String entityName;
+ private int type = 0;
+
+ /**
+ * Constructor
+ *
+ * @param parameters Page parameters (ignored since this is the home page)
+ */
+ public SearchCRMUserPage() {
+ StringValue value = this.getRequest().getRequestParameters().getParameterValue("cid");
+ StringValue entityname = getRequest().getRequestParameters().getParameterValue("entityname");
+ StringValue postId = this.getRequest().getRequestParameters().getParameterValue("positionId");
+
+ if (value != null) {
+ entityId = value.toString();
+ }
+ if(postId != null){
+ uid = postId.toString();
+ }
+ initPage(entityname.toString(), null, entityId,uid, type);
+ }
+ public SearchCRMUserPage(String entityName, final String entityId, String uid, int type) {
+ //logger.debug("sdfsfsdfdsf:"+entityName);
+ this.entityId = entityId;
+ this.type = type;
+ this.uid=uid;
+ initPage(entityName, null, entityId,uid, type);
+ }
+
+ public SearchCRMUserPage(List maplist, String entityName, final String entityId, String uid,int type) {
+ this.entityId = entityId;
+ this.type = type;
+ this.uid = uid;
+ initPage(entityName, maplist, entityId,uid, type);
+ }
+
+ public void initPage(final String entityname, List list, final String entityId, final String uid, final int type) {
+ Form form = new Form("form") {
+ @SuppressWarnings("unchecked")
+ @Override
+ protected void onSubmit() {
+ logger.debug("the form was submitted!");
+ List maplist = null;
+
+ if (entityname.equals("account") || entityname.equals("contact")) {
+ maplist = DAOImpl.searchCRMUser(search_target);
+ }else if(entityname.equals("userinfo")){
+ maplist = DAOImpl.searchUserPosition(uid,search_target);
+ }else {
+ if (type == 0||type==4) {
+ maplist = DAOImpl.searchCRMAccount(search_target);
+ }else if (type == 1) {
+ maplist = DAOImpl.searchCRMContact(search_target);
+ }else if(type == 2){
+ maplist = DAOImpl.searchUser(search_target);
+ } else{
+ maplist = DAOImpl.searchCRMUser(search_target);
+ }
+ }
+
+
+ setResponsePage(new SearchCRMUserPage(maplist, entityname, entityId,uid, type));
+
+ }
+ };
+ form.add(new TextField("search_input", new PropertyModel(this, "search_target")));
+ add(form);
+
+
+
+
+ Form users_sbumission_form = new Form("users_sbumission_form");
+
+ users_sbumission_form.add(new AjaxButton("ajax-button", users_sbumission_form)
+ {
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form> form)
+ {
+ logger.debug("seletedUserIds:" + selectedUserIds);
+ for (String positionId : selectedUserIds) {
+ try {
+ DAOImpl.insertRelationOfEntityIDCRMUserID(entityname, entityId,positionId ,type);
+
+ } catch (Exception e) {
+
+ }
+ }
+
+ target.appendJavaScript(" window.opener.location.href='./EntityDetailPage?entityName="+entityname+"&id="+entityId+"'; window.close();");
+ }
+
+ @Override
+ protected void onError(AjaxRequestTarget target, Form> form)
+ {
+ // repaint the feedback panel so errors are shown
+ //target.add(feedback);
+ }
+ });
+
+ final int roleId = ((SignIn2Session) getSession()).getRoleId();
+ add(users_sbumission_form);
+ CheckGroup group = new CheckGroup("group", new PropertyModel(this, "selectedUserIds"));
+ if (roleId == 1) {
+ CheckGroupSelector chks = new CheckGroupSelector("checkboxs");
+ group.add(chks);
+ WebMarkupContainer container_label = new WebMarkupContainer("checkboxs_label");
+ group.add(container_label);
+ container_label.add(new AttributeAppender("for", new Model(chks.getMarkupId()), " "));
+ } else {
+ WebMarkupContainer container = new WebMarkupContainer("checkboxs");
+ container.setVisible(false);
+ group.add(container);
+ }
+ users_sbumission_form.add(group);
+
+
+
+
+ // RepeatingView dataRowRepeater = new RepeatingView("dataRowRepeater");
+ // group.add(dataRowRepeater);
+
+
+
+
+
+
+ //初始化的时候查不出数据
+ if (list == null) {
+ list=DAOImpl.queryEntityRelationList("Select * from account where 1=0");
+ }
+
+ final Map tableData = Maps.newHashMap();
+ List ids = Lists.newArrayList();
+ for (Map map : (List) list) {
+ String key = String.valueOf(map.get("id"));
+ ids.add(key);
+ tableData.put(key, map);
+ }
+
+ final PageableListView listview = new PageableListView("dataRowRepeater", ids, 20) {
+
+ @Override
+ protected void populateItem(ListItem item) {
+ String key = item.getDefaultModelObjectAsString();
+ Map map = tableData.get(key);
+
+
+
+ int positionId = ((Number) map.get("id")).intValue();
+ String name = (String) map.get("name");
+ String cellPhone = (String) map.get("cellPhone");
+ String email = (String) map.get("email");
+ // AbstractItem item = new AbstractItem(dataRowRepeater.newChildId());
+ // dataRowRepeater.add(item);
+ Check chk = new Check("checkbox", new Model(String.valueOf(positionId)));
+ item.add(chk);
+ WebMarkupContainer container_label = new WebMarkupContainer("checkboxs_label");
+ item.add(container_label);
+ container_label.add(new AttributeAppender("for", new Model(chk.getMarkupId()), " "));
+ item.add(new Label("name", name));
+ item.add(new Label("cellPhone", cellPhone));
+ item.add(new Label("email", email));
+
+ }
+ };
+ group.add(listview);
+ AjaxPagingNavigator nav =new AjaxPagingNavigator("navigator", listview);
+ nav.setOutputMarkupId(true);
+
+ group.setOutputMarkupId(true);
+ group.setRenderBodyOnly(false);
+
+ group.add(nav);
+
+ group.setVersioned(false);
+
+
+ }
+}
diff --git a/crm/src/main/java/com/rex/crm/SearchContactPage.html b/crm/src/main/java/com/rex/crm/SearchContactPage.html
new file mode 100755
index 0000000..5775464
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/SearchContactPage.html
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/crm/src/main/java/com/rex/crm/SearchContactPage.java b/crm/src/main/java/com/rex/crm/SearchContactPage.java
new file mode 100755
index 0000000..2ea217a
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/SearchContactPage.java
@@ -0,0 +1,85 @@
+package com.rex.crm;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.apache.wicket.behavior.AttributeAppender;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.list.AbstractItem;
+import org.apache.wicket.markup.repeater.RepeatingView;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+
+import com.google.common.collect.Lists;
+import com.rex.crm.beans.Contact;
+import com.rex.crm.common.NewDataFormPanel;
+import com.rex.crm.db.DAOImpl;
+
+/**
+ *
+ *
+ * @author Feiyun
+ */
+public class SearchContactPage extends WebPage {
+ private static final Logger logger = Logger.getLogger(SearchContactPage.class);
+
+ private String search_target;
+
+ /**
+ * Constructor
+ *
+ * @param parameters
+ * Page parameters (ignored since this is the home page)
+ */
+ public SearchContactPage() {
+ initPage(null);
+ }
+
+ public SearchContactPage(List maplist) {
+ initPage(maplist);
+ }
+
+ public void initPage(List list) {
+ final String posId = ((SignIn2Session) getSession()).getPositionId();
+ Form form = new Form("form") {
+ @Override
+ protected void onSubmit() {
+ logger.debug("the form was submitted!");
+ // new PropertyModel(this, "selected")
+ List maplist = DAOImpl.searchContact(posId, search_target);
+ setResponsePage(new SearchContactPage(maplist));
+
+ }
+ };
+ form.add(new TextField("search_input", new PropertyModel(this, "search_target")));
+ add(form);
+
+ RepeatingView dataRowRepeater = new RepeatingView("dataRowRepeater");
+ add(dataRowRepeater);
+
+ if (list != null) {
+ for (Map map : list) {
+ int cid = ((Number) map.get("cid")).intValue();
+ String cname = (String) map.get("cname");
+ String aname = (String) map.get("aname");
+ System.out.println(cname);
+ AbstractItem item = new AbstractItem(dataRowRepeater.newChildId());
+ dataRowRepeater.add(item);
+ Label cap = new Label("cname_span", new Model(cname));
+ item.add(new AttributeAppender("data-cid",new Model(cid)));
+ item.add(new AttributeAppender("data-cname",new Model(cname)));
+ item.add(new AttributeAppender("data-aname",new Model(aname)));
+ //item.add(new AttributeAppender("data-cname", new Model(cname)));
+ item.add(cap);
+ item.add(new Label("aname_span", new Model(aname)));
+
+
+ }
+ }
+ }
+}
diff --git a/crm/src/main/java/com/rex/crm/SelectActivityContactPage.html b/crm/src/main/java/com/rex/crm/SelectActivityContactPage.html
new file mode 100644
index 0000000..5189bb4
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/SelectActivityContactPage.html
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/crm/src/main/java/com/rex/crm/SelectActivityContactPage.java b/crm/src/main/java/com/rex/crm/SelectActivityContactPage.java
new file mode 100644
index 0000000..425cd56
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/SelectActivityContactPage.java
@@ -0,0 +1,240 @@
+package com.rex.crm;
+
+import com.google.common.collect.Lists;
+import java.text.SimpleDateFormat;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.apache.wicket.behavior.AttributeAppender;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.markup.html.list.AbstractItem;
+import org.apache.wicket.markup.repeater.RepeatingView;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+
+import com.google.common.collect.Maps;
+import com.rex.crm.common.CreateDataPage;
+import com.rex.crm.common.Entity;
+import com.rex.crm.common.Field;
+import com.rex.crm.db.DAOImpl;
+import com.rex.crm.util.Configuration;
+import org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigator;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.PageableListView;
+
+public class SelectActivityContactPage extends WebPage {
+ private static final Logger logger = Logger.getLogger(SelectActivityContactPage.class);
+
+ private static String search_target;
+ final String posId = ((SignIn2Session) getSession()).getPositionId();
+ final String userId = ((SignIn2Session) getSession()).getUserId();
+ final int roleId = ((SignIn2Session) getSession()).getRoleId();
+ final Map entities = Configuration.getEntityTable();
+ Entity entity = null;
+ public SelectActivityContactPage(){
+ String relationTableName = getRequest().getRequestParameters().getParameterValue("en").toString();
+ String tragetEntity = getRequest().getRequestParameters().getParameterValue("excludeName").toString();
+ final String excludeId = getRequest().getRequestParameters().getParameterValue("eid").toString();
+ String target = getRequest().getRequestParameters().getParameterValue("target").toString();
+ entity = entities.get(relationTableName);
+
+ List maplist = selectConatct(tragetEntity,roleId,posId,entity,entities );
+ initPage(maplist,relationTableName,tragetEntity,excludeId,target);
+ // setResponsePage(new SelectActivityContactPage(,"contact",tragetEntity,excludeId,target));
+ }
+ public SelectActivityContactPage(List list,final String relationTableName,final String tragetEntity,final String excludeId,final String target){
+ initPage(list,relationTableName,tragetEntity,excludeId,target);
+ }
+ public void initPage(List list,final String relationTableName,final String tragetEntity,final String excludeId,final String target) {
+ final Entity entity = entities.get(relationTableName);
+ Form form = new Form("form") {
+ @Override
+ protected void onSubmit() {
+ List maplist = selectConatct(tragetEntity,roleId,posId,entity,entities );
+ setResponsePage(new SelectActivityContactPage(maplist,relationTableName,tragetEntity,excludeId,target));
+ }
+ };
+ form.add(new TextField("search_input", new PropertyModel(this, "search_target")));
+ add(form);
+
+
+ final List searchableFields = entity.getSearchableFields();
+
+ final Map tableData = Maps.newHashMap();
+ List ids = Lists.newArrayList();
+ for (Map map : (List) list) {
+ String key = String.valueOf(map.get("id"));
+ ids.add(key);
+ tableData.put(key, map);
+ }
+
+
+ final PageableListView listview = new PageableListView("dataRowRepeater", ids, 20) {
+
+ @Override
+ protected void populateItem(ListItem item) {
+ String key = item.getDefaultModelObjectAsString();
+ Map map = tableData.get(key);
+ final int uid = ((Number) map.get("id")).intValue();
+ String name = (String) map.get("name");
+
+ item.add(new AttributeAppender("data-id",new Model(uid)));
+ item.add(new AttributeAppender("data-name",new Model(name)));
+ item.add(new AttributeAppender("data-ename",relationTableName));
+
+ //item.add(new AttributeAppender("data-cname", new Model(cname)));
+ Label cap = new Label("name_span", new Model(name));
+ Link link = new Link("createJump"){
+ @Override
+ public void onClick() {
+ Map map = DAOImpl.queryEntityById(entity.getSql_ent(), String.valueOf(uid));
+ Entity entity = entities.get("contact");
+ List paramFields = entity.getParamFields();
+ Map params = Maps.newHashMap();
+ for(Field f:paramFields){
+ params.put("contact"+"."+f.getName(), map.get(f.getName()));
+ }
+ setResponsePage(new CreateDataPage("activity",params));
+ }
+
+ };
+ link.add(cap);
+ //link.add(new AttributeAppender("html",new Model(name),""));
+ item.add(link);
+
+
+ RepeatingView column_repeater = new RepeatingView("column_repeater");
+ item.add(column_repeater);
+ for(Field f:searchableFields){
+ Object obj = map.get(f.getName());
+ if(!f.getName().equalsIgnoreCase("name") && obj != null){
+ AbstractItem column_item = new AbstractItem(column_repeater.newChildId());
+ column_repeater.add(column_item);
+
+ String celldata =String.valueOf(obj);
+ column_item.add(new Label("celldata",""+f.getDisplay()+": "+celldata).setEscapeModelStrings(false));
+ }
+ }
+
+
+
+ Object obj = map.get("num_of_visiting");
+ if (obj != null) {
+ AbstractItem column_item = new AbstractItem(column_repeater.newChildId());
+ column_repeater.add(column_item);
+ String num_of_visiting = String.valueOf(obj);
+ column_item.add(new Label("celldata", num_of_visiting + "(拜访次数)"));
+ }
+
+
+
+ }
+ };
+
+ add(listview);
+ AjaxPagingNavigator nav =new AjaxPagingNavigator("navigator", listview);
+ nav.setOutputMarkupId(true);
+
+ add(nav);
+ setVersioned(false);
+
+ }
+
+ public static List selectConatct(final String tragetEntity,int roleId,String posId,Entity entity,Map entities ){
+ List maplist = null;
+ if (tragetEntity.equalsIgnoreCase("activity")) {
+
+ String sql = assembleSearchingSQL(roleId, entity);
+
+ switch (roleId) {
+ case 2:{
+ maplist = DAOImpl.queryEntityRelationList(sql, posId, posId);
+
+ break;
+ }
+ case 3:{
+ maplist = DAOImpl.queryEntityRelationList(sql, posId);
+ Entity activityEnt = entities.get("activity");
+ String actSQL = activityEnt.getSql();
+ actSQL = "select contactName,count(contactName) as ct from ("+ actSQL + ") as bact where status=2 group by contactName";
+ logger.debug("number_of_act:"+actSQL);
+
+ List num_of_act_per_contact = DAOImpl.queryEntityRelationList(actSQL, posId);
+
+ Map activity_contact_map = Maps.newHashMap();
+ for(Map map:num_of_act_per_contact){
+ activity_contact_map.put(String.valueOf(map.get("contactName")),map);
+ }
+
+
+ // Map contact_map = Maps.newHashMap();
+ for(Map map:maplist){
+ String contactId = String.valueOf(map.get("id"));
+ if(activity_contact_map.containsKey(contactId)){
+ map.put("num_of_visiting", activity_contact_map.get(contactId).get("ct"));
+ }
+ }
+
+ //sorting
+ //Collections.s`
+ Collections.sort(maplist,new Comparator(){
+
+ @Override
+ public int compare(Map o1, Map o2) {
+ Object obj1 = o1.get("num_of_visiting");
+ Object obj2 = o2.get("num_of_visiting");
+ if(obj1 == null || obj2 == null) return 0;
+
+ long v1 = (long)o1.get("num_of_visiting");
+ long v2 = (long)o2.get("num_of_visiting");
+
+ return (int)(v2-v1);
+
+ }
+
+ });
+
+
+ break;
+ }
+ case 1:
+ maplist = DAOImpl.queryEntityRelationList(sql);
+ }
+ }
+ return maplist;
+ }
+ private static String assembleSearchingSQL(final int roleId, final Entity entity) {
+ String sql = entity.getSql();
+ switch(roleId){
+ case 1:
+ sql = entity.getSqlAdmin();
+ break;
+ case 2:
+ sql = entity.getSqlManager();
+ break;
+ case 3:
+ sql = entity.getSql();
+ break;
+ }
+
+ search_target = (search_target==null || search_target.equalsIgnoreCase("*"))? "":search_target;
+
+ List searchableFields = entity.getSearchableFields();
+ String joint = " like '%"+search_target+"%'";
+ String likequery = "";
+ for(Field sf:searchableFields){
+ likequery = likequery + " OR "+ sf.getName() + joint;
+ }
+
+ sql = sql + " where name like '%"+search_target+"%' " + likequery ;
+ return sql;
+ }
+}
diff --git a/crm/src/main/java/com/rex/crm/SelectCRMUserPage.html b/crm/src/main/java/com/rex/crm/SelectCRMUserPage.html
new file mode 100755
index 0000000..3958bca
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/SelectCRMUserPage.html
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/crm/src/main/java/com/rex/crm/SelectCRMUserPage.java b/crm/src/main/java/com/rex/crm/SelectCRMUserPage.java
new file mode 100755
index 0000000..fd003ab
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/SelectCRMUserPage.java
@@ -0,0 +1,93 @@
+package com.rex.crm;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.apache.wicket.behavior.AttributeAppender;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.list.AbstractItem;
+import org.apache.wicket.markup.repeater.RepeatingView;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.util.string.StringValue;
+
+import com.google.common.collect.Lists;
+import com.rex.crm.beans.Contact;
+import com.rex.crm.common.NewDataFormPanel;
+import com.rex.crm.db.DAOImpl;
+
+/**
+ *
+ *
+ * @author Feiyun
+ */
+public class SelectCRMUserPage extends WebPage {
+ private static final Logger logger = Logger.getLogger(SelectCRMUserPage.class);
+
+ private String search_target;
+
+ /**
+ * Constructor
+ *
+ * @param parameters
+ * Page parameters (ignored since this is the home page)
+ */
+ public SelectCRMUserPage() {
+ StringValue mid = getRequest().getRequestParameters().getParameterValue("mid");
+ //.getPageParameters().get("mid");
+ logger.debug("mid:"+mid);
+ initPage(null,mid.toString());
+ }
+
+ public SelectCRMUserPage(List maplist,String managerId) {
+ initPage(maplist,managerId);
+ }
+
+ public void initPage(List list,final String managerId) {
+ // final String userId = ((SignIn2Session) getSession()).getUserId();
+ Form form = new Form("form") {
+ @Override
+ protected void onSubmit() {
+ logger.debug("the form was submitted!");
+ // new PropertyModel(this, "selected")
+ //List maplist = DAOImpl.searchCRMUser(managerId, search_target);
+ List maplist = DAOImpl.searchCRMUserOfManager(managerId,search_target);
+ setResponsePage(new SelectCRMUserPage(maplist,managerId));
+
+ }
+ };
+ form.add(new TextField("search_input", new PropertyModel(this, "search_target")));
+ add(form);
+
+ RepeatingView dataRowRepeater = new RepeatingView("dataRowRepeater");
+ add(dataRowRepeater);
+
+ if (list != null) {
+ for (Map map : list) {
+ int uid = ((Number) map.get("id")).intValue();
+ String name = (String) map.get("name");
+ String cellPhone = (String) map.get("cellPhone");
+ String jobTitle = (String) map.get("jobTitle");
+ String email = (String) map.get("email");
+ AbstractItem item = new AbstractItem(dataRowRepeater.newChildId());
+ dataRowRepeater.add(item);
+ Label cap = new Label("name_span", new Model(name));
+ item.add(new AttributeAppender("data-uid",new Model(uid)));
+ item.add(new AttributeAppender("data-uname",new Model(name)));
+
+ //item.add(new AttributeAppender("data-cname", new Model(cname)));
+ item.add(cap);
+ item.add(new Label("cellPhone_span", cellPhone));
+ item.add(new Label("email_span", email));
+ item.add(new Label("jobTitle_span", jobTitle));
+
+
+ }
+ }
+ }
+}
diff --git a/crm/src/main/java/com/rex/crm/SelectEntryPage.html b/crm/src/main/java/com/rex/crm/SelectEntryPage.html
new file mode 100755
index 0000000..28b5f86
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/SelectEntryPage.html
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/crm/src/main/java/com/rex/crm/SelectEntryPage.java b/crm/src/main/java/com/rex/crm/SelectEntryPage.java
new file mode 100755
index 0000000..903adfd
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/SelectEntryPage.java
@@ -0,0 +1,365 @@
+package com.rex.crm;
+
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.log4j.Logger;
+import org.apache.wicket.behavior.AttributeAppender;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.list.AbstractItem;
+import org.apache.wicket.markup.repeater.RepeatingView;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.util.string.StringValue;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
+import com.rex.crm.beans.Contact;
+import com.rex.crm.common.Entity;
+import com.rex.crm.common.Field;
+import com.rex.crm.common.NewDataFormPanel;
+import com.rex.crm.db.DAOImpl;
+import com.rex.crm.util.Configuration;
+import org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigator;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.PageableListView;
+
+/**
+ *
+ *
+ * @author Feiyun
+ */
+public class SelectEntryPage extends WebPage {
+ private static final Logger logger = Logger.getLogger(SelectEntryPage.class);
+
+ private String search_target;
+
+
+ /**
+ * Constructor
+ *
+ * @param parameters
+ * Page parameters (ignored since this is the home page)
+ */
+ public SelectEntryPage() {
+ String relationTableName = getRequest().getRequestParameters().getParameterValue("en").toString();
+ String tragetEntity = getRequest().getRequestParameters().getParameterValue("excludeName").toString();
+ final String excludeId = getRequest().getRequestParameters().getParameterValue("eid").toString();
+ String target = getRequest().getRequestParameters().getParameterValue("target").toString();
+ initPage(null,relationTableName,tragetEntity,excludeId,target);
+ }
+
+ public SelectEntryPage(List maplist,String relationTableName,String tragetEntity,String excludeId,String target) {
+ initPage(maplist,relationTableName,tragetEntity,excludeId,target);
+ }
+
+ public void initPage(List list,final String relationTableName,final String tragetEntity,final String excludeId,final String target) {
+ final String posId = ((SignIn2Session) getSession()).getPositionId();
+ final String userId = ((SignIn2Session) getSession()).getUserId();
+ final int roleId = ((SignIn2Session) getSession()).getRoleId();
+ final Map entities = Configuration.getEntityTable();
+ final Entity entity = entities.get(relationTableName);
+ Form form = new Form("form") {
+ @Override
+ protected void onSubmit() {
+ List maplist = null;
+ if(relationTableName.equalsIgnoreCase("account")){
+
+ String sql = assembleSearchingSQL(roleId, entity);
+
+ switch (roleId) {
+ case 2:
+ maplist = DAOImpl.queryEntityRelationList(sql, posId, posId, posId);
+ break;
+ case 3:
+ maplist = DAOImpl.queryEntityRelationList(sql, posId, posId);
+ break;
+ case 1:
+ sql = "select * from ("+ sql + ") as bact where status=1 ";
+ maplist = DAOImpl.queryEntityRelationList(sql);
+ }
+
+
+ }else if(relationTableName.equalsIgnoreCase("contact")){
+
+ if (tragetEntity.equalsIgnoreCase("activity")) {
+
+ String sql = assembleSearchingSQL(roleId, entity);
+
+ switch (roleId) {
+ case 2:{
+ maplist = DAOImpl.queryEntityRelationList(sql, posId, posId);
+
+ break;
+ }
+ case 3:{
+ maplist = DAOImpl.queryEntityRelationList(sql, posId);
+
+ Entity activityEnt = entities.get("activity");
+ String actSQL = activityEnt.getSql();
+ actSQL = "select contactName,count(contactName) as ct from ("+ actSQL + ") as bact where status=2 group by contactName";
+ logger.debug("number_of_act:"+actSQL);
+
+ List num_of_act_per_contact = DAOImpl.queryEntityRelationList(actSQL, posId);
+
+ Map activity_contact_map = Maps.newHashMap();
+ for(Map map:num_of_act_per_contact){
+ activity_contact_map.put(String.valueOf(map.get("contactName")),map);
+ }
+
+
+ // Map contact_map = Maps.newHashMap();
+ for(Map map:maplist){
+ String contactId = String.valueOf(map.get("id"));
+ if(activity_contact_map.containsKey(contactId)){
+ map.put("num_of_visiting", activity_contact_map.get(contactId).get("ct"));
+ }
+ }
+
+ //sorting
+ //Collections.s`
+ Collections.sort(maplist,new Comparator(){
+
+ @Override
+ public int compare(Map o1, Map o2) {
+ Object obj1 = o1.get("num_of_visiting");
+ Object obj2 = o2.get("num_of_visiting");
+ if(obj1 == null || obj2 == null) return 0;
+
+ long v1 = (long)o1.get("num_of_visiting");
+ long v2 = (long)o2.get("num_of_visiting");
+
+ return (int)(v2-v1);
+
+ }
+
+ });
+
+
+ break;
+ }
+ case 1:
+ maplist = DAOImpl.queryEntityRelationList(sql);
+
+ }
+ }else if (tragetEntity.equalsIgnoreCase("crmuser")) {
+ // maplist = DAOImpl.searchCRMUser(search_target);
+ maplist = DAOImpl.searchManager(search_target, excludeId);
+ Map dummy = Maps.newHashMap();
+ dummy.put("id", -1);
+ dummy.put("name", "无");
+ maplist.add(dummy);
+
+ } else if (tragetEntity.equalsIgnoreCase("userInfo")) {
+ // maplist = DAOImpl.searchCRMUser(search_target);
+ maplist = DAOImpl.searchCRMUser(search_target);
+ Map dummy = Maps.newHashMap();
+ dummy.put("id", -1);
+ dummy.put("name", "无");
+ maplist.add(dummy);
+
+ } else if (tragetEntity.equalsIgnoreCase("contact")) {
+ // maplist = DAOImpl.searchCRMUser(search_target);
+ maplist = DAOImpl.searchMergeContact(search_target);
+ Map dummy = Maps.newHashMap();
+ dummy.put("id", -1);
+ dummy.put("name", "无");
+ maplist.add(dummy);
+
+ }
+ } else if(relationTableName.equalsIgnoreCase("crmuser")){
+ //maplist = DAOImpl.searchCRMUser(search_target);
+ if (tragetEntity.equalsIgnoreCase("crmuser")){
+ maplist = DAOImpl.searchManager(search_target,excludeId);
+ }else if(tragetEntity.equalsIgnoreCase("coaching")||tragetEntity.equalsIgnoreCase("willcoaching")){
+ String sql = assembleSearchingSQL(roleId, entity);
+ if(roleId==1){
+ maplist = DAOImpl.queryEntityRelationList(sql);
+ Map dummy = Maps.newHashMap();
+ dummy.put("id", -1);
+ dummy.put("name", "无");
+ maplist.add(dummy);
+ }else if(roleId == 2){
+
+ // sql = entity.getSqlManagerCoaching();
+ sql = "select * from (select crmuser.id as id, crmuser.name as name, crmuser.code ,userinfo.name as userInfoName from crmuser,userinfo,user_position where crmuser.id=user_position.positionId"
+ + " and user_position.userId=userInfo.id and crmuser.reportto=?) as aquery";
+ logger.debug("sql XXXXX:" + sql);
+ maplist = DAOImpl.queryEntityRelationList(sql,posId);
+ }else if(roleId == 3){
+ maplist = DAOImpl.queryEntityRelationList(sql,posId);
+ Map dummy = Maps.newHashMap();
+ dummy.put("id", -1);
+ dummy.put("name", "无");
+ maplist.add(dummy);
+ }
+ }else if(tragetEntity.equalsIgnoreCase("userInfo")){
+ if(target.equalsIgnoreCase("-1")){
+ maplist = DAOImpl.searchPositionCRMUser(search_target);
+ }else {
+ maplist = DAOImpl.searchCRMUser(search_target);
+ }
+ Map dummy = Maps.newHashMap();
+ dummy.put("id", -1);
+ dummy.put("name", "无");
+ maplist.add(dummy);
+ }else if(tragetEntity.equalsIgnoreCase("user_position")){
+
+ maplist = DAOImpl.searchPositionCRMUser(search_target);
+ Map dummy = Maps.newHashMap();
+ dummy.put("id", -1);
+ dummy.put("name", "无");
+ maplist.add(dummy);
+
+ }
+ }else if (relationTableName.equalsIgnoreCase("userinfo")) {
+ String sql = assembleSearchingSQL(roleId, entity);
+// if(){
+ maplist = DAOImpl.queryEntityRelationList(sql);
+// }
+// maplist = DAOImpl.queryEntityRelationList(sql,userId);
+ Map dummy = Maps.newHashMap();
+ dummy.put("id", -1);
+ dummy.put("name", "无");
+ maplist.add(dummy);
+
+ }else if (relationTableName.equalsIgnoreCase("productline")) {
+ String sql = assembleSearchingSQL(roleId, entity);
+ maplist = DAOImpl.queryEntityRelationList(sql);
+
+ }else if (relationTableName.equalsIgnoreCase("product")) {
+ String sql = assembleSearchingSQL(roleId, entity);
+ maplist = DAOImpl.queryEntityRelationList(sql);
+
+ }
+ else if (relationTableName.equalsIgnoreCase("province")) {
+ String sql = assembleSearchingSQL(roleId, entity);
+ logger.debug("d;"+sql);
+ maplist = DAOImpl.queryEntityRelationList(sql);
+
+ }else if(relationTableName.equalsIgnoreCase("alert")){
+ String sql = "select * from alert";
+ maplist = DAOImpl.queryEntityRelationList(sql);
+ }
+ //this.setResponsePage(cls, parameters)
+
+ setResponsePage(new SelectEntryPage(maplist,relationTableName,tragetEntity,excludeId,target));
+
+ }
+ };
+ form.add(new TextField("search_input", new PropertyModel(this, "search_target")));
+ add(form);
+
+
+ // RepeatingView dataRowRepeater = new RepeatingView("dataRowRepeater");
+ // add(dataRowRepeater);
+
+ final List searchableFields = entity.getSearchableFields();
+
+ //初始化的时候查不出数据
+ if (list == null) {
+ list=DAOImpl.queryEntityRelationList("Select * from account where 1=0");
+ }
+
+ final Map tableData = Maps.newHashMap();
+ List ids = Lists.newArrayList();
+ for (Map map : (List) list) {
+ String key = String.valueOf(map.get("id"));
+ ids.add(key);
+ tableData.put(key, map);
+ }
+
+
+
+
+ final PageableListView listview = new PageableListView("dataRowRepeater", ids, 20) {
+
+ @Override
+ protected void populateItem(ListItem item) {
+ String key = item.getDefaultModelObjectAsString();
+ Map map = tableData.get(key);
+ int uid = ((Number) map.get("id")).intValue();
+ String name = (String) map.get("name");
+
+ item.add(new AttributeAppender("data-id",new Model(uid)));
+ item.add(new AttributeAppender("data-name",new Model(name)));
+ item.add(new AttributeAppender("data-ename",relationTableName));
+
+ //item.add(new AttributeAppender("data-cname", new Model(cname)));
+ Label cap = new Label("name_span", new Model(name));
+ item.add(cap);
+
+
+ RepeatingView column_repeater = new RepeatingView("column_repeater");
+ item.add(column_repeater);
+ for(Field f:searchableFields){
+ Object obj = map.get(f.getName());
+ if(!f.getName().equalsIgnoreCase("name") && obj != null){
+ AbstractItem column_item = new AbstractItem(column_repeater.newChildId());
+ column_repeater.add(column_item);
+
+ String celldata =String.valueOf(obj);
+ column_item.add(new Label("celldata",""+f.getDisplay()+": "+celldata).setEscapeModelStrings(false));
+ }
+ }
+
+
+
+ Object obj = map.get("num_of_visiting");
+ if (obj != null) {
+ AbstractItem column_item = new AbstractItem(column_repeater.newChildId());
+ column_repeater.add(column_item);
+ String num_of_visiting = String.valueOf(obj);
+ column_item.add(new Label("celldata", num_of_visiting + "(拜访次数)"));
+ }
+ }
+ };
+
+ add(listview);
+ //PagingNavigator nav = new PagingNavigator("navigator", listview);
+ AjaxPagingNavigator nav =new AjaxPagingNavigator("navigator", listview);
+ nav.setOutputMarkupId(true);
+
+ add(nav);
+ setVersioned(false);
+
+ }
+
+ private String assembleSearchingSQL(final int roleId, final Entity entity) {
+ String sql = entity.getSql();
+ switch(roleId){
+ case 1:
+ sql = entity.getSqlAdmin();
+ break;
+ case 2:
+ sql = entity.getSqlManager();
+ break;
+ case 3:
+ sql = entity.getSql();
+ break;
+ }
+
+ search_target = (search_target==null || search_target.equalsIgnoreCase("*"))? "":search_target;
+
+ List searchableFields = entity.getSearchableFields();
+ String joint = " like '%"+search_target+"%'";
+ String likequery = "";
+ for(Field sf:searchableFields){
+ likequery = likequery + " OR "+ sf.getName() + joint;
+ }
+ if(entity.getName().toString().equals("province")){
+ sql = sql + " where val like '%"+search_target+"%' " + likequery ;
+ }else{
+ sql = sql + " where name like '%"+search_target+"%' " + likequery ;
+ }
+ return sql;
+ }
+}
diff --git a/crm/src/main/java/com/rex/crm/SelectPositionPage.html b/crm/src/main/java/com/rex/crm/SelectPositionPage.html
new file mode 100644
index 0000000..314e368
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/SelectPositionPage.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 选择岗位
+
+
+
+
+
+
+
+
diff --git a/crm/src/main/java/com/rex/crm/SelectPositionPage.java b/crm/src/main/java/com/rex/crm/SelectPositionPage.java
new file mode 100644
index 0000000..48e26c8
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/SelectPositionPage.java
@@ -0,0 +1,61 @@
+package com.rex.crm;
+
+import java.util.List;
+
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.MarkupContainer;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.markup.html.list.AbstractItem;
+import org.apache.wicket.markup.html.panel.Fragment;
+import org.apache.wicket.markup.repeater.RepeatingView;
+import org.apache.wicket.model.Model;
+
+import com.rex.crm.beans.CRMUser;
+import com.rex.crm.beans.UserPosition;
+import com.rex.crm.db.DAOImpl;
+
+public class SelectPositionPage extends WebPage{
+ /**
+ * Constructor
+ */
+ public SelectPositionPage(List list){
+ //遍历数组,添加按钮
+ RepeatingView dataRowRepeater = new RepeatingView("dataRowRepeater");
+ AbstractItem item = new AbstractItem(dataRowRepeater.newChildId());
+ dataRowRepeater.add(item);
+ RepeatingView columnRepeater = new RepeatingView("columnRepeater");
+ SignIn2Session session = (SignIn2Session)getSession();
+ for(UserPosition position:list){
+ //根据岗位ID获取岗位名称
+ CRMUser user = DAOImpl.getCRMUserInfoById(position.getPositionId());
+ if(user.getPl1()==2){
+ continue;
+ }
+ AbstractItem columnitem = new AbstractItem(columnRepeater.newChildId(), new Model());
+ ButtonFragment btnFragment = new ButtonFragment("celldatafield","buttonFragment",this,user.getName(),String.valueOf(position.getPositionId()),user.getRole());
+ columnitem.add(btnFragment);
+ columnRepeater.add(columnitem);
+ }
+ item.add(columnRepeater);
+ add(dataRowRepeater);
+ }
+ private class ButtonFragment extends Fragment {
+
+ public ButtonFragment(String id, String markupId,MarkupContainer markupProvider,String value,final String positionId,final int roleId){
+ super(id, markupId, markupProvider);
+ Link link = new Link("button"){
+ @Override
+ public void onClick() {
+ SignIn2Session session = (SignIn2Session) getSession();
+ session.setPositionId(positionId);
+ session.setRoleId(roleId);
+ setResponsePage(getApplication().getHomePage());
+ }
+ };
+ link.add(new Label("positionName",value));
+ add(link);
+ }
+ }
+}
diff --git a/crm/src/main/java/com/rex/crm/SettingKeyUserInfoPage.html b/crm/src/main/java/com/rex/crm/SettingKeyUserInfoPage.html
new file mode 100644
index 0000000..8ffa1ff
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/SettingKeyUserInfoPage.html
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/crm/src/main/java/com/rex/crm/SettingKeyUserInfoPage.java b/crm/src/main/java/com/rex/crm/SettingKeyUserInfoPage.java
new file mode 100644
index 0000000..178f93d
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/SettingKeyUserInfoPage.java
@@ -0,0 +1,79 @@
+package com.rex.crm;
+
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.behavior.AttributeAppender;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.PasswordTextField;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+
+import com.google.common.collect.Maps;
+import com.rex.crm.beans.UserInfo;
+import com.rex.crm.beans.UserPosition;
+import com.rex.crm.db.DAOImpl;
+
+public class SettingKeyUserInfoPage extends WebPage{
+ private static final long serialVersionUID = -3798004593574047292L;
+ private static final Logger logger = Logger.getLogger(SettingKeyUserInfoPage.class);
+ final Map models = Maps.newHashMap();
+
+ public SettingKeyUserInfoPage(UserInfo userInfo){
+ final int userId = userInfo.getId();
+ final int numOfSign = userInfo.getNum_of_signIn();
+ Form form = new Form("form"){
+ @Override
+ protected void onSubmit() {
+ String phone = models.get("phone").getObject() == null ? null : String.valueOf(models.get("phone").getObject());
+ String email = models.get("email").getObject() == null ? null : String.valueOf(models.get("email").getObject());
+ String password = models.get("newPassword").getObject() == null ? null : String.valueOf(models.get("newPassword").getObject());
+ //修改用户关键信息,并增加登录次数
+ if(DAOImpl.updateKeyUserInfoMessage(phone, email, password,userId)){
+ List positions = DAOImpl.getPositionsByUserId(userId);
+ if(positions.size()>1){
+ setResponsePage(new SelectPositionPage(positions));
+ }else {
+ setResponsePage(getApplication().getHomePage());
+ }
+ DAOImpl.addSignInNumber(userId,numOfSign+1);
+ }
+ }
+ };
+ //根据id获取对象
+ //Userinfo
+ Model textModel = new Model("");
+ TextField phone = new TextField("phone", textModel);
+ phone.add(new AttributeAppender("class","required-field"));
+ phone.add(new AttributeModifier("pattern", new Model("^((\\d{11})|^((\\d{7,8})|(\\d{4}|\\d{3})-(\\d{7,8})|(\\d{4}|\\d{3})-(\\d{7,8})-(\\d{4}|\\d{3}|\\d{2}|\\d{1})|(\\d{7,8})-(\\d{4}|\\d{3}|\\d{2}|\\d{1}))$)")));
+ models.put("phone",textModel);
+ Model emailModel = new Model("");
+ TextField email = new TextField("email", emailModel);
+ email.add(new AttributeAppender("class","required-field"));
+ email.add(new AttributeModifier("type", new Model("email")));
+ models.put("email", emailModel);
+ IModel newPasswordModel = new Model("");
+ PasswordTextField newPassword = new PasswordTextField("newPassword", newPasswordModel);
+ newPassword.add(new AttributeAppender("value", ""));
+ newPassword.add(new AttributeAppender("class","required-field"));
+ models.put("newPassword", newPasswordModel);
+ IModel checkNewPasswordModel = new Model("");
+ PasswordTextField checkPassword = new PasswordTextField("checkNewPassword", checkNewPasswordModel);
+ checkPassword.add(new AttributeAppender("value", ""));
+ checkPassword.add(new AttributeAppender("class","required-field"));
+ models.put("checkNewPassword", checkNewPasswordModel);
+ form.add(new Label("userName",userInfo.getName()));
+ form.add(phone);
+ form.add(email);
+ form.add(newPassword);
+ form.add(checkPassword);
+ add(form);
+ }
+
+}
diff --git a/crm/src/main/java/com/rex/crm/SignIn.html b/crm/src/main/java/com/rex/crm/SignIn.html
new file mode 100755
index 0000000..9d84ed4
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/SignIn.html
@@ -0,0 +1,58 @@
+
+
+
+
+ sign In
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Welcome to E3 crm
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/crm/src/main/java/com/rex/crm/SignIn.java b/crm/src/main/java/com/rex/crm/SignIn.java
new file mode 100755
index 0000000..c9434ab
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/SignIn.java
@@ -0,0 +1,170 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.rex.crm;
+
+import java.util.List;
+
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.PasswordTextField;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.panel.FeedbackPanel;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.util.value.ValueMap;
+
+import com.rex.crm.beans.CRMUser;
+import com.rex.crm.beans.UserInfo;
+import com.rex.crm.beans.UserPosition;
+import com.rex.crm.db.DAOImpl;
+import com.rex.crm.userlog.LogInOut;
+import com.rex.crm.util.CRMUtility;
+
+
+/**
+ * Simple example of a sign in page. It is based on auth-role's SignInPanel which already provides
+ * all what is necessary.
+ *
+ * @author Jonathan Locke
+ */
+public final class SignIn extends WebPage
+{
+ /**
+ * Construct
+ */
+ public SignIn()
+ {
+ //create feedback panel and add to page
+ add(new FeedbackPanel("feedback"));
+ //add sign-in form to page
+ add(new SignInForm("signInForm"));
+
+ }
+ public final class SignInForm extends Form
+ {
+ private static final String USERNAME ="username";
+ private static final String PASSWORD = "password";
+ private final ValueMap properties = new ValueMap();
+ /**
+ * Constructor
+ *
+ * @param id
+ * id of the form component
+ */
+ public SignInForm(final String id)
+ {
+ super(id);
+ add(new TextField(USERNAME,new PropertyModel(properties,USERNAME)));
+ add(new PasswordTextField(PASSWORD,new PropertyModel(properties,PASSWORD)));
+ }
+ /**
+ * sign
+ */
+ @SuppressWarnings("unused")
+ public final void onSubmit()
+ {
+ //get session info
+ SignIn2Session session = getMysession();
+ //clear session user
+ session.setUser(null);
+ //判断用户是否激活密码是否存在
+
+ if("".equals(getUsername())||"".equals(getPassword())){
+ String errmsg = getString("loginError", null, "用户名和密码不能为空!");
+ error(errmsg);
+ }else{
+ UserInfo user = DAOImpl.getUserByLoginName(getUsername());
+ if(null!=user){
+ // Sign the user in
+
+ if (session.signIn(getUsername(),getPassword()))
+ {
+
+ UserPosition userPosition = DAOImpl.getActivityPositionInfoByUserId(Integer.parseInt(session.getUserId()));
+ if(userPosition == null){
+ String errmsg = getString("loginError", null, "无有效岗位!");
+ // Register the error message with the feedback panel
+ error(errmsg);
+ return;
+ }
+ CRMUser crmuser = DAOImpl.getCRMUserInfoById(userPosition.getPositionId());
+ if(crmuser.getPl1()==2){
+ String errmsg = getString("loginError", null, "岗位已失效!");
+ // Register the error message with the feedback panel
+ error(errmsg);
+ return;
+ }
+ session.setPositionId(String.valueOf(userPosition.getPositionId()));
+ session.setLevel(crmuser.getLevel());
+ session.setRoleId(crmuser.getRole());
+
+ //statistic log
+ LogInOut loginout = new LogInOut();
+ loginout.setLoginName(session.getUser());
+ loginout.setLogints(System.currentTimeMillis());
+ loginout.setSessionId(session.getId());
+ CRMUtility.printStat(CRMUtility.STAT_LOG_IN_OUT,loginout,LogInOut.class);
+
+
+
+ if(user.getNum_of_signIn()==0){
+ setResponsePage(new SettingKeyUserInfoPage(user));
+ }else{
+ //根据userId查找用户岗位。如果岗位有多个则选择岗位
+ List positions = DAOImpl.getPositionsByUserId(user.getId());
+ if(positions.size()>1){
+ setResponsePage(new SelectPositionPage(positions));
+ }else {
+ if(session.getPositionId().equals(-1)){
+ setResponsePage(new NullPosition(null));
+ }
+ setResponsePage(getApplication().getHomePage());
+ }
+ DAOImpl.addSignInNumber(user.getId(),user.getNum_of_signIn()+1);
+ }
+ }
+ else
+ {
+ // Get the error message from the properties file associated with the Component
+ String errmsg = getString("loginError", null, "用户名或密码错误!");
+ // Register the error message with the feedback panel
+ error(errmsg);
+ }
+
+ }else{
+ String errmsg = getString("loginError", null, "用户名不存在!");
+ error(errmsg);
+ }
+ }
+ }
+ /**
+ * @return
+ */
+ private String getUsername()
+ {
+ return properties.getString(USERNAME);
+ }
+ private String getPassword()
+ {
+ return properties.getString(PASSWORD);
+ }
+ private SignIn2Session getMysession()
+ {
+ return (SignIn2Session)getSession();
+ }
+
+ }
+}
diff --git a/crm/src/main/java/com/rex/crm/SignIn2Session.java b/crm/src/main/java/com/rex/crm/SignIn2Session.java
new file mode 100755
index 0000000..7cd71d7
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/SignIn2Session.java
@@ -0,0 +1,135 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.rex.crm;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+import org.apache.wicket.authroles.authentication.AuthenticatedWebSession;
+import org.apache.wicket.authroles.authorization.strategies.role.Roles;
+import org.apache.wicket.request.Request;
+
+import com.rex.crm.beans.CRMUser;
+import com.rex.crm.beans.UserInfo;
+import com.rex.crm.beans.UserPosition;
+import com.rex.crm.db.DAOImpl;
+import com.rex.crm.db.model.Crmuser;
+
+/**
+ * Session class for signin example. Holds and authenticates users.
+ *
+ * @author Jonathan Locke
+ */
+public final class SignIn2Session extends AuthenticatedWebSession
+{
+ /** Trivial user representation */
+ private String user;
+ private String userId;
+ private int roleId;
+ private String positionId;
+ private int level;
+
+ /**
+ * Constructor
+ *
+ * @param request
+ * The current request object
+ */
+ protected SignIn2Session(Request request)
+ {
+ super(request);
+
+ }
+ /**
+ * Checks the given username and password, returning a User object if if the username and
+ * password identify a valid user.
+ *
+ * @param username
+ * The username
+ * @param password
+ * The password
+ * @return True if the user was authenticated
+ */
+ @Override
+ public final boolean authenticate(final String username, final String password)
+ {
+ if (user == null)
+ {
+
+ UserInfo userinfo = DAOImpl.login(username, password);
+
+ if(userinfo!=null && userinfo.getId() != 0){
+ user = userinfo.getName();
+ userId = String.valueOf(userinfo.getId());
+
+ }
+ }
+ return user != null;
+ }
+ /**
+ * @see org.apache.wicket.authentication.AuthenticatedWebSession#getRoles()
+ */
+ @Override
+ public Roles getRoles()
+ {
+ if (isSignedIn())
+ {
+ // If the user is signed in, they have these roles
+ return new Roles(Roles.ADMIN);
+ }
+ return null;
+ }
+ /**
+ * @return User
+ */
+ public String getUser()
+ {
+ return user;
+ }
+
+ public String getUserId() {
+ return userId;
+ }
+
+ public void setUserId(String userId) {
+ this.userId = userId;
+ }
+
+ public int getRoleId() {
+ return roleId;
+ }
+
+ public void setRoleId(int roleId) {
+ this.roleId = roleId;
+ }
+
+ public void setUser(String user) {
+ this.user = user;
+ }
+ public String getPositionId() {
+ return positionId;
+ }
+ public void setPositionId(String positionId) {
+ this.positionId = positionId;
+ }
+ public int getLevel() {
+ return level;
+ }
+ public void setLevel(int level) {
+ this.level = level;
+ }
+}
diff --git a/crm/src/main/java/com/rex/crm/SignOut.html b/crm/src/main/java/com/rex/crm/SignOut.html
new file mode 100755
index 0000000..e6b6dd8
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/SignOut.html
@@ -0,0 +1,11 @@
+
+
+ 登出
+
+
+
+
+ 再见!
+ 回主页
+
+
diff --git a/crm/src/main/java/com/rex/crm/SignOut.java b/crm/src/main/java/com/rex/crm/SignOut.java
new file mode 100755
index 0000000..38dcdba
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/SignOut.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.rex.crm;
+
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+
+/**
+ * Simple logout page.
+ *
+ * @author Jonathan Locke
+ */
+public class SignOut extends WebPage
+{
+ /**
+ * Constructor
+ *
+ * @param parameters
+ * Page parameters (ignored since this is the home page)
+ */
+ public SignOut(final PageParameters parameters)
+ {
+ getSession().invalidate();
+ }
+}
diff --git a/crm/src/main/java/com/rex/crm/TemplatePage.html b/crm/src/main/java/com/rex/crm/TemplatePage.html
new file mode 100755
index 0000000..17d745c
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/TemplatePage.html
@@ -0,0 +1,140 @@
+
+
+
+
+
+
+
+ title
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/crm/src/main/java/com/rex/crm/TemplatePage.java b/crm/src/main/java/com/rex/crm/TemplatePage.java
new file mode 100755
index 0000000..6cfa7da
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/TemplatePage.java
@@ -0,0 +1,401 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.rex.crm;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.log4j.Logger;
+import org.apache.wicket.Component;
+import org.apache.wicket.behavior.AbstractAjaxBehavior;
+import org.apache.wicket.markup.head.IHeaderResponse;
+import org.apache.wicket.markup.head.JavaScriptHeaderItem;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.request.cycle.RequestCycle;
+import org.apache.wicket.request.handler.TextRequestHandler;
+import org.apache.wicket.request.http.WebRequest;
+import org.apache.wicket.util.template.PackageTextTemplate;
+import org.apache.wicket.behavior.AttributeAppender;
+
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Lists;
+import com.google.gson.Gson;
+import com.rex.crm.admin.AdminTreePage;
+import com.rex.crm.admin.DataImportPage;
+import com.rex.crm.admin.DownloadPage;
+import com.rex.crm.admin.ImportLogPage;
+import com.rex.crm.admin.MergePage;
+import com.rex.crm.admin.PositionPage;
+import com.rex.crm.admin.PositionTreePage;
+import com.rex.crm.admin.ProductPage;
+import com.rex.crm.admin.ProductTreePage;
+import com.rex.crm.admin.ReportPage;
+import com.rex.crm.admin.UploadPage;
+import com.rex.crm.admin.UserPage;
+import com.rex.crm.admin.UserPositionPage;
+import com.rex.crm.ajax.DataProvider;
+import com.rex.crm.ajax.FunctionClass;
+import com.rex.crm.ajax.FunctionInvoker;
+import com.rex.crm.beans.UserInfo;
+import com.rex.crm.db.DAOImpl;
+import com.rex.crm.userlog.LogInOut;
+import com.rex.crm.util.CRMUtility;
+
+/**
+ *
+ * @author Feiyun Zhou
+ */
+public abstract class TemplatePage extends AuthenticatedWebPage {
+ /** title of the current page. */
+ private String pageTitle = "TemplatePageTest";
+ private static final Logger logger = Logger.getLogger(TemplatePage.class);
+
+ protected static ImmutableMap pageMenuMap;
+
+ static{
+ //TODO Load them from configuration
+ ImmutableMap.Builder builder = new ImmutableMap.Builder();
+ MenuItem item = new MenuItem();
+ item.setCaption(" 主页");
+ item.setDestination(HomePage.class);
+ item.setId("navitem-homepage");
+ builder.put("home", item);
+
+ item = new MenuItem();
+ item.setCaption(" 医院");
+ item.setDestination(AccountPage.class);
+ item.setId("navitem-account");
+ builder.put("account", item);
+
+ item = new MenuItem();
+ item.setCaption(" 医生");
+ item.setDestination(ContactPage.class);
+ item.setId("navitem-contact");
+ builder.put("contact", item);
+
+ item = new MenuItem();
+ item.setCaption(" 日历");
+ item.setDestination(CalendarPage.class);
+ item.setId("navitem-calendar");
+ builder.put("calendar", item);
+
+
+ item = new MenuItem();
+ item.setCaption("拜访");
+ item.setDestination(ActivityPage.class);
+ item.setId("navitem-activity");
+ builder.put("activity", item);
+
+ item = new MenuItem();
+ item.setCaption("辅导");
+ item.setDestination(CoachingPage.class);
+ item.setId("navitem-coaching");
+ builder.put("coaching", item);
+
+ pageMenuMap = builder.build();
+
+ }
+ /**
+ * Constructor
+ */
+ public TemplatePage() {
+
+ final int roleId = ((SignIn2Session) getSession()).getRoleId();
+ add(new Label("title", new PropertyModel(this, "pageTitle")));
+ UserInfo user = DAOImpl.getUserInfoById(Integer.parseInt(((SignIn2Session) getSession()).getUserId()));
+
+ //TODO get function work with real id
+ List menulist = DAOImpl.getMenuByRole(roleId);
+
+ //populate menu items. TODO componentize it. pass arg: menuList
+ ArrayList menu = Lists.newArrayList();
+ for(String key:menulist){
+ menu.add(pageMenuMap.get(key));
+ }
+
+ //@SuppressWarnings("unchecked")
+ ListView lv = new ListView("menu", menu) {
+ @Override
+ protected void populateItem(ListItem item) {
+ MenuItem menuitem = (MenuItem) item.getModelObject();
+ BookmarkablePageLink link = new BookmarkablePageLink("link", menuitem.getDestination());
+ link.add(new Label("caption", menuitem.getCaption()).setEscapeModelStrings(false));
+ item.add(link);
+ item.add(new AttributeAppender("id", Model.of(menuitem.getId())));
+ // item.add(new SimpleAttributeModifier("class", "my-css-class"));
+
+ }
+ };
+ add(lv);
+
+ add(new Link("signout_link"){
+
+ @Override
+ public void onClick() {
+ SignIn2Session session = (SignIn2Session) getSession();
+ LogInOut loginout = new LogInOut();
+ loginout.setLoginName(session.getUser());
+ loginout.setLogints(System.currentTimeMillis());
+ loginout.setSessionId(session.getId());
+ CRMUtility.printStat(CRMUtility.STAT_LOG_IN_OUT,loginout,LogInOut.class);
+ session.invalidate();
+ this.setResponsePage(SignIn.class);
+ }
+
+ });
+
+
+ BookmarkablePageLink user_settings_link = new BookmarkablePageLink("user_settings_link",UserDeatialInfo.class);
+ add(user_settings_link);
+ user_settings_link.add(new Label("loginName",user.getName()));
+
+
+ WebMarkupContainer admin_menu = new WebMarkupContainer("admin_menu");
+ add(admin_menu);
+ BookmarkablePageLink adminTreePage = new BookmarkablePageLink("adminTreePage",AdminTreePage.class );
+ admin_menu.add(adminTreePage);
+
+// BookmarkablePageLink positionTreePage = new BookmarkablePageLink("positionTreePage",PositionTreePage.class );
+// admin_menu.add(positionTreePage);
+
+ BookmarkablePageLink productTreePage = new BookmarkablePageLink("productTreePage",ProductTreePage.class );
+ admin_menu.add(productTreePage);
+
+ BookmarkablePageLink positionPage = new BookmarkablePageLink("positionPage",PositionPage.class );
+ admin_menu.add(positionPage);
+
+// BookmarkablePageLink reportPage = new BookmarkablePageLink("reportPage",ReportPage.class );
+// admin_menu.add(reportPage);
+
+// BookmarkablePageLink downloadPage = new BookmarkablePageLink("downloadPage",DownloadPage.class );
+// admin_menu.add(downloadPage);
+
+ BookmarkablePageLink userPage = new BookmarkablePageLink("userPage",UserPage.class );
+ admin_menu.add(userPage);
+
+ BookmarkablePageLink userPositionPage = new BookmarkablePageLink("userPositionPage",UserPositionPage.class );
+ admin_menu.add(userPositionPage);
+
+// BookmarkablePageLink productPage = new BookmarkablePageLink("productPage",ProductPage.class );
+// admin_menu.add(productPage);
+
+ BookmarkablePageLink dataImportPage = new BookmarkablePageLink("dataImportPage",DataImportPage.class );
+ admin_menu.add(dataImportPage);
+ BookmarkablePageLink alertPage = new BookmarkablePageLink("alertPage",AlertPage.class );
+ admin_menu.add(alertPage);
+
+ BookmarkablePageLink areaPage = new BookmarkablePageLink("areaPage",AreaPage.class );
+ admin_menu.add(areaPage);
+//
+// BookmarkablePageLink applicationPage = new BookmarkablePageLink("applicationPage",AreaPage.class );
+// admin_menu.add(applicationPage);
+//
+// BookmarkablePageLink flowPage = new BookmarkablePageLink("flowPage",AreaPage.class );
+// admin_menu.add(flowPage);
+//
+// BookmarkablePageLink jurisdictionPage = new BookmarkablePageLink("jurisdictionPage",AreaPage.class );
+// admin_menu.add(jurisdictionPage);
+//
+// BookmarkablePageLink contentPage = new BookmarkablePageLink("contentPage",AreaPage.class );
+// admin_menu.add(contentPage);
+//
+// BookmarkablePageLink integrationPage = new BookmarkablePageLink("integrationPage",AreaPage.class );
+// admin_menu.add(integrationPage);
+
+ BookmarkablePageLink importLogPage = new BookmarkablePageLink("importLog",ImportLogPage.class );
+ admin_menu.add(importLogPage);
+
+// BookmarkablePageLink merge_data = new BookmarkablePageLink("merge_data",MergePage.class );
+// admin_menu.add(merge_data);
+
+ admin_menu.setVisible(false);
+ if(roleId == 1) admin_menu.setVisible(true);
+
+ //end of populate menu items
+
+ AbstractAjaxBehavior ajaxBehaviour = new AbstractAjaxBehavior() {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void onRequest() {
+ RequestCycle requestCycle = RequestCycle.get();
+ readRequestData(requestCycle);
+ }
+
+ private void readRequestData(final RequestCycle requestCycle) {
+ WebRequest wr = (WebRequest) requestCycle.getRequest();
+
+ HttpServletRequest hsr = (HttpServletRequest) wr
+ .getContainerRequest();
+ String response = "{}";
+ try {
+ BufferedReader br = hsr.getReader();
+
+ String jsonString = br.readLine();
+ if ((jsonString == null) || jsonString.isEmpty()) {
+ logger.debug(" no json found");
+ } else {
+ logger.debug(" json is :" + jsonString);
+ }
+ FunctionClass method = new Gson().fromJson(jsonString,
+ FunctionClass.class);
+
+ FunctionInvoker invoker = new FunctionInvoker(
+ DataProvider.class);
+ System.out.println(" method:" + method);
+ response = (String) invoker.invoke(method.getF(),
+ method.getP());
+ System.out.println("response:"+response);
+
+ br.close();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ requestCycle.replaceAllRequestHandlers(new TextRequestHandler(
+ "application/json", "UTF-8", response));
+
+ }
+
+ @Override
+ public void renderHead(Component component, IHeaderResponse response) {
+ super.renderHead(component, response);
+
+ final String posId = ((SignIn2Session)getSession()).getPositionId();
+ String callbackUrl = getCallbackUrl().toString();
+
+ Map map = new HashMap<>();
+ map.put("userInfo",DataProvider.getCRMUserInfoById(new String[]{posId}));
+ map.put("ajaxURL", callbackUrl);
+ //map.put("allUsers", DataProvider.getAllCRMUsers(new String[0]));
+ //map.put("allAccounts", DataProvider.getAllAccounts(new String[0]));
+ map.put("context_name",getRootContext());
+
+ PackageTextTemplate ptt = new PackageTextTemplate(getClass(),"template.js");
+ //System.out.println(ptt.asString(map));
+ response.render(JavaScriptHeaderItem.forScript(ptt.asString(map), null));
+ try {
+ ptt.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ }
+ };
+ add(ajaxBehaviour);
+
+ }
+
+ public static String getRootContext(){
+
+ String rootContext = "";
+
+ WebApplication webApplication = WebApplication.get();
+
+ if(webApplication!=null){
+ ServletContext servletContext = webApplication.getServletContext();
+ if(servletContext!=null){
+ rootContext = servletContext.getServletContextName();
+ }else{
+ //do nothing
+ }
+ }else{
+ //do nothing
+ }
+
+ return rootContext;
+
+ }
+
+ /**
+ * Gets the title.
+ *
+ * @return title
+ */
+ public final String getPageTitle() {
+ return pageTitle;
+ }
+
+ /**
+ * Sets the title.
+ *
+ * @param title
+ * title
+ */
+ public final void setPageTitle(String title) {
+ pageTitle = title;
+ }
+}
+
+class MenuItem implements IModel {
+ /** the caption of the menu item */
+ private String caption;
+ /** the (bookmarkable) page the menu item links to */
+ private Class destination;
+ private String id;
+
+ public String getCaption() {
+ return caption;
+ }
+ public void setCaption(String caption) {
+ this.caption = caption;
+ }
+ public Class getDestination() {
+ return destination;
+ }
+ public void setDestination(Class destination) {
+ this.destination = destination;
+ }
+ @Override
+ public void detach() {
+ // TODO Auto-generated method stub
+
+ }
+ @Override
+ public Object getObject() {
+ // TODO Auto-generated method stub
+ return this;
+ }
+ @Override
+ public void setObject( Object item) {
+ this.caption = ((MenuItem)item).getCaption();
+ this.destination = ((MenuItem)item).getDestination();
+
+ }
+ public String getId() {
+ return id;
+ }
+ public void setId(String id) {
+ this.id = id;
+ }
+}
\ No newline at end of file
diff --git a/crm/src/main/java/com/rex/crm/UpdateSignPassword.html b/crm/src/main/java/com/rex/crm/UpdateSignPassword.html
new file mode 100644
index 0000000..3bb82ff
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/UpdateSignPassword.html
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/crm/src/main/java/com/rex/crm/UpdateSignPassword.java b/crm/src/main/java/com/rex/crm/UpdateSignPassword.java
new file mode 100644
index 0000000..070e48a
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/UpdateSignPassword.java
@@ -0,0 +1,105 @@
+package com.rex.crm;
+
+import java.util.Map;
+
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.log4j.Logger;
+import org.apache.wicket.behavior.AttributeAppender;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.PasswordTextField;
+import org.apache.wicket.markup.html.list.AbstractItem;
+import org.apache.wicket.markup.repeater.RepeatingView;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+
+import com.google.common.collect.Maps;
+import com.rex.crm.beans.CRMUser;
+import com.rex.crm.beans.UserInfo;
+import com.rex.crm.db.DAOImpl;
+
+public class UpdateSignPassword extends UserInfoSettingPage {
+
+ private static final long serialVersionUID = -317099683219015628L;
+ private static final Logger logger = Logger.getLogger(UpdateSignPassword.class);
+ final Map models = Maps.newHashMap();
+
+ public UpdateSignPassword() {
+ initPage();
+ setPageTitle("修改密码");
+ }
+
+ public void initPage() {
+ //获取到登录对象,将用户名传入页面,然后如何获取
+ final int userId = Integer.parseInt(((SignIn2Session) getSession()).getUserId());
+ UserInfo user = DAOImpl.getUserInfoById(userId);
+ //add prompt
+ final RepeatingView errordiv = new RepeatingView("errorpromptDiv");
+ final AbstractItem errorgroup = new AbstractItem(errordiv.newChildId());
+ final Label errorpromptButton = new Label("errorpromptButton","X");
+ errorgroup.add(errorpromptButton);
+ final Label errorpromptLabel = new Label("errorprompt","提示:旧密码输入错误!");
+ errorgroup.add(errorpromptLabel);
+ errordiv.add(new AttributeAppender("style",new Model("display:none"),";"));
+ errorgroup.add(new AttributeAppender("style",new Model("display:none"),";"));
+ errordiv.add(errorgroup);
+ add(errordiv);
+ //add prompt
+ final RepeatingView div = new RepeatingView("promptDiv");
+ final AbstractItem group = new AbstractItem(div.newChildId());
+ final Label promptButton = new Label("promptButton","X");
+ group.add(promptButton);
+ final Label promptLabel = new Label("prompt","提示:操作已成功!");
+ group.add(promptLabel);
+ div.add(new AttributeAppender("style",new Model("display:none"),";"));
+ group.add(new AttributeAppender("style",new Model("display:none"),";"));
+ div.add(group);
+ add(div);
+ Form form = new Form("form") {
+ @Override
+ protected void onSubmit() {
+ //首先获取form表单数据。验证旧密码是否正确。然后修改密码
+ String oldPassword = models.get("oldPassword").getObject() == null ? null : String.valueOf(models.get("oldPassword").getObject());
+ String newPassword = models.get("newPassword").getObject() == null ? null : String.valueOf(models.get("newPassword").getObject());
+ UserInfo crmUser = DAOImpl.getUserInfoById(Integer.parseInt(((SignIn2Session) getSession()).getUserId()));
+ logger.debug("oldPwd:" + oldPassword);
+ logger.debug("old:" + DigestUtils.md5Hex(oldPassword));
+ logger.debug("password:" + crmUser.getPassword());
+ //判断旧密码是否正确,修改密码
+ if (DigestUtils.md5Hex(oldPassword).equals(crmUser.getPassword())) {
+ logger.debug("true");
+ //修改密码
+ if (DAOImpl.updateCrmUserPassword(userId, newPassword)) {
+ div.add(new AttributeAppender("style",new Model("display:block"),";"));
+ group.add(new AttributeAppender("style",new Model("display:block"),";"));
+ promptLabel.add(new AttributeAppender("style",new Model("display:block"),";"));
+ promptButton.add(new AttributeAppender("style",new Model("display:block"),";"));
+ }
+ } else {
+ logger.debug("false");
+ errordiv.add(new AttributeAppender("style",new Model("display:block"),";"));
+ errorgroup.add(new AttributeAppender("style",new Model("display:block"),";"));
+ errorpromptLabel.add(new AttributeAppender("style",new Model("display:block"),";"));
+ errorpromptButton.add(new AttributeAppender("style",new Model("display:block"),";"));
+ }
+ }
+ };
+ add(form);
+ form.add(new Label("userName", user.getName()));
+ IModel textModel = new Model("");
+ PasswordTextField oldPassword = new PasswordTextField("oldPassword", textModel);
+ oldPassword.add(new AttributeAppender("value", ""));
+ models.put("oldPassword", textModel);
+ IModel newPasswordModel = new Model("");
+ PasswordTextField newPassword = new PasswordTextField("newPassword", newPasswordModel);
+ newPassword.add(new AttributeAppender("value", ""));
+ models.put("newPassword", newPasswordModel);
+ IModel checkNewPasswordModel = new Model("");
+ PasswordTextField checkPassword = new PasswordTextField("checkNewPassword", checkNewPasswordModel);
+ checkPassword.add(new AttributeAppender("value", ""));
+ models.put("checkNewPassword", checkNewPasswordModel);
+ form.add(oldPassword);
+ form.add(newPassword);
+ form.add(checkPassword);
+ }
+}
diff --git a/crm/src/main/java/com/rex/crm/UserDeatialInfo.html b/crm/src/main/java/com/rex/crm/UserDeatialInfo.html
new file mode 100644
index 0000000..9365f26
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/UserDeatialInfo.html
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/crm/src/main/java/com/rex/crm/UserDeatialInfo.java b/crm/src/main/java/com/rex/crm/UserDeatialInfo.java
new file mode 100644
index 0000000..04c80c6
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/UserDeatialInfo.java
@@ -0,0 +1,279 @@
+package com.rex.crm;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.MarkupContainer;
+import org.apache.wicket.behavior.AttributeAppender;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.list.AbstractItem;
+import org.apache.wicket.markup.html.panel.Fragment;
+import org.apache.wicket.markup.repeater.RepeatingView;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.rex.crm.beans.CRMUser;
+import com.rex.crm.beans.Choice;
+import com.rex.crm.beans.UserInfo;
+import com.rex.crm.common.Entity;
+import com.rex.crm.common.Field;
+import com.rex.crm.db.DAOImpl;
+import com.rex.crm.util.CRMUtility;
+import com.rex.crm.util.Configuration;
+
+public class UserDeatialInfo extends UserInfoSettingPage {
+
+ private static final long serialVersionUID = 7459440666591284026L;
+ private static final Logger logger = Logger.getLogger(UserDeatialInfo.class);
+ final Map fieldNameToModel = Maps.newHashMap();
+ final Map models = Maps.newHashMap();
+ //设置显示行数
+ private int number_of_column = 1;
+
+ /**
+ * Contract
+ */
+ public UserDeatialInfo() {
+ logger.debug("init userManager");
+ setPageTitle("个人信息");
+ initPage("");
+ }
+ public UserDeatialInfo(String result){
+ logger.debug("init userManager");
+ setPageTitle("个人信息");
+ initPage(result);
+ }
+ private void initPage(String result) {
+ logger.debug("sessionID:" + ((SignIn2Session) getSession()).getUserId());
+ int userId = Integer.parseInt(((SignIn2Session) getSession()).getUserId());
+ Entity entity = Configuration.getEntityByName("userinfo");
+ String primaryKeyName = entity.getPrimaryKeyName();
+ //get crmUser
+ UserInfo user = DAOImpl.getUserInfoById(userId);
+ //add prompt
+ final RepeatingView div = new RepeatingView("promptDiv");
+ final AbstractItem group = new AbstractItem(div.newChildId());
+ final Label promptButton = new Label("promptButton","X");
+ group.add(promptButton);
+ final Label promptLabel = new Label("prompt","提示:操作已成功!");
+ group.add(promptLabel);
+ if("".equals(result)||"failure".equals(result)){
+ div.add(new AttributeAppender("style",new Model("display:none"),";"));
+ group.add(new AttributeAppender("style",new Model("display:none"),";"));
+ }
+ div.add(group);
+ add(div);
+ //add prompt
+ final RepeatingView errordiv = new RepeatingView("alertDiv");
+ final AbstractItem errorgroup = new AbstractItem(div.newChildId());
+ final Label errorpromptButton = new Label("alertButton","X");
+ errorgroup.add(errorpromptButton);
+ final Label errorpromptLabel = new Label("alert","提示:用户登录名已存在!");
+ errorgroup.add(errorpromptLabel);
+ if("".equals(result)||"success".equals(result)){
+ errordiv.add(new AttributeAppender("style",new Model("display:none"),";"));
+ errorgroup.add(new AttributeAppender("style",new Model("display:none"),";"));
+ }
+ errordiv.add(errorgroup);
+ add(errordiv);
+ final List fieldNames = Lists.newArrayList();
+ //得到基本信息信息
+ RepeatingView fieldGroupRepeater = new RepeatingView("fieldGroupRepeater");
+ add(fieldGroupRepeater);
+ List groupfields = new ArrayList();
+ List fields = entity.getFields();
+ for (Field f : fields) {
+ if (f.isBaseInfo() == true) {
+ groupfields.add(f);
+ }
+ }
+ AbstractItem groupitem = new AbstractItem(fieldGroupRepeater.newChildId());
+ fieldGroupRepeater.add(groupitem);
+ RepeatingView dataRowRepeater = new RepeatingView("dataRowRepeater");
+ groupitem.add(dataRowRepeater);
+ int numOfField = 0;
+ List visibleFields = Lists.newArrayList();
+ for (Field f : groupfields) {
+ if (!f.isVisible()) {
+ continue;
+ }
+ numOfField++;
+ visibleFields.add(f);
+ }
+ logger.debug("numOfField:" + numOfField);
+ int num_of_row = (numOfField / number_of_column);
+ for (int i = 0; i < num_of_row; i++) {
+ AbstractItem item = new AbstractItem(dataRowRepeater.newChildId());
+ dataRowRepeater.add(item);
+ //添加了一行
+ RepeatingView columnRepeater = new RepeatingView("columnRepeater");
+ item.add(columnRepeater);
+ //行内添加两列元素
+ for (int j = 0; j < 2 * number_of_column; j++) {
+ AbstractItem columnitem = new AbstractItem(columnRepeater.newChildId(), new Model(String.valueOf(primaryKeyName)));
+ Field currentField = visibleFields.get(i * number_of_column + j / 2);
+ if (j % 2 == 0) {
+ columnitem.add(new TextFragment("editdata", "textFragment", this, currentField.getDisplay() + ":"));
+ if (currentField.isRequired()) {
+ columnitem.add(new AttributeAppender("class", new Model("tag"), " ")).add(new AttributeAppender("style", new Model("color:red"), ";"));
+ }else{
+ columnitem.add(new AttributeAppender("class", new Model("tag"), " "));
+ }
+ fieldNames.add(currentField.getName());
+ } else {
+ String fieldName = null;
+ if (currentField.getName().equals("name")) {
+ fieldName = user.getName();
+ } else if (currentField.getName().equalsIgnoreCase("cellPhone")) {
+ fieldName = user.getCellPhone();
+ } else if (currentField.getName().equals("loginName")) {
+ fieldName = user.getLoginName();
+ } else if (currentField.getName().equals("sex")) {
+ fieldName = "" + user.getSex();
+ } else if (currentField.getName().equals("office_tel")){
+ fieldName = "" + user.getOffice_tel();
+ }else {
+ fieldName = user.getEmail();
+ }
+ if (currentField.getName().equals("sex")) {
+ List pickList = DAOImpl.queryPickList(currentField.getPicklist());
+ Map list = Maps.newHashMap();
+ List ids = Lists.newArrayList();
+ for (Choice p : pickList) {
+ list.put(p.getId(), p.getVal());
+ ids.add(p.getId());
+ }
+ IModel choiceModel = new Model(Long.parseLong("" + user.getSex()));
+ models.put(currentField.getName(), choiceModel);
+ fieldNameToModel.put(currentField.getName(), choiceModel);
+ columnitem.add(new DropDownChoiceFragment("editdata", "dropDownFragment", this, ids, list, choiceModel));
+ } else {
+ IModel textModel = new Model("");
+ models.put(CRMUtility.formatValue(currentField.getFormatter(), String.valueOf(fieldName)), textModel);
+ fieldNameToModel.put(currentField.getName(), textModel);
+ columnitem.add(new TextInputFragment("editdata", "textInputFragment", this, textModel, fieldName, currentField));
+ }
+ }
+ columnRepeater.add(columnitem);
+ }
+ }
+ //add user photo
+ //create edit userForm
+
+ Form form = new Form("form") {
+ @Override
+ protected void onSubmit() {
+ logger.debug("the form was submitted!");
+ String userName = "";
+ String cellPhone = "";
+ String email = "";
+ String photo = "";
+ String loginName = "";
+ String office = "";
+ int sex = 0;
+ for (String k : fieldNameToModel.keySet()) {
+ logger.debug("k" + k);
+ String value = fieldNameToModel.get(k).getObject() == null ? null : String.valueOf(fieldNameToModel.get(k).getObject());
+ if (k.equals("name")) {
+ userName = value;
+ } else if (k.equals("cellPhone")) {
+ cellPhone = value;
+ } else if (k.equals("photo")) {
+ photo = value;
+ } else if (k.equals("sex")) {
+ sex = Integer.parseInt(value);
+ } else if (k.equals("loginName")) {
+ loginName = value;
+ } else if(k.equals("email")){
+ email = value;
+ }else if(k.equals("office_tel")){
+ office = value;
+ }
+ }
+ int userId = Integer.parseInt(((SignIn2Session) getSession()).getUserId());
+ UserInfo userinfo = DAOImpl.getUserInfoById(userId);
+ List loginNames =DAOImpl.getLoginNames(String.valueOf(userId));
+ if(loginNames.contains(loginName)){
+ errordiv.add(new AttributeAppender("style",new Model("display:block"),";"));
+ errorgroup.add(new AttributeAppender("style",new Model("display:block"),";"));
+ errorpromptLabel.add(new AttributeAppender("style",new Model("display:block"),";"));
+ errorpromptButton.add(new AttributeAppender("style",new Model("display:block"),";"));
+ setResponsePage(new UserDeatialInfo("failure"));
+ }else{
+ if(DAOImpl.updateStatusOfInternalMeeting(userId, userName, cellPhone, email, photo, sex, loginName,office)){
+ div.add(new AttributeAppender("style",new Model("display:block"),";"));
+ group.add(new AttributeAppender("style",new Model("display:block"),";"));
+ promptLabel.add(new AttributeAppender("style",new Model("display:block"),";"));
+ promptButton.add(new AttributeAppender("style",new Model("display:block"),";"));
+ setResponsePage(new UserDeatialInfo("success"));
+ };
+ }
+ }
+ };
+ form.add(fieldGroupRepeater);
+ add(form);
+ }
+
+ private class TextInputFragment extends Fragment {
+
+ public TextInputFragment(String id, String markupId,
+ MarkupContainer markupProvider, IModel model, String value, Field currentField) {
+ super(id, markupId, markupProvider);
+ TextField text = new TextField("input", model);
+ text.add(new AttributeModifier("value", new Model(value)));
+ if (!currentField.isEditable()) {
+ text.add(new AttributeAppender("disabled", new Model("disabled"), ";"));
+ }
+ if (currentField.isRequired()) {
+ //text.add(new AttributeModifier("required", new Model("required")));
+ text.add(new AttributeAppender("class",new Model("required-field")," "));
+ }
+ if (currentField.getDataType().equals("tel") || currentField.getDataType().equals("fax")) {
+ text.add(new AttributeModifier("pattern", new Model("^((\\d{11})|^((\\d{7,8})|(\\d{4}|\\d{3})-(\\d{7,8})|(\\d{4}|\\d{3})-(\\d{7,8})-(\\d{4}|\\d{3}|\\d{2}|\\d{1})|(\\d{7,8})-(\\d{4}|\\d{3}|\\d{2}|\\d{1}))$)")));
+ }
+ text.add(new AttributeModifier("type", new Model(currentField.getDataType())));
+ text.add(new AttributeModifier("id", new Model(currentField.getName())));
+ add(text);
+ }
+ }
+
+ private class TextFragment extends Fragment {
+
+ public TextFragment(String id, String markupId,
+ MarkupContainer markupProvider, String label) {
+ super(id, markupId, markupProvider);
+ add(new Label("celldata", label));
+ }
+ }
+
+ private class DropDownChoiceFragment extends Fragment {
+
+ public DropDownChoiceFragment(String id, String markupId,
+ MarkupContainer markupProvider, final List ids,
+ final Map list, IModel model) {
+ super(id, markupId, markupProvider);
+ add(new DropDownChoice("dropDownInput", model, ids,
+ new IChoiceRenderer() {
+ @Override
+ public Object getDisplayValue(Long id) {
+ // TODO Auto-generated method stub
+ return list.get(id);
+ }
+
+ @Override
+ public String getIdValue(Long id, int index) {
+ return String.valueOf(id);
+ }
+ }));
+ }
+ }
+}
diff --git a/crm/src/main/java/com/rex/crm/UserInfoSettingPage.html b/crm/src/main/java/com/rex/crm/UserInfoSettingPage.html
new file mode 100644
index 0000000..20f30f8
--- /dev/null
+++ b/crm/src/main/java/com/rex/crm/UserInfoSettingPage.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+