Browse Source

后台整合

jun.zhou 8 years ago
commit
f8fc6ce5fb
100 changed files with 9992 additions and 0 deletions
  1. 34 0
      .classpath
  2. 1 0
      .gitignore
  3. 38 0
      .project
  4. 12 0
      .settings/.jsdtscope
  5. 2 0
      .settings/org.eclipse.core.resources.prefs
  6. 13 0
      .settings/org.eclipse.jdt.core.prefs
  7. 2 0
      .settings/org.eclipse.jdt.ui.prefs
  8. 4 0
      .settings/org.eclipse.m2e.core.prefs
  9. 12 0
      .settings/org.eclipse.wst.common.component
  10. 12 0
      .settings/org.eclipse.wst.common.component.bak
  11. 7 0
      .settings/org.eclipse.wst.common.project.facet.core.xml
  12. 1 0
      .settings/org.eclipse.wst.jsdt.ui.superType.container
  13. 1 0
      .settings/org.eclipse.wst.jsdt.ui.superType.name
  14. 2 0
      .settings/org.eclipse.wst.validation.prefs
  15. 2 0
      .settings/org.eclipse.wst.ws.service.policy.prefs
  16. 0 0
      README
  17. 291 0
      pom.xml
  18. 174 0
      src/main/java/com/cloudcross/ssp/back/model/Account.java
  19. 33 0
      src/main/java/com/cloudcross/ssp/back/model/AccountResources.java
  20. 66 0
      src/main/java/com/cloudcross/ssp/back/model/Acls.java
  21. 335 0
      src/main/java/com/cloudcross/ssp/back/model/AdGroup.java
  22. 41 0
      src/main/java/com/cloudcross/ssp/back/model/AdGroupPlace.java
  23. 108 0
      src/main/java/com/cloudcross/ssp/back/model/AdGroupSchedule.java
  24. 119 0
      src/main/java/com/cloudcross/ssp/back/model/AdvAgent.java
  25. 124 0
      src/main/java/com/cloudcross/ssp/back/model/AdvBalance.java
  26. 220 0
      src/main/java/com/cloudcross/ssp/back/model/Advertiser.java
  27. 177 0
      src/main/java/com/cloudcross/ssp/back/model/Audit.java
  28. 136 0
      src/main/java/com/cloudcross/ssp/back/model/AuditBanner.java
  29. 111 0
      src/main/java/com/cloudcross/ssp/back/model/BannerTemplate.java
  30. 221 0
      src/main/java/com/cloudcross/ssp/back/model/Campaign.java
  31. 184 0
      src/main/java/com/cloudcross/ssp/back/model/ClientAccount.java
  32. 439 0
      src/main/java/com/cloudcross/ssp/back/model/DeliverAnalysis.java
  33. 47 0
      src/main/java/com/cloudcross/ssp/back/model/Dimension.java
  34. 60 0
      src/main/java/com/cloudcross/ssp/back/model/Direct.java
  35. 128 0
      src/main/java/com/cloudcross/ssp/back/model/Location.java
  36. 59 0
      src/main/java/com/cloudcross/ssp/back/model/Message.java
  37. 31 0
      src/main/java/com/cloudcross/ssp/back/model/MessageRead.java
  38. 131 0
      src/main/java/com/cloudcross/ssp/back/model/Operator.java
  39. 86 0
      src/main/java/com/cloudcross/ssp/back/model/OperatorBalance.java
  40. 263 0
      src/main/java/com/cloudcross/ssp/back/model/OperatorReport.java
  41. 154 0
      src/main/java/com/cloudcross/ssp/back/model/Order.java
  42. 44 0
      src/main/java/com/cloudcross/ssp/back/model/Params.java
  43. 107 0
      src/main/java/com/cloudcross/ssp/back/model/Resources.java
  44. 20 0
      src/main/java/com/cloudcross/ssp/back/model/ResourcesRole.java
  45. 23 0
      src/main/java/com/cloudcross/ssp/back/model/RoleAccount.java
  46. 67 0
      src/main/java/com/cloudcross/ssp/back/model/Roles.java
  47. 130 0
      src/main/java/com/cloudcross/ssp/back/model/RptZone.java
  48. 129 0
      src/main/java/com/cloudcross/ssp/back/model/RptZoneHour.java
  49. 147 0
      src/main/java/com/cloudcross/ssp/back/model/SystemReport.java
  50. 138 0
      src/main/java/com/cloudcross/ssp/back/model/TypeReport.java
  51. 155 0
      src/main/java/com/cloudcross/ssp/back/model/User.java
  52. 45 0
      src/main/java/com/cloudcross/ssp/back/model/UserGroup.java
  53. 58 0
      src/main/java/com/cloudcross/ssp/back/model/UserLogin.java
  54. 169 0
      src/main/java/com/cloudcross/ssp/back/model/Zone.java
  55. 275 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/account.sql.xml
  56. 47 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/acls.sql.xml
  57. 227 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/ad-group.sql.xml
  58. 41 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/adgroup-place.sql.xml
  59. 28 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/adgroup-schedule.sql.xml
  60. 78 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/adv-balance.sql.xml
  61. 100 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/advAgent.sql.xml
  62. 196 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/advertiser.sql.xml
  63. 143 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/audit-banner.sql.xml
  64. 175 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/audit.sql.xml
  65. 172 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/campaign.sql.xml
  66. 51 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/clientAccount.sql.xml
  67. 98 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/dimension.sql.xml
  68. 42 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/direct.sql.xml
  69. 40 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/location.sql.xml
  70. 82 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/message.sql.xml
  71. 57 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/messageRead.sql.xml
  72. 60 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/operator-balance.sql.xml
  73. 418 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/operator-report.sql.xml
  74. 115 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/operator.sql.xml
  75. 180 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/order.sql.xml
  76. 1275 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/report.sql.xml
  77. 169 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/resources.sql.xml
  78. 92 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/roles.sql.xml
  79. 19 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/rpt-zone-hour.sql.xml
  80. 10 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/rpt-zone.sql.xml
  81. 48 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/systemreport.sql.xml
  82. 48 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/typereport.sql.xml
  83. 25 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/user-group.sql.xml
  84. 123 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/user.sql.xml
  85. 46 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/userLogin.sql.xml
  86. 33 0
      src/main/java/com/cloudcross/ssp/back/model/mapper/zone.sql.xml
  87. 36 0
      src/main/java/com/cloudcross/ssp/back/service/IAccountService.java
  88. 13 0
      src/main/java/com/cloudcross/ssp/back/service/IAclsService.java
  89. 15 0
      src/main/java/com/cloudcross/ssp/back/service/IAdGroupPlaceService.java
  90. 18 0
      src/main/java/com/cloudcross/ssp/back/service/IAdGroupScheduleService.java
  91. 40 0
      src/main/java/com/cloudcross/ssp/back/service/IAdGroupService.java
  92. 72 0
      src/main/java/com/cloudcross/ssp/back/service/IAdReportService.java
  93. 9 0
      src/main/java/com/cloudcross/ssp/back/service/IAdvAgentService.java
  94. 35 0
      src/main/java/com/cloudcross/ssp/back/service/IAdvBalanceService.java
  95. 27 0
      src/main/java/com/cloudcross/ssp/back/service/IAdvertiserService.java
  96. 25 0
      src/main/java/com/cloudcross/ssp/back/service/IAuditBannerService.java
  97. 23 0
      src/main/java/com/cloudcross/ssp/back/service/IAuditService.java
  98. 20 0
      src/main/java/com/cloudcross/ssp/back/service/ICampaignService.java
  99. 12 0
      src/main/java/com/cloudcross/ssp/back/service/IClientAccountService.java
  100. 21 0
      src/main/java/com/cloudcross/ssp/back/service/IDimensionService.java

+ 34 - 0
.classpath

@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" output="target/classes" path="src/main/java">
+		<attributes>
+			<attribute name="optional" value="true"/>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="src" output="target/test-classes" path="src/test/java">
+		<attributes>
+			<attribute name="optional" value="true"/>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry including="**/*.java" kind="src" path="src/test/resources"/>
+	<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v6.0"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+			<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+/target

+ 38 - 0
.project

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>ssp_advertiser</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.wst.common.project.facet.core.builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.wst.validation.validationbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.m2e.core.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+		<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+		<nature>org.springframework.ide.eclipse.core.springnature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.m2e.core.maven2Nature</nature>
+		<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+		<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
+	</natures>
+</projectDescription>

+ 12 - 0
.settings/.jsdtscope

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="WebContent"/>
+	<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
+		<attributes>
+			<attribute name="hide" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
+	<classpathentry kind="output" path=""/>
+</classpath>

+ 2 - 0
.settings/org.eclipse.core.resources.prefs

@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding//src/main/webapp/assets/back/css/public-head.css=UTF-8

+ 13 - 0
.settings/org.eclipse.jdt.core.prefs

@@ -0,0 +1,13 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.6

File diff suppressed because it is too large
+ 2 - 0
.settings/org.eclipse.jdt.ui.prefs


+ 4 - 0
.settings/org.eclipse.m2e.core.prefs

@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1

+ 12 - 0
.settings/org.eclipse.wst.common.component

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+    <wb-module deploy-name="ssp_web_back">
+        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
+        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
+        <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
+        <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
+        <property name="java-output-path" value="/ssp/target/classes"/>
+        <property name="component.exclusion.patterns" value="WEB-INF/web.xml"/>
+        <property name="context-root" value="ssp_web"/>
+    </wb-module>
+</project-modules>

+ 12 - 0
.settings/org.eclipse.wst.common.component.bak

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+    <wb-module deploy-name="ssp_web_back">
+        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
+        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
+        <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
+        <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
+        <property name="java-output-path" value="/ssp/target/classes"/>
+        <property name="component.exclusion.patterns" value="WEB-INF/web.xml"/>
+        <property name="context-root" value="ssp_advertiser"/>
+    </wb-module>
+</project-modules>

+ 7 - 0
.settings/org.eclipse.wst.common.project.facet.core.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+  <fixed facet="wst.jsdt.web"/>
+  <installed facet="java" version="1.6"/>
+  <installed facet="jst.web" version="2.5"/>
+  <installed facet="wst.jsdt.web" version="1.0"/>
+</faceted-project>

+ 1 - 0
.settings/org.eclipse.wst.jsdt.ui.superType.container

@@ -0,0 +1 @@
+org.eclipse.wst.jsdt.launching.baseBrowserLibrary

+ 1 - 0
.settings/org.eclipse.wst.jsdt.ui.superType.name

@@ -0,0 +1 @@
+Window

+ 2 - 0
.settings/org.eclipse.wst.validation.prefs

@@ -0,0 +1,2 @@
+disabled=06target
+eclipse.preferences.version=1

+ 2 - 0
.settings/org.eclipse.wst.ws.service.policy.prefs

@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+org.eclipse.wst.ws.service.policy.projectEnabled=false

+ 0 - 0
README


+ 291 - 0
pom.xml

@@ -0,0 +1,291 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>com.cloudcross</groupId>
+	<artifactId>ssp_web</artifactId>
+	<packaging>war</packaging>
+	<version>0.0.1-SNAPSHOT</version>
+	<name>ssp Maven Webapp</name>
+	<url>http://maven.apache.org</url>
+	<properties>
+		<spring.version>3.1.1.RELEASE</spring.version>
+		<jackson.version>1.9.13</jackson.version>
+		<mybatis.version>3.2.3</mybatis.version>
+		<mybatis-spring.version>1.2.1</mybatis-spring.version>
+		<aspectj.version>1.6.10</aspectj.version>
+		<freemarker.version>2.3.16</freemarker.version>
+		<log4j.version>1.2.16</log4j.version>
+		<junit.version>4.8.2</junit.version>
+		<jetty.version>6.1.26</jetty.version>
+		<jdk.version>1.6</jdk.version>
+	</properties>
+	
+	<build>
+		<resources>
+			<resource>
+				<directory>src/main/resources</directory>
+				<includes>
+					<include>**/*.xml</include>
+					<include>**/*properties</include>
+					<include>**/*ftl</include>
+				</includes>
+			</resource>
+			<resource>
+				<directory>src/main/java</directory>
+				<includes>
+					<include>**/*.xml</include>
+				</includes>
+			</resource>
+		</resources>
+		<pluginManagement>
+			<plugins>
+				<plugin>
+					<groupId>org.apache.maven.plugins</groupId>
+					<artifactId>maven-compiler-plugin</artifactId>
+					<version>3.1</version>
+					<configuration>
+						<source>${jdk.version}</source>
+						<target>${jdk.version}</target>
+						<compilerId>eclipse</compilerId>
+					</configuration>
+					<dependencies>
+						<dependency>
+							<groupId>org.codehaus.plexus</groupId>
+							<artifactId>plexus-compiler-eclipse</artifactId>
+							<version>2.2</version>
+						</dependency>
+					</dependencies>
+				</plugin>
+				
+				<plugin>
+                    <groupId>org.eclipse.m2e</groupId>
+                    <artifactId>lifecycle-mapping</artifactId>
+                    <version>1.0.0</version>
+                    <configuration>
+                        <lifecycleMappingMetadata>
+                            <pluginExecutions>
+                                <pluginExecution>
+                                    <pluginExecutionFilter>
+                                        <groupId>org.apache.maven.plugins</groupId>
+                                        <artifactId>maven-compiler-plugin</artifactId>
+                                        <versionRange>[3.1,)</versionRange>
+                                        <goals>
+                                            <goal>testCompile</goal>
+                                            <goal>compile</goal>
+                                        </goals>
+                                    </pluginExecutionFilter>
+                                    <action>
+                                        <ignore/>
+                                    </action>
+                                </pluginExecution>
+                            </pluginExecutions>
+                        </lifecycleMappingMetadata>
+                    </configuration>
+                </plugin>
+				
+				<plugin>
+					<artifactId>maven-war-plugin</artifactId>
+					<version>2.4</version>
+					<configuration>
+						<failOnMissingWebXml>false</failOnMissingWebXml>
+						<packagingExcludes>WEB-INF/web.xml</packagingExcludes>
+					</configuration>
+				</plugin>
+				
+				<plugin>
+					<groupId>org.mortbay.jetty</groupId>
+					<artifactId>maven-jetty-plugin</artifactId>
+					<version>${jetty.version}</version>
+				</plugin>
+			</plugins>
+		</pluginManagement>
+	</build>
+	
+	<dependencies>
+		<!-- log4j integration -->
+		<dependency>
+			<groupId>log4j</groupId>
+			<artifactId>log4j</artifactId>
+			<version>${log4j.version}</version>
+		</dependency>
+
+		<!-- Mysql integration -->
+		<dependency>
+			<groupId>mysql</groupId>
+			<artifactId>mysql-connector-java</artifactId>
+			<version>5.1.9</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-dbcp</groupId>
+			<artifactId>commons-dbcp</artifactId>
+			<version>1.4</version>
+		</dependency>
+
+		<!-- Spring integration -->
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-core</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-webmvc</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-beans</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-context</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-aop</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-orm</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-test</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework.security</groupId>
+			<artifactId>spring-security-web</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework.security</groupId>
+			<artifactId>spring-security-config</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework.security</groupId>
+			<artifactId>spring-security-taglibs</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.aspectj</groupId>
+			<artifactId>aspectjrt</artifactId>
+			<version>${aspectj.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.aspectj</groupId>
+			<artifactId>aspectjweaver</artifactId>
+			<version>${aspectj.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>cglib</groupId>
+			<artifactId>cglib</artifactId>
+			<version>2.2</version>
+		</dependency>
+
+		<!-- Freemarker integration -->
+		<dependency>
+			<groupId>org.freemarker</groupId>
+			<artifactId>freemarker</artifactId>
+			<version>${freemarker.version}</version>
+		</dependency>
+
+		<!-- MyBatis integration -->
+		<dependency>
+			<groupId>org.mybatis</groupId>
+			<artifactId>mybatis-spring</artifactId>
+			<version>${mybatis-spring.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.mybatis</groupId>
+			<artifactId>mybatis</artifactId>
+			<version>${mybatis.version}</version>
+		</dependency>
+		
+		<!-- Apache common -->
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>commons-io</artifactId>
+			<version>1.3.2</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-lang</groupId>
+			<artifactId>commons-lang</artifactId>
+			<version>2.6</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-collections</groupId>
+			<artifactId>commons-collections</artifactId>
+			<version>3.2</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-beanutils</groupId>
+			<artifactId>commons-beanutils</artifactId>
+			<version>1.8.3</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-fileupload</groupId>
+			<artifactId>commons-fileupload</artifactId>
+			<version>1.3</version>
+		</dependency>
+		
+		<!-- Junit integration -->
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>${junit.version}</version>
+			<scope>test</scope>
+		</dependency>
+		
+		<!-- Jackson integration  for spring view -->
+		<dependency>
+			<groupId>org.codehaus.jackson</groupId>
+			<artifactId>jackson-mapper-asl</artifactId>
+			<version>${jackson.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.codehaus.jackson</groupId>
+			<artifactId>jackson-core-asl</artifactId>
+			<version>${jackson.version}</version>
+		</dependency>
+		 
+		 <!-- Java mail integration  -->
+		 <dependency>
+			<groupId>com.sun.mail</groupId>
+			<artifactId>javax.mail</artifactId>
+			<version>1.5.1</version>
+		</dependency>
+		
+		<!-- j2ee dependency -->
+		<dependency>
+			<groupId>javax.servlet</groupId>
+			<artifactId>servlet-api</artifactId>
+			<version>2.5</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.servlet.jsp</groupId>
+			<artifactId>jsp-api</artifactId>
+			<version>2.1</version>
+			<scope>provided</scope>
+		</dependency>
+		
+		<!-- json dependency -->
+		<dependency>
+			<groupId>org.json</groupId>
+			<artifactId>json</artifactId>
+			<version>20090211</version>
+		</dependency>
+ <dependency>  
+        <groupId>net.sf.json-lib</groupId>  
+        <artifactId>json-lib</artifactId>  
+        <version>2.4</version> 
+        <classifier>jdk15</classifier> 
+    </dependency> 
+	</dependencies>
+</project>

+ 174 - 0
src/main/java/com/cloudcross/ssp/back/model/Account.java

@@ -0,0 +1,174 @@
+package com.cloudcross.ssp.back.model;
+
+
+import java.util.Date;
+
+//import com.cloudcross.ssp.common.utils.ExcelDataMapper;
+
+
+/**
+ * 账号实体表
+ */
+@SuppressWarnings("serial")
+public class Account implements java.io.Serializable {
+	
+	private int id;
+
+	private String accountName;//账号名
+	
+	private String roleName;//账号名
+
+	private String password;//密码
+
+	private String description;//说明
+	
+	private String realName;//真实姓名
+	
+	private String tel;//联系电话
+
+	private String state;//账号状态  0 表示停用  1表示启用
+
+	private Date createTime; //创建时间
+	
+	private  Integer type;//账户类型(1-云联,2-运营商,3-运营商代理,4-广告主,5-广告主代理)
+	
+	private Long operatorId;//运营商Id
+	
+	private Long agentId;//代理商Id
+	
+	private Long advertiserId;//广告主Id
+	
+	private Integer sysType;
+	
+	public Integer getSysType() {
+		return sysType;
+	}
+
+	public void setSysType(Integer sysType) {
+		this.sysType = sysType;
+	}
+
+	public String getRealName() {
+		return realName;
+	}
+
+	public void setRealName(String realName) {
+		this.realName = realName;
+	}
+
+	public String getTel() {
+		return tel;
+	}
+
+	public void setTel(String tel) {
+		this.tel = tel;
+	}
+
+	public Integer getType() {
+		return type;
+	}
+
+	public void setType(Integer type) {
+		this.type = type;
+	}
+
+	public Long getOperatorId() {
+		return operatorId;
+	}
+
+	public void setOperatorId(Long operatorId) {
+		this.operatorId = operatorId;
+	}
+
+	public Long getAgentId() {
+		return agentId;
+	}
+
+	public void setAgentId(Long agentId) {
+		this.agentId = agentId;
+	}
+
+	public Long getAdvertiserId() {
+		return advertiserId;
+	}
+
+	public void setAdvertiserId(Long advertiserId) {
+		this.advertiserId = advertiserId;
+	}
+
+
+	public int getId() {
+		return id;
+	}
+
+	public void setId(int id) {
+		this.id = id;
+	}
+
+	public String getAccountName() {
+		return accountName;
+	}
+
+	public void setAccountName(String accountName) {
+		this.accountName = accountName;
+	}
+
+	public String getPassword() {
+		return password;
+	}
+
+	public void setPassword(String password) {
+		this.password = password;
+	}
+
+	public String getState() {
+		return state;
+	}
+
+	public void setState(String state) {
+		this.state = state;
+	}
+	/**
+	 * 时间格式化
+	 * @author lanyuan
+	 * Email:mmm333zzz520@163.com
+	 * date:2014-2-17
+	 * @return
+	 */
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	
+	@Override
+	public String toString() {
+		return "Account [id=" + id + ", accountName=" + accountName
+				+ ", roleName=" + roleName + ", password=" + password
+				+ ", description=" + description + ", realName=" + realName
+				+ ", tel=" + tel + ", state=" + state + ", createTime="
+				+ createTime + ", type=" + type + ", operatorId=" + operatorId
+				+ ", agentId=" + agentId + ", advertiserId=" + advertiserId
+				+ "]";
+	}
+
+	public String getDescription() {
+		return description;
+	}
+
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	public String getRoleName() {
+		return roleName;
+	}
+
+	public void setRoleName(String roleName) {
+		this.roleName = roleName;
+	}
+
+}

+ 33 - 0
src/main/java/com/cloudcross/ssp/back/model/AccountResources.java

@@ -0,0 +1,33 @@
+package com.cloudcross.ssp.back.model;
+
+/**
+ * 
+ * 账户直接对接权限类!
+ * 这样做权限控制上面会更灵活一点!
+ * 
+ * @author yzq
+ *
+ */
+
+public class AccountResources {
+	private Long accountId;
+	private Long resourceId;
+	public Long getAccountId() {
+		return accountId;
+	}
+	public void setAccountId(Long accountId) {
+		this.accountId = accountId;
+	}
+	public Long getResourceId() {
+		return resourceId;
+	}
+	public void setResourceId(Long resourceId) {
+		this.resourceId = resourceId;
+	}
+	
+	@Override
+	public String toString() {
+		return "AccountResources [accountId=" + accountId + ", resourceId="
+				+ resourceId + "]";
+	}
+}

+ 66 - 0
src/main/java/com/cloudcross/ssp/back/model/Acls.java

@@ -0,0 +1,66 @@
+package com.cloudcross.ssp.back.model;
+//luohongyu对应数据库里面的表t_acls
+public class Acls {
+	private Long bannerId;
+	private String logical;
+	private String type;
+	private String comparison;
+	private String data;
+	private Long executionOrder;
+	private Long adGroupId;
+	public Long getBannerId() {
+		return bannerId;
+	}
+
+	public void setBannerId(Long bannerId) {
+		this.bannerId = bannerId;
+	}
+
+	public String getLogical() {
+		return logical;
+	}
+
+	public void setLogical(String logical) {
+		this.logical = logical;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	public String getComparison() {
+		return comparison;
+	}
+
+	public void setComparison(String comparison) {
+		this.comparison = comparison;
+	}
+
+	public String getData() {
+		return data;
+	}
+
+	public void setData(String data) {
+		this.data = data;
+	}
+
+	public Long getExecutionOrder() {
+		return executionOrder;
+	}
+
+	public void setExecutionOrder(Long executionOrder) {
+		this.executionOrder = executionOrder;
+	}
+
+	public Long getAdGroupId() {
+		return adGroupId;
+	}
+
+	public void setAdGroupId(Long adGroupId) {
+		this.adGroupId = adGroupId;
+	}
+}

+ 335 - 0
src/main/java/com/cloudcross/ssp/back/model/AdGroup.java

@@ -0,0 +1,335 @@
+package com.cloudcross.ssp.back.model;
+import java.util.Date;
+
+import com.cloudcross.ssp.common.consts.Status;
+import com.cloudcross.ssp.web.widget.SelectorController.ISelector;
+
+/**
+ * 投放管理中的投放管理表
+ * @author chenyou
+ *
+ */
+public final class AdGroup implements ISelector{
+	//投放id
+	private Long id;
+	//代理商id
+	private Long agentId;
+	//广告主id
+	private Long advertiserId;
+	//订单id
+	private Long orderId;
+	//活动id
+	private Long campaignId;
+	// 投放名称
+	private String adGroupName;
+	// 开始时间
+	private Date startDate;
+	// 结束时间
+	private Date endDate;
+	// 总预算
+	private Double totalBudget;
+	//投放模式
+	private Integer mode;
+	//单价
+	private Double price;
+	// 每日预算
+	private Double dailyBudget;
+	// 曝光总上限
+	private Long maxImpression;
+	// 点击总上限
+	private Long maxClick;
+	//转换总上限
+	private Long maxConversion;
+	// 每日曝光上限
+	private Long dailyMaxImpression;
+	// 每日点击上限
+	private Long dailyMaxClick;
+	// 每日转换上限
+	private Long dailyMaxConversion;
+	//单人曝光频次类型
+	private Integer perImpressionType;
+	//单人曝光频次
+	private Long perImpression;
+	//单人点击频次类型
+	private Integer perClickType;
+	//单人点击频次
+	private Long perClick;
+	//位置
+	private String position;
+	//点击找回
+	private Integer retarget;
+	//访客投放期
+	private Long period;
+	//状态
+	private Integer status;
+	//更新时间
+	private Date updated;
+	//这个活动的创意总数
+	private Integer bannerNumber;
+	//是否全客网站
+	private Integer site;
+	
+	public Long getAgentId() {
+		return agentId;
+	}
+
+	public void setAgentId(Long agentId) {
+		this.agentId = agentId;
+	}
+
+	public Long getAdvertiserId() {
+		return advertiserId;
+	}
+
+	public void setAdvertiserId(Long advertiserId) {
+		this.advertiserId = advertiserId;
+	}
+
+	public Integer getSite() {
+		return site;
+	}
+
+	public void setSite(Integer site) {
+		this.site = site;
+	}
+
+	public Integer getMode() {
+		return mode;
+	}
+
+	public void setMode(Integer mode) {
+		this.mode = mode;
+	}
+
+	public Double getPrice() {
+		return price;
+	}
+
+	public void setPrice(Double price) {
+		this.price = price;
+	}
+
+	public String getPosition() {
+		return position;
+	}
+
+	public void setPosition(String position) {
+		this.position = position;
+	}
+
+	public Integer getRetarget() {
+		return retarget;
+	}
+
+	public void setRetarget(Integer retarget) {
+		this.retarget = retarget;
+	}
+
+	public Long getPeriod() {
+		return period;
+	}
+
+	public void setPeriod(Long period) {
+		this.period = period;
+	}
+
+	public Integer getBannerNumber() {
+		return bannerNumber;
+	}
+
+	public void setBannerNumber(Integer bannerNumber) {
+		this.bannerNumber = bannerNumber;
+	}
+
+	public Date getUpdated() {
+		return updated;
+	}
+
+	public void setUpdated(Date updated) {
+		this.updated = updated;
+	}
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Long getOrderId() {
+		return orderId;
+	}
+
+	public void setOrderId(Long orderId) {
+		this.orderId = orderId;
+	}
+
+	public Long getCampaignId() {
+		return campaignId;
+	}
+
+	public void setCampaignId(Long campaignId) {
+		this.campaignId = campaignId;
+	}
+
+	public String getAdGroupName() {
+		return adGroupName;
+	}
+
+	public void setAdGroupName(String adGroupName) {
+		this.adGroupName = adGroupName;
+	}
+
+	public Date getStartDate() {
+		return startDate;
+	}
+
+	public void setStartDate(Date startDate) {
+		this.startDate = startDate;
+	}
+
+	public Date getEndDate() {
+		return endDate;
+	}
+
+	public void setEndDate(Date endDate) {
+		this.endDate = endDate;
+	}
+
+	public Double getTotalBudget() {
+		return totalBudget;
+	}
+
+	public void setTotalBudget(Double totalBudget) {
+		this.totalBudget = totalBudget;
+	}
+
+	public Double getDailyBudget() {
+		return dailyBudget;
+	}
+
+	public void setDailyBudget(Double dailyBudget) {
+		this.dailyBudget = dailyBudget;
+	}
+
+	public Long getMaxImpression() {
+		return maxImpression;
+	}
+
+	public void setMaxImpression(Long maxImpression) {
+		this.maxImpression = maxImpression;
+	}
+
+	public Long getMaxClick() {
+		return maxClick;
+	}
+
+	public void setMaxClick(Long maxClick) {
+		this.maxClick = maxClick;
+	}
+
+	public Long getMaxConversion() {
+		return maxConversion;
+	}
+
+	public void setMaxConversion(Long maxConversion) {
+		this.maxConversion = maxConversion;
+	}
+
+	public Long getDailyMaxImpression() {
+		return dailyMaxImpression;
+	}
+
+	public void setDailyMaxImpression(Long dailyMaxImpression) {
+		this.dailyMaxImpression = dailyMaxImpression;
+	}
+
+	public Long getDailyMaxClick() {
+		return dailyMaxClick;
+	}
+
+	public void setDailyMaxClick(Long dailyMaxClick) {
+		this.dailyMaxClick = dailyMaxClick;
+	}
+
+	public Long getDailyMaxConversion() {
+		return dailyMaxConversion;
+	}
+
+	public void setDailyMaxConversion(Long dailyMaxConversion) {
+		this.dailyMaxConversion = dailyMaxConversion;
+	}
+
+	public Integer getPerImpressionType() {
+		return perImpressionType;
+	}
+
+	public void setPerImpressionType(Integer perImpressionType) {
+		this.perImpressionType = perImpressionType;
+	}
+
+	public Long getPerImpression() {
+		return perImpression;
+	}
+
+	public void setPerImpression(Long perImpression) {
+		this.perImpression = perImpression;
+	}
+
+	public Integer getPerClickType() {
+		return perClickType;
+	}
+
+	public void setPerClickType(Integer perClickType) {
+		this.perClickType = perClickType;
+	}
+
+	public Long getPerClick() {
+		return perClick;
+	}
+
+	public void setPerClick(Long perClick) {
+		this.perClick = perClick;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	
+	@Override
+	public String toString() {
+		return "AdGroup [id=" + id + ", agentId=" + agentId + ", advertiserId="
+				+ advertiserId + ", orderId=" + orderId + ", campaignId="
+				+ campaignId + ", adGroupName=" + adGroupName + ", startDate="
+				+ startDate + ", endDate=" + endDate + ", totalBudget="
+				+ totalBudget + ", mode=" + mode + ", price=" + price
+				+ ", dailyBudget=" + dailyBudget + ", maxImpression="
+				+ maxImpression + ", maxClick=" + maxClick + ", maxConversion="
+				+ maxConversion + ", dailyMaxImpression=" + dailyMaxImpression
+				+ ", dailyMaxClick=" + dailyMaxClick + ", dailyMaxConversion="
+				+ dailyMaxConversion + ", perImpressionType="
+				+ perImpressionType + ", perImpression=" + perImpression
+				+ ", perClickType=" + perClickType + ", perClick=" + perClick
+				+ ", position=" + position + ", retarget=" + retarget
+				+ ", period=" + period + ", status=" + status + ", updated="
+				+ updated + ", bannerNumber=" + bannerNumber + ", site=" + site
+				+ "]";
+	}
+
+	@Override
+	public String getLabel() {
+		return this.adGroupName;
+	}
+
+	@Override
+	public String getValue() {
+		return String.valueOf(this.id);
+	}
+	
+}

+ 41 - 0
src/main/java/com/cloudcross/ssp/back/model/AdGroupPlace.java

@@ -0,0 +1,41 @@
+package com.cloudcross.ssp.back.model;
+
+import java.util.Date;
+
+/**
+ * 场景与投放管理关联表,对应数据库里面的表t_adgroup_place
+ * @author luohongyu
+ */
+
+public class AdGroupPlace {
+	private Long id;
+	private Long adGroupId;
+	private Long placeId;
+	private Date supdated;
+	
+		
+	public Date getSupdated() {
+		return supdated;
+	}
+	public void setSupdated(Date supdated) {
+		this.supdated = supdated;
+	}
+	public Long getId() {
+		return id;
+	}
+	public void setId(Long id) {
+		this.id = id;
+	}
+	public Long getPlaceId() {
+		return placeId;
+	}
+	public void setPlaceId(Long placeId) {
+		this.placeId = placeId;
+	}
+	public Long getAdGroupId() {
+		return adGroupId;
+	}
+	public void setAdGroupId(Long adGroupId) {
+		this.adGroupId = adGroupId;
+	}
+}

+ 108 - 0
src/main/java/com/cloudcross/ssp/back/model/AdGroupSchedule.java

@@ -0,0 +1,108 @@
+package com.cloudcross.ssp.back.model;
+
+import java.util.Date;
+
+/**
+ * 投放的排期表
+ * @author chenyou
+ *
+ */
+public class AdGroupSchedule {
+	private long id;
+	  
+	  private long adGroupId;
+	  
+	  
+	  /**
+	   * 排期开始日期
+	   */
+	  private String startDate;
+	  private Date beginDate;
+	  /**
+	   * 排期结束日期
+	   */
+	  private String endDate;
+	  private Date sEndDate;
+	  /**
+	   * 投放小时段 eg:0,1,5
+	   */
+	  private String dehours;
+	  /**
+	   * 每日投放上限
+	   */
+	  private Long dailyImpression = 0l;
+	  
+	  private Date updated;
+	  
+	public void setDailyImpression(Long dailyImpression) {
+		this.dailyImpression = dailyImpression;
+	}
+	public Long getDailyImpression() {
+		return this.dailyImpression;
+	}
+	public long getId() {
+	    return id;
+	  }
+	  public void setId(long id) {
+	    this.id = id;
+	  }
+	  public long getAdGroupId() {
+	    return adGroupId;
+	  }
+	  public void setAdGroupId(long adGroupId) {
+	    this.adGroupId = adGroupId;
+	  }
+	  public Date getUpdated() {
+	    return updated;
+	  }
+	  public void setUpdated(Date updated) {
+	    this.updated = updated;
+	  }
+	  public String getStartDate() {
+	    return startDate;
+	  }
+	  public void setStartDate(String startDate) {
+	    this.startDate = startDate;
+	  }
+	  public String getEndDate() {
+	    return endDate;
+	  }
+	  public void setEndDate(String endDate) {
+	    this.endDate = endDate;
+	  }
+	  public String getDehours() {
+	    return dehours;
+	  }
+	  public void setDehours(String dehours) {
+	    this.dehours = dehours;
+	  }
+	  public Date getBeginDate() {
+	    return beginDate;
+	  }
+	  public void setBeginDate(Date beginDate) {
+	    this.beginDate = beginDate;
+	  }
+	  public Date getsEndDate() {
+	    return sEndDate;
+	  }
+	  public void setsEndDate(Date sEndDate) {
+	    this.sEndDate = sEndDate;
+	  }
+	@Override
+	public String toString() {
+		return "AdGroupSchedule [id=" + id + ", adGroupId=" + adGroupId
+				+ ", startDate=" + startDate + ", beginDate=" + beginDate
+				+ ", endDate=" + endDate + ", sEndDate=" + sEndDate
+				+ ", dehours=" + dehours + ", dailyImpression="
+				+ dailyImpression + ", updated="
+				+ updated + "]";
+	}
+	  
+	
+	  
+	  
+	  
+	
+	
+	
+}

+ 119 - 0
src/main/java/com/cloudcross/ssp/back/model/AdvAgent.java

@@ -0,0 +1,119 @@
+package com.cloudcross.ssp.back.model;
+
+import java.util.Date;
+
+import com.cloudcross.ssp.web.widget.SelectorController.ISelector;
+
+public class AdvAgent implements ISelector{
+	private Long id;
+	private String name;
+	private String contacts;
+	private String tel;
+	private String mobile;
+	private String homePage;
+	private String address;
+	private String zip;
+	private String email;
+	private String title;
+	private Long adminId;
+	private Integer status;
+	private Date updated;
+	public Long getId() {
+		return id;
+	}
+	public void setId(Long id) {
+		this.id = id;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public String getContacts() {
+		return contacts;
+	}
+	public void setContacts(String contacts) {
+		this.contacts = contacts;
+	}
+	public String getTel() {
+		return tel;
+	}
+	public void setTel(String tel) {
+		this.tel = tel;
+	}
+	public String getMobile() {
+		return mobile;
+	}
+	public void setMobile(String mobile) {
+		this.mobile = mobile;
+	}
+	public String getHomePage() {
+		return homePage;
+	}
+	public void setHomePage(String homePage) {
+		this.homePage = homePage;
+	}
+	public String getAddress() {
+		return address;
+	}
+	public void setAddress(String address) {
+		this.address = address;
+	}
+	public String getZip() {
+		return zip;
+	}
+	public void setZip(String zip) {
+		this.zip = zip;
+	}
+	public String getEmail() {
+		return email;
+	}
+	public void setEmail(String email) {
+		this.email = email;
+	}
+	public String getTitle() {
+		return title;
+	}
+	public void setTitle(String title) {
+		this.title = title;
+	}
+	public Long getAdminId() {
+		return adminId;
+	}
+	public void setAdminId(Long admin_id) {
+		this.adminId = admin_id;
+	}
+	public Integer getStatus() {
+		return status;
+	}
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+	public Date getUpdated() {
+		return updated;
+	}
+	public void setUpdated(Date updated) {
+		this.updated = updated;
+	}
+	@Override
+	public String toString() {
+		return "AdvAgent [id=" + id + ", name=" + name + ", regName=" + 
+				 ", contacts=" + contacts + ", tel=" + tel + ", mobile="
+				+ mobile + ", homePage=" + homePage + ", address=" + address
+				+ ", zip=" + zip + ", email=" + email + ", title=" + title
+				+ ", admin_id="  + ", status=" + status
+				+ ", updated=" + updated + "]";
+	}
+	@Override
+	public String getLabel() {
+		// TODO Auto-generated method stub
+		return this.name;
+	}
+	@Override
+	public String getValue() {
+		// TODO Auto-generated method stub
+		return this.id.toString();
+	}
+
+}

+ 124 - 0
src/main/java/com/cloudcross/ssp/back/model/AdvBalance.java

@@ -0,0 +1,124 @@
+package com.cloudcross.ssp.back.model;
+
+import java.util.Date;
+
+/**
+ * 广告主代理商充值表,对应表t_adv_balance
+ * @author chenyou
+ *
+ */
+public class AdvBalance {
+	//主键
+	private Long id;
+	//用户账号id
+	private Long accountId;
+	//代理商id
+	private Long agentId;
+	//广告主id
+	private Long advertiserId;
+	//时间
+	private Date actTime;
+	//交易号
+	private String num;
+	//代理商充值金额
+	private Float charge;
+	//代理商给广告主的分配金额
+	private Float allocate;
+	//备注
+	private Float consume;
+	//余额
+	private Float balance;
+	//代理商名称
+	private String agentName;
+	//状态
+	private Integer status;
+	
+	public Integer getStatus() {
+		return status;
+	}
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+	public String getAgentName() {
+		return agentName;
+	}
+	public void setAgentName(String agentName) {
+		this.agentName = agentName;
+	}
+	public Long getId() {
+		return id;
+	}
+	public void setId(Long id) {
+		this.id = id;
+	}
+	public Long getAccountId() {
+		return accountId;
+	}
+	public void setAccountId(Long accountId) {
+		this.accountId = accountId;
+	}
+	public Long getAgentId() {
+		return agentId;
+	}
+	public void setAgentId(Long agentId) {
+		this.agentId = agentId;
+	}
+	public Long getAdvertiserId() {
+		return advertiserId;
+	}
+	public void setAdvertiserId(Long advertiserId) {
+		this.advertiserId = advertiserId;
+	}
+	public Date getActTime() {
+		return actTime;
+	}
+	public void setActTime(Date actTime) {
+		this.actTime = actTime;
+	}
+	public String getNum() {
+		return num;
+	}
+	public void setNum(String num) {
+		this.num = num;
+	}
+	public Float getCharge() {
+		return charge;
+	}
+	public void setCharge(Float charge) {
+		this.charge = charge;
+	}
+	public Float getAllocate() {
+		return allocate;
+	}
+	public void setAllocate(Float allocate) {
+		this.allocate = allocate;
+	}
+	public Float getConsume() {
+		return consume;
+	}
+	public void setConsume(Float consume) {
+		this.consume = consume;
+	}
+	public Float getBalance() {
+		return balance;
+	}
+	public void setBalance(Float balance) {
+		this.balance = balance;
+	}
+	
+	@Override
+	public String toString() {
+		return "AdvBalance [id=" + id + ", accountId=" + accountId
+				+ ", agentId=" + agentId + ", advertiserId=" + advertiserId
+				+ ", actTime=" + actTime + ", num=" + num + ", charge="
+				+ charge + ", allocate=" + allocate + ", consume=" + consume
+				+ ", balance=" + balance + ", agentName=" + agentName
+				+ ", status=" + status + "]";
+	}
+	
+	
+	
+	
+	
+	
+}

+ 220 - 0
src/main/java/com/cloudcross/ssp/back/model/Advertiser.java

@@ -0,0 +1,220 @@
+package com.cloudcross.ssp.back.model;
+import java.util.Date;
+
+import com.cloudcross.ssp.web.widget.SelectorController.ISelector;
+/**
+ * *
+ * @author CloudCross
+ *	和t_advertiser表相关
+ *	是广告主的对应的实体类
+ *	
+ */
+public class Advertiser implements ISelector{
+	
+	//广告主Id
+	private Long id;
+	//运营商Id  和t_operator(运营商)表相关
+	private Long agentId;
+	//行业Id  和t_indestry(行业)表相关
+	private Long industryId;
+	//广告主名字
+	private String name;
+	//公司注册名
+	private String regName;
+	//网址
+	private String homePage;
+	//联系人
+	private String contacts;
+	//电话
+	private String tel;
+	//电子邮件
+	private String email;
+	//资金余额
+	private Float balance;
+	//状态
+	private Integer status;
+	//最后更新日期
+	private Date updated;
+	//备注
+	private String memo; 
+	//CPI文件路径
+	private String cpiPath; 
+	//营业执照路径
+	private String licencePath; 
+	//法人代表身份证路径
+	private String idPath; 
+	//企业机构代码证
+	private String orgPath; 
+	//审核人账号id(t_account.id)
+	private Float checkAccount; 
+	//审核状态(0未审核,1审核通过,-1审核未通过)
+	private Integer checkStatus; 
+	//审核备注
+	private String checkMemo; 
+	
+	/*
+	 *下面两个字段是为了在页面显示的时候方便,从数据库中直接联合查询就可以找到数据 
+	 */
+	
+	public String getCpiPath() {
+		return cpiPath;
+	}
+	public void setCpiPath(String cpiPath) {
+		this.cpiPath = cpiPath;
+	}
+	public String getLicencePath() {
+		return licencePath;
+	}
+	public void setLicencePath(String licencePath) {
+		this.licencePath = licencePath;
+	}
+	public String getIdPath() {
+		return idPath;
+	}
+	public void setIdPath(String idPath) {
+		this.idPath = idPath;
+	}
+	public String getOrgPath() {
+		return orgPath;
+	}
+	public void setOrgPath(String orgPath) {
+		this.orgPath = orgPath;
+	}
+	
+	public Float getCheckAccount() {
+		return checkAccount;
+	}
+	public void setCheckAccount(Float checkAccount) {
+		this.checkAccount = checkAccount;
+	}
+	public Integer getCheckStatus() {
+		return checkStatus;
+	}
+	public void setCheckStatus(Integer checkStatus) {
+		this.checkStatus = checkStatus;
+	}
+	public String getCheckMemo() {
+		return checkMemo;
+	}
+	public void setCheckMemo(String checkMemo) {
+		this.checkMemo = checkMemo;
+	}
+	public String getMemo() {
+		return memo;
+	}
+	public void setMemo(String memo) {
+		this.memo = memo;
+	}
+
+	public Float getBalance() {
+		return balance;
+	}
+	public void setBalance(Float balance) {
+		this.balance = balance;
+	}
+
+	//订单数量
+	private Long orderNum;
+	//行业名称
+	private String industryName;
+	
+	
+	public Long getOrderNum() {
+		return orderNum;
+	}
+	public void setOrderNum(Long orderNum) {
+		this.orderNum = orderNum;
+	}
+	public String getIndustryName() {
+		return industryName;
+	}
+	public void setIndustryName(String industryName) {
+		this.industryName = industryName;
+	}
+	public Long getId() {
+		return id;
+	}
+	public void setId(Long id) {
+		this.id = id;
+	}
+	public Long getAgentId() {
+		return agentId;
+	}
+	public void setAgentId(Long operatorId) {
+		this.agentId = operatorId;
+	}
+	public Long getIndustryId() {
+		return industryId;
+	}
+	public void setIndustryId(Long industryId) {
+		this.industryId = industryId;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public String getRegName() {
+		return regName;
+	}
+	public void setRegName(String regName) {
+		this.regName = regName;
+	}
+	public String getHomePage() {
+		return homePage;
+	}
+	public void setHomePage(String homePage) {
+		this.homePage = homePage;
+	}
+	public String getContacts() {
+		return contacts;
+	}
+	public void setContacts(String contacts) {
+		this.contacts = contacts;
+	}
+	public String getTel() {
+		return tel;
+	}
+	public void setTel(String tel) {
+		this.tel = tel;
+	}
+	public String getEmail() {
+		return email;
+	}
+	public void setEmail(String email) {
+		this.email = email;
+	}
+	public Integer getStatus() {
+		return status;
+	}
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+	public Date getUpdated() {
+		return updated;
+	}
+	public void setUpdated(Date updated) {
+		this.updated = updated;
+	}
+	
+	@Override
+	public String toString() {
+		return "Advertiser [id=" + id + ", operatorId=" + agentId
+				+ ", industryId=" + industryId + ", name=" + name
+				+ ", regName=" + regName + ", homePage=" + homePage
+				+ ", contacts=" + contacts + ", tel=" + tel + ", email="
+				+ email + ", status=" + status + ", updated=" + updated + "]";
+	}
+	@Override
+	public String getLabel() {
+		// TODO Auto-generated method stub
+		return this.getName();
+	}
+	@Override
+	public String getValue() {
+		// TODO Auto-generated method stub
+		return String.valueOf(this.getId());
+	}
+	
+}

+ 177 - 0
src/main/java/com/cloudcross/ssp/back/model/Audit.java

@@ -0,0 +1,177 @@
+package com.cloudcross.ssp.back.model;
+
+import java.util.Date;
+/**
+ * 
+ * @author xiangliu
+ * 和t_advertiser表相关
+ * 广告主的资质审核
+ */
+public class Audit {
+		//广告主Id
+		private Long id;
+		//广告主名字
+		private String name;
+		//行业Id  和t_indestry(行业)表相关
+		private Long industryId;
+		//公司注册名
+		private String regName;
+		//网址
+		private String homePage;
+		//联系人
+		private String contacts;
+		//电话
+		private String tel;
+		//电子邮件
+		private String email; 
+		//最后更新日期
+		private Date updated;
+		//CPI文件路径
+		private String cpiPath; 
+		//营业执照路径
+		private String licencePath; 
+		//法人代表身份证路径
+		private String idPath; 
+		//企业机构代码证
+		private String orgPath; 
+		//审核人账号id(t_account.id)
+		private Float checkAccount; 
+		//审核状态(0未审核,1审核通过,-1审核未通过)
+		private Integer checkStatus; 
+		//审核备注
+		private String checkMemo;
+		
+		
+		
+		//下面是表里没有的字段
+		
+		//行业名称
+		private String industryName;
+		//行业名称
+		private String agentName;
+		
+		public String getIndustryName() {
+			return industryName;
+		}
+		public void setIndustryName(String industryName) {
+			this.industryName = industryName;
+		}
+		public String getAgentName() {
+			return agentName;
+		}
+		public void setAgentName(String agentName) {
+			this.agentName = agentName;
+		}
+		public Long getId() {
+			return id;
+		}
+		public void setId(Long id) {
+			this.id = id;
+		}
+		public String getName() {
+			return name;
+		}
+		public void setName(String name) {
+			this.name = name;
+		}
+		public Long getIndustryId() {
+			return industryId;
+		}
+		
+		public void setIndustryId(Long industryId) {
+			this.industryId = industryId;
+		}
+		public String getRegName() {
+			return regName;
+		}
+		public void setRegName(String regName) {
+			this.regName = regName;
+		}
+		public String getHomePage() {
+			return homePage;
+		}
+		public void setHomePage(String homePage) {
+			this.homePage = homePage;
+		}
+		public String getContacts() {
+			return contacts;
+		}
+		public void setContacts(String contacts) {
+			this.contacts = contacts;
+		}
+		public String getTel() {
+			return tel;
+		}
+		public void setTel(String tel) {
+			this.tel = tel;
+		}
+		public String getEmail() {
+			return email;
+		}
+		public void setEmail(String email) {
+			this.email = email;
+		}
+		public Date getUpdated() {
+			return updated;
+		}
+		public void setUpdated(Date updated) {
+			this.updated = updated;
+		}
+		public String getCpiPath() {
+			return cpiPath;
+		}
+		public void setCpiPath(String cpiPath) {
+			this.cpiPath = cpiPath;
+		}
+		public String getLicencePath() {
+			return licencePath;
+		}
+		public void setLicencePath(String licencePath) {
+			this.licencePath = licencePath;
+		}
+		public String getIdPath() {
+			return idPath;
+		}
+		public void setIdPath(String idPath) {
+			this.idPath = idPath;
+		}
+		public String getOrgPath() {
+			return orgPath;
+		}
+		public void setOrgPath(String orgPath) {
+			this.orgPath = orgPath;
+		}
+		public Float getCheckAccount() {
+			return checkAccount;
+		}
+		public void setCheckAccount(Float checkAccount) {
+			this.checkAccount = checkAccount;
+		}
+		public Integer getCheckStatus() {
+			return checkStatus;
+		}
+		public void setCheckStatus(Integer checkStatus) {
+			this.checkStatus = checkStatus;
+		}
+		public String getCheckMemo() {
+			return checkMemo;
+		}
+		public void setCheckMemo(String checkMemo) {
+			this.checkMemo = checkMemo;
+		}
+		@Override
+		public String toString() {
+			return "Audit [id=" + id + ", name=" + name + ", industryId="
+					+ industryId + ", regName=" + regName + ", homePage="
+					+ homePage + ", contacts=" + contacts + ", tel=" + tel
+					+ ", email=" + email + ", updated=" + updated
+					+ ", cpiPath=" + cpiPath + ", licencePath=" + licencePath
+					+ ", idPath=" + idPath + ", orgPath=" + orgPath
+					+ ", checkAccount=" + checkAccount + ", checkStatus="
+					+ checkStatus + ", checkMemo=" + checkMemo
+					+ ", industryName=" + industryName + ", agentName="
+					+ agentName + "]";
+		} 
+		
+		
+}

+ 136 - 0
src/main/java/com/cloudcross/ssp/back/model/AuditBanner.java

@@ -0,0 +1,136 @@
+package com.cloudcross.ssp.back.model;
+
+import java.util.Date;
+
+/**
+ * 投放活动对应的创意模板表
+ * @author chenyou
+ *
+ */
+public class AuditBanner {
+	//主键
+	private Long id;
+	//创意模板id
+	private Long bannerTemplateId;
+	//订单id
+	private Long orderId;
+	//活动id
+	private Long campaignId;
+	//投放id
+	private Long adGroupId;
+	//到达地址
+	private String visitAddress;
+	//点击地址
+	private String clickAddress;
+	//曝光地址
+	private String impressionAddress;
+	//审核状态
+	private Integer checked;
+	//更新时间
+	private Date updated;
+	//审核备注
+	private String memo;
+	//行业
+	private String industryName;
+	//广告主
+	private String advertiserName;
+	//创建bannerTemplate对象
+	BannerTemplate bannerTemplate;
+	public Long getId() {
+		return id;
+	}
+	public void setId(Long id) {
+		this.id = id;
+	}
+	public Long getBannerTemplateId() {
+		return bannerTemplateId;
+	}
+	public void setBannerTemplateId(Long bannerTemplateId) {
+		this.bannerTemplateId = bannerTemplateId;
+	}
+	public Long getOrderId() {
+		return orderId;
+	}
+	public void setOrderId(Long orderId) {
+		this.orderId = orderId;
+	}
+	public Long getCampaignId() {
+		return campaignId;
+	}
+	public void setCampaignId(Long campaignId) {
+		this.campaignId = campaignId;
+	}
+	public Long getAdGroupId() {
+		return adGroupId;
+	}
+	public void setAdGroupId(Long adGroupId) {
+		this.adGroupId = adGroupId;
+	}
+	public String getVisitAddress() {
+		return visitAddress;
+	}
+	public void setVisitAddress(String visitAddress) {
+		this.visitAddress = visitAddress;
+	}
+	public String getClickAddress() {
+		return clickAddress;
+	}
+	public void setClickAddress(String clickAddress) {
+		this.clickAddress = clickAddress;
+	}
+	public String getImpressionAddress() {
+		return impressionAddress;
+	}
+	public void setImpressionAddress(String impressionAddress) {
+		this.impressionAddress = impressionAddress;
+	}
+	public Integer getChecked() {
+		return checked;
+	}
+	public void setChecked(Integer checked) {
+		this.checked = checked;
+	}
+	public Date getUpdated() {
+		return updated;
+	}
+	public void setUpdated(Date updated) {
+		this.updated = updated;
+	}
+	public String getMemo() {
+		return memo;
+	}
+	public void setMemo(String memo) {
+		this.memo = memo;
+	}
+	public String getIndustryName() {
+		return industryName;
+	}
+	public void setIndustryName(String industryName) {
+		this.industryName = industryName;
+	}
+	public String getAdvertiserName() {
+		return advertiserName;
+	}
+	public void setAdvertiserName(String advertiserName) {
+		this.advertiserName = advertiserName;
+	}
+	public BannerTemplate getBannerTemplate() {
+		return bannerTemplate;
+	}
+	public void setBannerTemplate(BannerTemplate bannerTemplate) {
+		this.bannerTemplate = bannerTemplate;
+	}
+	@Override
+	public String toString() {
+		return "AuditBanner [id=" + id + ", bannerTemplateId="
+				+ bannerTemplateId + ", orderId=" + orderId + ", campaignId="
+				+ campaignId + ", adGroupId=" + adGroupId + ", visitAddress="
+				+ visitAddress + ", clickAddress=" + clickAddress
+				+ ", impressionAddress=" + impressionAddress + ", checked="
+				+ checked + ", updated=" + updated + ", memo=" + memo
+				+ ", industryName=" + industryName + ", advertiserName="
+				+ advertiserName + ", bannerTemplate=" + bannerTemplate + "]";
+	}
+	
+	
+}

+ 111 - 0
src/main/java/com/cloudcross/ssp/back/model/BannerTemplate.java

@@ -0,0 +1,111 @@
+package com.cloudcross.ssp.back.model;
+
+import java.util.Date;
+
+/**
+ * 创意模板表
+ * @author chenyou
+ *
+ */
+public class BannerTemplate {
+	//主键id
+	private Long id;
+	//广告主id
+	private Long advertiserId;
+	//模板名称
+	private String name;
+	//上传文件路径
+	private String path;
+	//缩略图路径
+	private String pathSmall;
+	//创意类型
+	private Integer type;
+	//创意宽度
+	private Long width;
+	//创意高度
+	private Long height;
+	//状态
+	private Integer status;
+	//上传时间
+	private Date updated;
+	//创建banner对象
+	AuditBanner banner;
+	public Long getId() {
+		return id;
+	}
+	public void setId(Long id) {
+		this.id = id;
+	}
+	public Long getAdvertiserId() {
+		return advertiserId;
+	}
+	public void setAdvertiserId(Long advertiserId) {
+		this.advertiserId = advertiserId;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public String getPath() {
+		return path;
+	}
+	public void setPath(String path) {
+		this.path = path;
+	}
+	public String getPathSmall() {
+		return pathSmall;
+	}
+	public void setPathSmall(String pathSmall) {
+		this.pathSmall = pathSmall;
+	}
+	public Integer getType() {
+		return type;
+	}
+	public void setType(Integer type) {
+		this.type = type;
+	}
+	public Long getWidth() {
+		return width;
+	}
+	public void setWidth(Long width) {
+		this.width = width;
+	}
+	public Long getHeight() {
+		return height;
+	}
+	public void setHeight(Long height) {
+		this.height = height;
+	}
+	public Integer getStatus() {
+		return status;
+	}
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+	public Date getUpdated() {
+		return updated;
+	}
+	public void setUpdated(Date updated) {
+		this.updated = updated;
+	}
+	public AuditBanner getBanner() {
+		return banner;
+	}
+	public void setBanner(AuditBanner banner) {
+		this.banner = banner;
+	}
+	@Override
+	public String toString() {
+		return "BannerTemplate [id=" + id + ", advertiserId=" + advertiserId
+				+ ", name=" + name + ", path=" + path + ", pathSmall="
+				+ pathSmall + ", type=" + type + ", width=" + width
+				+ ", height=" + height + ", status=" + status + ", updated="
+				+ updated + ", banner=" + banner + "]";
+	} 
+	
+	
+
+	
+}

+ 221 - 0
src/main/java/com/cloudcross/ssp/back/model/Campaign.java

@@ -0,0 +1,221 @@
+package com.cloudcross.ssp.back.model;
+
+import java.util.Date;
+
+import com.cloudcross.ssp.common.consts.Status;
+import com.cloudcross.ssp.web.widget.SelectorController.ISelector;
+
+/**
+ * 广告投放活动表。
+ * <p/>
+ * 与t_campaign数据表相关
+ * 
+ */
+public class Campaign implements ISelector {
+	private Long id;
+	
+	// 订单id
+	private Long orderId;
+	
+	//活动名称
+	private String name;
+	
+	// 活动开始时间
+	private Date activeTime;
+	
+	// 活动结束时间
+	private Date expireTime;
+	
+	// 活动总预算
+	private Float totalBudget;
+	
+	// 活动日预算
+	private Float dailyBudget;
+	
+	// 曝光总上限
+	private Long impression;
+	
+	// 点击总上限
+	private Long click;
+	
+	// 转化总上限
+	private Long conversion;
+	
+	// 每日曝光上限
+	private Long dailyImpression;
+	
+	// 每日点击上限
+	private Long dailyClick;
+	
+	// 每日转换上限
+	private Long dailyConversion;
+	
+	//备注项
+	private String memo;
+	
+	// 活动状态
+	private Integer status;
+	
+	// 最后更新时间
+	private Date upDated;
+	
+    //投放数目
+	private Long groupNumber;
+	
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Long getOrderId() {
+		return orderId;
+	}
+
+	public void setOrderId(Long orderId) {
+		this.orderId = orderId;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public Date getActiveTime() {
+		return activeTime;
+	}
+
+	public void setActiveTime(Date activeTime) {
+		this.activeTime = activeTime;
+	}
+
+	public Date getExpireTime() {
+		return expireTime;
+	}
+
+	public void setExpireTime(Date expireTime) {
+		this.expireTime = expireTime;
+	}
+
+	public Float getTotalBudget() {
+		return totalBudget;
+	}
+
+	public void setTotalBudget(Float totalBudget) {
+		this.totalBudget = totalBudget;
+	}
+
+	public Float getDailyBudget() {
+		return dailyBudget;
+	}
+
+	public void setDailyBudget(Float dailyBudget) {
+		this.dailyBudget = dailyBudget;
+	}
+
+	public Long getImpression() {
+		return impression;
+	}
+
+	public void setImpression(Long impression) {
+		this.impression = impression;
+	}
+
+	public Long getClick() {
+		return click;
+	}
+
+	public void setClick(Long click) {
+		this.click = click;
+	}
+
+	public Long getConversion() {
+		return conversion;
+	}
+
+	public void setConversion(Long conversion) {
+		this.conversion = conversion;
+	}
+
+	public Long getDailyImpression() {
+		return dailyImpression;
+	}
+
+	public void setDailyImpression(Long dailyImpression) {
+		this.dailyImpression = dailyImpression;
+	}
+
+	public Long getDailyClick() {
+		return dailyClick;
+	}
+
+	public void setDailyClick(Long dailyClick) {
+		this.dailyClick = dailyClick;
+	}
+
+	public Long getDailyConversion() {
+		return dailyConversion;
+	}
+
+	public void setDailyConversion(Long dailyConversion) {
+		this.dailyConversion = dailyConversion;
+	}
+
+	public String getMemo() {
+		return memo;
+	}
+
+	public void setMemo(String memo) {
+		this.memo = memo;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	public Date getUpDated() {
+		return upDated;
+	}
+
+	public void setUpDated(Date upDated) {
+		this.upDated = upDated;
+	}
+
+	public Long getGroupNumber() {
+		return groupNumber;
+	}
+
+	public void setGroupNumber(Long groupNumber) {
+		this.groupNumber = groupNumber;
+	}
+
+
+	@Override
+	public String toString() {
+		return "Campaign [id=" + id + ", orderId=" + orderId + ", name=" + name + ", activeTime=" + activeTime
+				+ ", expireTime=" + expireTime + ", totalBudget=" + totalBudget + ", dailyBudget=" + dailyBudget
+				+ ", impression=" + impression + ", click=" + click + ", conversion=" + conversion
+				+ ", dailyImpression=" + dailyImpression + ", dailyClick=" + dailyClick + ", dailyConversion="
+				+ dailyConversion + ", memo=" + memo + ", status=" + status + ", upDated=" + upDated + ", groupNumber="
+				+ groupNumber + "]";
+	}
+
+	@Override
+	public String getLabel() {
+		return this.name;
+	}
+
+	@Override
+	public String getValue() {
+		return String.valueOf(this.id);
+	}
+}

+ 184 - 0
src/main/java/com/cloudcross/ssp/back/model/ClientAccount.java

@@ -0,0 +1,184 @@
+package com.cloudcross.ssp.back.model;
+
+import java.util.Date;
+
+public class ClientAccount {
+
+	private Long id;
+	private String accountName;
+	private String companyName;
+	private String linkMan;
+	private String mobilePhone;
+	private String tel;
+	private Integer sysType;
+	private Integer status;
+	private Date loginTime;
+	private String homePage;
+	private String zip;
+	private String email;
+	private String title;
+	private String password;
+	private String address;
+	private String bank;
+	private String bankAccountName;
+	private String bankAccount;
+	private Long agentId;
+	private Long operatorId;
+	private Long adminId;
+	
+	public Long getAdminId() {
+		return adminId;
+	}
+	public void setAdminId(Long adminId) {
+		this.adminId = adminId;
+	}
+	public Long getAgentId() {
+		return agentId;
+	}
+	public void setAgentId(Long agentId) {
+		this.agentId = agentId;
+	}
+	public Long getOperatorId() {
+		return operatorId;
+	}
+	public void setOperatorId(Long operatorId) {
+		this.operatorId = operatorId;
+	}
+	public String getBankAccountName() {
+		return bankAccountName;
+	}
+	public void setBankAccountName(String bankAccountName) {
+		this.bankAccountName = bankAccountName;
+	}
+	public String getBankAccount() {
+		return bankAccount;
+	}
+	public void setBankAccount(String bankAccount) {
+		this.bankAccount = bankAccount;
+	}
+	public String getBank() {
+		return bank;
+	}
+	public void setBank(String bank) {
+		this.bank = bank;
+	}
+	public String getAddress() {
+		return address;
+	}
+	public void setAddress(String address) {
+		this.address = address;
+	}
+	public String getPassword() {
+		return password;
+	}
+	public void setPassword(String password) {
+		this.password = password;
+	}
+	public String getHomePage() {
+		return homePage;
+	}
+	public void setHomePage(String homePage) {
+		this.homePage = homePage;
+	}
+	public String getZip() {
+		return zip;
+	}
+	public void setZip(String zip) {
+		this.zip = zip;
+	}
+	public String getEmail() {
+		return email;
+	}
+	public void setEmail(String email) {
+		this.email = email;
+	}
+	public String getTitle() {
+		return title;
+	}
+	public void setTitle(String title) {
+		this.title = title;
+	}
+	public Long getId() {
+		return id;
+	}
+	public void setId(Long id) {
+		this.id = id;
+	}
+	public String getAccountName() {
+		return accountName;
+	}
+	public void setAccountName(String accountName) {
+		this.accountName = accountName;
+	}
+	public String getCompanyName() {
+		return companyName;
+	}
+	public void setCompanyName(String companyName) {
+		this.companyName = companyName;
+	}
+	public String getLinkMan() {
+		return linkMan;
+	}
+	public void setLinkMan(String linkMan) {
+		this.linkMan = linkMan;
+	}
+	public String getMobilePhone() {
+		return mobilePhone;
+	}
+	public void setMobilePhone(String mobilePhone) {
+		this.mobilePhone = mobilePhone;
+	}
+	public String getTel() {
+		return tel;
+	}
+	public void setTel(String tel) {
+		this.tel = tel;
+	}
+	public Integer getSysType() {
+		return sysType;
+	}
+	public void setSysType(Integer sysType) {
+		this.sysType = sysType;
+	}
+	public Integer getStatus() {
+		return status;
+	}
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+	public Date getLoginTime() {
+		return loginTime;
+	}
+	public void setLoginTime(Date loginTime) {
+		this.loginTime = loginTime;
+	}
+	@Override
+	public String toString() {
+		return "ClientAccount [id=" + id + ", accountName=" + accountName
+				+ ", companyName=" + companyName + ", linkMan=" + linkMan
+				+ ", mobilePhone=" + mobilePhone + ", tel=" + tel
+				+ ", sysType=" + sysType + ", status=" + status
+				+ ", loginTime=" + loginTime + ", homePage=" + homePage
+				+ ", zip=" + zip + ", email=" + email + ", title=" + title
+				+ ", password=" + password + ", address=" + address + ", bank="
+				+ bank + ", bankAccountName=" + bankAccountName
+				+ ", bankAccount=" + bankAccount + ", agentId=" + agentId
+				+ ", operatorId=" + operatorId + ", getAgentId()="
+				+ getAgentId() + ", getOperatorId()=" + getOperatorId()
+				+ ", getBankAccountName()=" + getBankAccountName()
+				+ ", getBankAccount()=" + getBankAccount() + ", getBank()="
+				+ getBank() + ", getAddress()=" + getAddress()
+				+ ", getPassword()=" + getPassword() + ", getHomePage()="
+				+ getHomePage() + ", getZip()=" + getZip() + ", getEmail()="
+				+ getEmail() + ", getTitle()=" + getTitle() + ", getId()="
+				+ getId() + ", getAccountName()=" + getAccountName()
+				+ ", getCompanyName()=" + getCompanyName() + ", getLinkMan()="
+				+ getLinkMan() + ", getMobilePhone()=" + getMobilePhone()
+				+ ", getTel()=" + getTel() + ", getSysType()=" + getSysType()
+				+ ", getStatus()=" + getStatus() + ", getLoginTime()="
+				+ getLoginTime() + ", getClass()=" + getClass()
+				+ ", hashCode()=" + hashCode() + ", toString()="
+				+ super.toString() + "]";
+	}
+
+}

+ 439 - 0
src/main/java/com/cloudcross/ssp/back/model/DeliverAnalysis.java

@@ -0,0 +1,439 @@
+package com.cloudcross.ssp.back.model;
+
+import java.util.Date;
+
+public final class DeliverAnalysis  {
+	//id
+	private Long id;
+	//广告主id
+	private Long advertiserId;
+	//订单id
+	private Long orderId;
+	//活动id
+	private Long campaignId;
+	//投放id
+	private Long adGroupId;
+	//创意id
+	private Long bannerId;
+	//创意模板Id
+	private Long bannerTemplateId;
+	//场景id
+	private Long placeId;
+	//地域
+	private String location;
+	//系统
+	private Integer os;
+	//广告主名称
+	private String advertiserName;
+	//场景名称
+	private String placeName;
+	//订单名称
+	private String orderName;
+	//活动名称
+	private String campaignName;
+	//投放名称
+	private String adGroupName;
+	//创意分组名称
+	private String bannerName;
+	
+	//请求数
+	private double request;
+	//曝光数
+	private double impression;
+	//曝光总数	
+	private double impressionSum;
+	//点击数
+	private double click;
+	//点击总数
+	private double clickSum;
+	//到达数
+	private double visit; 
+	//到达总数
+	private double visitSum;
+	//转化数
+    private double conversion;
+    //转化总数
+    private double conversionSum;
+	//曝光占比
+    private double impressionRate;
+    //点击率
+	private double clickRate;
+	//全部对应的点击率
+	private double clickRatesum;	
+	//到达率
+	private double visitRate;
+	//全部对应的到达率
+	private double visitRatesum;
+	//转化率
+	private double conversionRate;
+	//全部对应的转化率
+	private double conversionRatesum;
+	//eCmp
+	private double eCmp;
+	//eCmp总数
+	private double eCmpSum;
+	//花费
+	private double consume;
+	//花费总额
+	private double consumeSum;
+	
+	//开始时间
+	private Date startDate;
+	
+	//结束时间
+	private Date endDate;
+	
+	//日期
+	private Date reportDate;
+	
+	//小时
+	private Integer hour;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Long getAdvertiserId() {
+		return advertiserId;
+	}
+
+	public void setAdvertiserId(Long advertiserId) {
+		this.advertiserId = advertiserId;
+	}
+
+	public Long getOrderId() {
+		return orderId;
+	}
+
+	public void setOrderId(Long orderId) {
+		this.orderId = orderId;
+	}
+
+	public Long getCampaignId() {
+		return campaignId;
+	}
+
+	public void setCampaignId(Long campaignId) {
+		this.campaignId = campaignId;
+	}
+
+	public Long getAdGroupId() {
+		return adGroupId;
+	}
+
+	public void setAdGroupId(Long adGroupId) {
+		this.adGroupId = adGroupId;
+	}
+
+	public Long getBannerId() {
+		return bannerId;
+	}
+
+	public void setBannerId(Long bannerId) {
+		this.bannerId = bannerId;
+	}
+
+	public Long getBannerTemplateId() {
+		return bannerTemplateId;
+	}
+
+	public void setBannerTemplateId(Long bannerTemplateId) {
+		this.bannerTemplateId = bannerTemplateId;
+	}
+
+	public Long getPlaceId() {
+		return placeId;
+	}
+
+	public void setPlaceId(Long placeId) {
+		this.placeId = placeId;
+	}
+
+	public String getLocation() {
+		return location;
+	}
+
+	public void setLocation(String location) {
+		this.location = location;
+	}
+
+	public Integer getOs() {
+		return os;
+	}
+
+	public void setOs(Integer os) {
+		this.os = os;
+	}
+
+	public String getAdvertiserName() {
+		return advertiserName;
+	}
+
+	public void setAdvertiserName(String advertiserName) {
+		this.advertiserName = advertiserName;
+	}
+
+	public String getPlaceName() {
+		return placeName;
+	}
+
+	public void setPlaceName(String placeName) {
+		this.placeName = placeName;
+	}
+
+	public String getOrderName() {
+		return orderName;
+	}
+
+	public void setOrderName(String orderName) {
+		this.orderName = orderName;
+	}
+
+	public String getCampaignName() {
+		return campaignName;
+	}
+
+	public void setCampaignName(String campaignName) {
+		this.campaignName = campaignName;
+	}
+
+	public String getAdGroupName() {
+		return adGroupName;
+	}
+
+	public void setAdGroupName(String adGroupName) {
+		this.adGroupName = adGroupName;
+	}
+
+	public String getBannerName() {
+		return bannerName;
+	}
+
+	public void setBannerName(String bannerName) {
+		this.bannerName = bannerName;
+	}
+
+	public double getRequest() {
+		return request;
+	}
+
+	public void setRequest(double request) {
+		this.request = request;
+	}
+
+	public double getImpression() {
+		return impression;
+	}
+
+	public void setImpression(double impression) {
+		this.impression = impression;
+	}
+
+	public double getImpressionSum() {
+		return impressionSum;
+	}
+
+	public void setImpressionSum(double impressionSum) {
+		this.impressionSum = impressionSum;
+	}
+
+	public double getClick() {
+		return click;
+	}
+
+	public void setClick(double click) {
+		this.click = click;
+	}
+
+	public double getClickSum() {
+		return clickSum;
+	}
+
+	public void setClickSum(double clickSum) {
+		this.clickSum = clickSum;
+	}
+
+	public double getVisit() {
+		return visit;
+	}
+
+	public void setVisit(double visit) {
+		this.visit = visit;
+	}
+
+	public double getVisitSum() {
+		return visitSum;
+	}
+
+	public void setVisitSum(double visitSum) {
+		this.visitSum = visitSum;
+	}
+
+	public double getConversion() {
+		return conversion;
+	}
+
+	public void setConversion(double conversion) {
+		this.conversion = conversion;
+	}
+
+	public double getConversionSum() {
+		return conversionSum;
+	}
+
+	public void setConversionSum(double conversionSum) {
+		this.conversionSum = conversionSum;
+	}
+
+	public double getImpressionRate() {
+		return impressionRate;
+	}
+
+	public void setImpressionRate(double impressionRate) {
+		this.impressionRate = impressionRate;
+	}
+
+	public double getClickRate() {
+		return clickRate;
+	}
+
+	public void setClickRate(double clickRate) {
+		this.clickRate = clickRate;
+	}
+
+	public double getClickRatesum() {
+		return clickRatesum;
+	}
+
+	public void setClickRatesum(double clickRatesum) {
+		this.clickRatesum = clickRatesum;
+	}
+
+	public double getVisitRate() {
+		return visitRate;
+	}
+
+	public void setVisitRate(double visitRate) {
+		this.visitRate = visitRate;
+	}
+
+	public double getVisitRatesum() {
+		return visitRatesum;
+	}
+
+	public void setVisitRatesum(double visitRatesum) {
+		this.visitRatesum = visitRatesum;
+	}
+
+	public double getConversionRate() {
+		return conversionRate;
+	}
+
+	public void setConversionRate(double conversionRate) {
+		this.conversionRate = conversionRate;
+	}
+
+	public double getConversionRatesum() {
+		return conversionRatesum;
+	}
+
+	public void setConversionRatesum(double conversionRatesum) {
+		this.conversionRatesum = conversionRatesum;
+	}
+
+	public double geteCmp() {
+		return eCmp;
+	}
+
+	public void seteCmp(double eCmp) {
+		this.eCmp = eCmp;
+	}
+
+	public double geteCmpSum() {
+		return eCmpSum;
+	}
+
+	public void seteCmpSum(double eCmpSum) {
+		this.eCmpSum = eCmpSum;
+	}
+
+	public double getConsume() {
+		return consume;
+	}
+
+	public void setConsume(double consume) {
+		this.consume = consume;
+	}
+
+	public double getConsumeSum() {
+		return consumeSum;
+	}
+
+	public void setConsumeSum(double consumeSum) {
+		this.consumeSum = consumeSum;
+	}
+
+	public Date getStartDate() {
+		return startDate;
+	}
+
+	public void setStartDate(Date startDate) {
+		this.startDate = startDate;
+	}
+
+	public Date getEndDate() {
+		return endDate;
+	}
+
+	public void setEndDate(Date endDate) {
+		this.endDate = endDate;
+	}
+
+	public Date getReportDate() {
+		return reportDate;
+	}
+
+	public void setReportDate(Date reportDate) {
+		this.reportDate = reportDate;
+	}
+
+	public Integer getHour() {
+		return hour;
+	}
+
+	public void setHour(Integer hour) {
+		this.hour = hour;
+	}
+
+	@Override
+	public String toString() {
+		return "DeliverAnalysis [id=" + id + ", advertiserId=" + advertiserId
+				+ ", orderId=" + orderId + ", campaignId=" + campaignId
+				+ ", adGroupId=" + adGroupId + ", bannerId=" + bannerId
+				+ ", bannerTemplateId=" + bannerTemplateId + ", placeId="
+				+ placeId + ", location=" + location + ", os=" + os
+				+ ", advertiserName=" + advertiserName + ", placeName="
+				+ placeName + ", orderName=" + orderName + ", campaignName="
+				+ campaignName + ", adGroupName=" + adGroupName
+				+ ", bannerName=" + bannerName + ", request=" + request
+				+ ", impression=" + impression + ", impressionSum="
+				+ impressionSum + ", click=" + click + ", clickSum=" + clickSum
+				+ ", visit=" + visit + ", visitSum=" + visitSum
+				+ ", conversion=" + conversion + ", conversionSum="
+				+ conversionSum + ", impressionRate=" + impressionRate
+				+ ", clickRate=" + clickRate + ", clickRatesum=" + clickRatesum
+				+ ", visitRate=" + visitRate + ", visitRatesum=" + visitRatesum
+				+ ", conversionRate=" + conversionRate + ", conversionRatesum="
+				+ conversionRatesum + ", eCmp=" + eCmp + ", eCmpSum=" + eCmpSum
+				+ ", consume=" + consume + ", consumeSum=" + consumeSum
+				+ ", startDate=" + startDate + ", endDate=" + endDate
+				+ ", reportDate=" + reportDate + ", hour=" + hour + "]";
+	}
+	
+
+	
+}

+ 47 - 0
src/main/java/com/cloudcross/ssp/back/model/Dimension.java

@@ -0,0 +1,47 @@
+package com.cloudcross.ssp.back.model;
+
+public class Dimension {
+
+	private Long id;
+	private String name;
+	private String content;
+	private byte isDefault;
+	private Long advertiserId;
+	public Long getId() {
+		return id;
+	}
+	public void setId(Long id) {
+		this.id = id;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public String getContent() {
+		return content;
+	}
+	public void setContent(String content) {
+		this.content = content;
+	}
+	public byte getIsDefault() {
+		return isDefault;
+	}
+	public void setIsDefault(byte isDefault) {
+		this.isDefault = isDefault;
+	}
+	public Long getAdvertiserId() {
+		return advertiserId;
+	}
+	public void setAdvertiserId(Long advertiserId) {
+		this.advertiserId = advertiserId;
+	}
+	@Override
+	public String toString() {
+		return "Dimension [id=" + id + ", name=" + name + ", content="
+				+ content + ", isDefault=" + isDefault + ", advertiserId="
+				+ advertiserId + "]";
+	}
+	
+}

+ 60 - 0
src/main/java/com/cloudcross/ssp/back/model/Direct.java

@@ -0,0 +1,60 @@
+package com.cloudcross.ssp.back.model;
+
+
+/**
+ * 定向表,对应数据库里面的表t_target_show
+ * @author luohongyu
+ */
+
+import java.util.Date;
+
+public class Direct {
+	private Long id ;
+	//策略Id
+	private Long adGroupId;
+	//定向的类型设置
+	private String directType;
+	//定向回显
+	private String backShow;
+	//用来给rv_acls字段存值
+	private String  data;
+	private Date updated;
+	public Long getId() {
+		return id;
+	}
+	public void setId(Long id) {
+		this.id = id;
+	}
+	public Long getAdGroupId() {
+		return adGroupId;
+	}
+	public void setAdGroupId(Long adGroupId) {
+		this.adGroupId = adGroupId;
+	}
+	public String getDirectType() {
+		return directType;
+	}
+	public void setDirectType(String directType) {
+		this.directType = directType;
+	}
+ 
+	
+	public String getBackShow() {
+		return backShow;
+	}
+	public void setBackShow(String backShow) {
+		this.backShow = backShow;
+	}
+	public String getData() {
+		return data;
+	}
+	public void setData(String data) {
+		this.data = data;
+	}
+	public Date getUpdated() {
+		return updated;
+	}
+	public void setUpdated(Date updated) {
+		this.updated = updated;
+	}
+}

+ 128 - 0
src/main/java/com/cloudcross/ssp/back/model/Location.java

@@ -0,0 +1,128 @@
+package com.cloudcross.ssp.back.model;
+
+/**
+ * 地域表,对应数据库里面的表t_location
+ * @author luohongyu
+ */
+
+public class Location {
+	private Long id;
+	private String location;
+	private String locationT;
+	private String location1;
+	private String location2;
+	private String location3;
+	private String country;
+	private String cn;
+	private String big5;
+	private String cnCity;
+	private String big5City;
+	private String cnDistrict;
+	private String big5District;
+	private String py;
+	private String enCity;
+	private String enDistrict;
+	private String en;
+	public Long getId() {
+		return id;
+	}
+	public void setId(Long id) {
+		this.id = id;
+	}
+	public String getLocation() {
+		return location;
+	}
+	public void setLocation(String location) {
+		this.location = location;
+	}
+	public String getLocationT() {
+		return locationT;
+	}
+	public void setLocationT(String locationT) {
+		this.locationT = locationT;
+	}
+	public String getLocation1() {
+		return location1;
+	}
+	public void setLocation1(String location1) {
+		this.location1 = location1;
+	}
+	public String getLocation2() {
+		return location2;
+	}
+	public void setLocation2(String location2) {
+		this.location2 = location2;
+	}
+	public String getLocation3() {
+		return location3;
+	}
+	public void setLocation3(String location3) {
+		this.location3 = location3;
+	}
+	public String getCountry() {
+		return country;
+	}
+	public void setCountry(String country) {
+		this.country = country;
+	}
+	public String getCn() {
+		return cn;
+	}
+	public void setCn(String cn) {
+		this.cn = cn;
+	}
+	public String getBig5() {
+		return big5;
+	}
+	public void setBig5(String big5) {
+		this.big5 = big5;
+	}
+	public String getCnCity() {
+		return cnCity;
+	}
+	public void setCnCity(String cnCity) {
+		this.cnCity = cnCity;
+	}
+	public String getBig5City() {
+		return big5City;
+	}
+	public void setBig5City(String big5City) {
+		this.big5City = big5City;
+	}
+	public String getCnDistrict() {
+		return cnDistrict;
+	}
+	public void setCnDistrict(String cnDistrict) {
+		this.cnDistrict = cnDistrict;
+	}
+	public String getBig5District() {
+		return big5District;
+	}
+	public void setBig5District(String big5District) {
+		this.big5District = big5District;
+	}
+	public String getPy() {
+		return py;
+	}
+	public void setPy(String py) {
+		this.py = py;
+	}
+	public String getEnCity() {
+		return enCity;
+	}
+	public void setEnCity(String enCity) {
+		this.enCity = enCity;
+	}
+	public String getEnDistrict() {
+		return enDistrict;
+	}
+	public void setEnDistrict(String enDistrict) {
+		this.enDistrict = enDistrict;
+	}
+	public String getEn() {
+		return en;
+	}
+	public void setEn(String en) {
+		this.en = en;
+	}
+}

+ 59 - 0
src/main/java/com/cloudcross/ssp/back/model/Message.java

@@ -0,0 +1,59 @@
+package com.cloudcross.ssp.back.model;
+
+import java.util.Date;
+
+public class Message {
+			//消息Id
+			private Long id;
+			//消息内容
+			private String content;
+			//发送时间
+			private Date sendTime;
+			//账户id
+			private Integer accountId;
+			//是否已读
+			private Boolean read;
+			//类型(1-审核,2-提现,3-其他)
+			private Integer type;
+			
+			public Integer getType() {
+				return type;
+			}
+			public void setType(Integer type) {
+				this.type = type;
+			}
+			public Long getId() {
+				return id;
+			}
+			public void setId(Long id) {
+				this.id = id;
+			}
+			public String getContent() {
+				return content;
+			}
+			public void setContent(String content) {
+				this.content = content;
+			}
+			
+			public Date getSendTime() {
+				return sendTime;
+			}
+			public void setSendTime(Date sendTime) {
+				this.sendTime = sendTime;
+			}
+			public Integer getAccountId() {
+				return accountId;
+			}
+			public void setAccountId(Integer accountId) {
+				this.accountId = accountId;
+			}
+			public Boolean getRead() {
+				return read;
+			}
+			public void setRead(Boolean read) {
+				this.read = read;
+			}
+			
+		
+			
+}

+ 31 - 0
src/main/java/com/cloudcross/ssp/back/model/MessageRead.java

@@ -0,0 +1,31 @@
+package com.cloudcross.ssp.back.model;
+
+public class MessageRead {
+	//已读消息id
+	private Long id;
+	//消息id
+	private Long messageId;
+	//账号id
+	private Long accountId;
+	
+	public Long getId() {
+		return id;
+	}
+	public void setId(Long id) {
+		this.id = id;
+	}
+	public Long getMessageId() {
+		return messageId;
+	}
+	public void setMessageId(Long messageId) {
+		this.messageId = messageId;
+	}
+	public Long getAccountId() {
+		return accountId;
+	}
+	public void setAccountId(Long accountId) {
+		this.accountId = accountId;
+	}
+	
+	
+}

+ 131 - 0
src/main/java/com/cloudcross/ssp/back/model/Operator.java

@@ -0,0 +1,131 @@
+package com.cloudcross.ssp.back.model;
+
+import com.cloudcross.ssp.web.widget.SelectorController.ISelector;
+
+/**
+ * 媒体运营商实体类!对应t_operator表
+ * @author CloudCross
+ *
+ */
+public class Operator implements ISelector{
+	private Long id;
+	private String companyName;
+	private String linkMan;
+	private String tel;
+	private String mobile;
+	private String homePage;
+	private String account;
+	private String accountName;
+	private String bank;
+	private Integer status;
+	private Long adminId;//是相应的管理员账号的关联的t_account.id
+	private String address;
+	private String zip;
+	private String email;
+	
+	public String getHomePage() {
+		return homePage;
+	}
+	public void setHomePage(String homePage) {
+		this.homePage = homePage;
+	}
+	public String getMobile() {
+		return mobile;
+	}
+	public void setMobile(String mobile) {
+		this.mobile = mobile;
+	}
+	public String getAddress() {
+		return address;
+	}
+	public void setAddress(String address) {
+		this.address = address;
+	}
+	public String getZip() {
+		return zip;
+	}
+	public void setZip(String zip) {
+		this.zip = zip;
+	}
+	public String getEmail() {
+		return email;
+	}
+	public void setEmail(String email) {
+		this.email = email;
+	}
+	public Long getAdminId() {
+		return adminId;
+	}
+	public void setAdminId(Long adminId) {
+		this.adminId = adminId;
+	}
+	public Integer getStatus() {
+		return status;
+	}
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+	public Long getId() {
+		return id;
+	}
+	public void setId(Long id) {
+		this.id = id;
+	}
+	public String getCompanyName() {
+		return companyName;
+	}
+	public void setCompanyName(String companyName) {
+		this.companyName = companyName;
+	}
+	public String getLinkMan() {
+		return linkMan;
+	}
+	public void setLinkMan(String linkMan) {
+		this.linkMan = linkMan;
+	}
+	public String getTel() {
+		return tel;
+	}
+	public void setTel(String tel) {
+		this.tel = tel;
+	}
+	public String getAccount() {
+		return account;
+	}
+	public void setAccount(String account) {
+		this.account = account;
+	}
+	public String getAccountName() {
+		return accountName;
+	}
+	public void setAccountName(String accountName) {
+		this.accountName = accountName;
+	}
+	public String getBank() {
+		return bank;
+	}
+	public void setBank(String bank) {
+		this.bank = bank;
+	}
+	
+	
+	@Override
+	public String toString() {
+		return "Operator [id=" + id + ", companyName=" + companyName
+				+ ", linkMan=" + linkMan + ", tel=" + tel + ", mobile="
+				+ mobile + ", account=" + account + ", accountName="
+				+ accountName + ", bank=" + bank + ", status=" + status
+				+ ", adminId=" + adminId + ", address=" + address + ", zip="
+				+ zip + ", email=" + email + "]";
+	}
+	@Override
+	public String getLabel() {
+		// TODO Auto-generated method stub
+		return this.companyName;
+	}
+	@Override
+	public String getValue() {
+		// TODO Auto-generated method stub
+		return String.valueOf(this.id);
+	}
+}

+ 86 - 0
src/main/java/com/cloudcross/ssp/back/model/OperatorBalance.java

@@ -0,0 +1,86 @@
+package com.cloudcross.ssp.back.model;
+
+import java.util.Date;
+
+/**
+ * 提现记录表,与数据库表t_operator_balance相对应
+ * @author chenyou
+ *
+ */
+public class OperatorBalance {
+	//主键
+	private Long id;
+	//运营商id
+	private Long operatorId;
+	//时间
+	private Date actTime;
+	//交易号
+	private String num;
+	//提取金额
+	private Float amount;
+	//状态,1-申请中,2-审核不通过,3-已提现
+	private Integer state;
+	//收入
+	private Float income;
+	//可提现金额
+	private Float balance;
+	
+	public Float getIncome() {
+		return income;
+	}
+	public void setIncome(Float income) {
+		this.income = income;
+	}
+	public Float getBalance() {
+		return balance;
+	}
+	public void setBalance(Float balance) {
+		this.balance = balance;
+	}
+	public Long getId() {
+		return id;
+	}
+	public void setId(Long id) {
+		this.id = id;
+	}
+	public Long getOperatorId() {
+		return operatorId;
+	}
+	public void setOperatorId(Long operatorId) {
+		this.operatorId = operatorId;
+	}
+	public Date getActTime() {
+		return actTime;
+	}
+	public void setActTime(Date actTime) {
+		this.actTime = actTime;
+	}
+	public String getNum() {
+		return num;
+	}
+	public void setNum(String num) {
+		this.num = num;
+	}
+	public Float getAmount() {
+		return amount;
+	}
+	public void setAmount(Float amount) {
+		this.amount = amount;
+	}
+	public Integer getState() {
+		return state;
+	}
+	public void setState(Integer state) {
+		this.state = state;
+	}
+	
+	@Override
+	public String toString() {
+		return "OperatorBalance [id=" + id + ", operatorId=" + operatorId
+				+ ", actTime=" + actTime + ", num=" + num + ", amount="
+				+ amount + ", state=" + state + ", income=" + income
+				+ ", balance=" + balance + "]";
+	}
+	
+	
+}

+ 263 - 0
src/main/java/com/cloudcross/ssp/back/model/OperatorReport.java

@@ -0,0 +1,263 @@
+package com.cloudcross.ssp.back.model;
+
+import java.util.Date;
+
+public final class OperatorReport {
+	//id
+	private Long id;
+	//广告位id
+	private Long zoneId;
+	//广告位名称
+	private String zoneName;
+	//浏览量占比
+	private double viewRate;
+	//广告位宽
+	private double width;
+	//广告位高
+	private double height;
+	//位置
+	private Long position;
+	//系统
+	private Long system;
+	//类型
+	private Long device;
+	//地域
+	private Long location;
+	
+	//省份
+	private String cn;
+	//是不是省份的标志1-表示省份,2-表示不是,默认不是
+	//注:这个属性是在地域报表导出excel时用到的
+	private Integer cnMark = 2;
+	//城市
+	private String cn_city;
+	//场景
+	private String place;
+	//热点
+	private String apmac;
+	//PV
+	private double pv;
+	//UV
+	private double uv;
+	//曝光数
+	private double impression;
+	//唯一曝光数
+	private Long uImpression;
+	//点击数
+	private double click;
+	//唯一点击数
+	private Long uClick;
+    //填充率
+    private double fillRate;
+    //点击率
+	private double clickRate;
+	//eCmp
+	private double eCpm;
+	//收入
+	private double income;
+	//日期
+	private Date reportDate;
+	//开始日期
+	private Date startDate;
+	//结束日期
+	private Date endDate;	
+	
+	public String getApmac() {
+		return apmac;
+	}
+	public void setApmac(String apmac) {
+		this.apmac = apmac;
+	}
+	public Long getuImpression() {
+		return uImpression;
+	}
+	public void setuImpression(Long uImpression) {
+		this.uImpression = uImpression;
+	}
+	public Long getuClick() {
+		return uClick;
+	}
+	public void setuClick(Long uClick) {
+		this.uClick = uClick;
+	}
+	public Integer getCnMark() {
+		return cnMark;
+	}
+	public void setCnMark(Integer cnMark) {
+		this.cnMark = cnMark;
+	}
+	public Long getId() {
+		return id;
+	}
+	public void setId(Long id) {
+		this.id = id;
+	}
+	public Long getZoneId() {
+		return zoneId;
+	}
+	public void setZoneId(Long zoneId) {
+		this.zoneId = zoneId;
+	}
+	
+	public String getZoneName() {
+		return zoneName;
+	}
+	public void setZoneName(String zoneName) {
+		this.zoneName = zoneName;
+	}
+	public double getViewRate() {
+		return viewRate;
+	}
+	public void setViewRate(double viewRate) {
+		this.viewRate = viewRate;
+	}
+	public double getWidth() {
+		return width;
+	}
+	public void setWidth(double width) {
+		this.width = width;
+	}
+	public double getHeight() {
+		return height;
+	}
+	public void setHeight(double height) {
+		this.height = height;
+	}
+	
+	
+	public Long getPosition() {
+		return position;
+	}
+	public void setPosition(Long position) {
+		this.position = position;
+	}
+	
+	
+	public Long getSystem() {
+		return system;
+	}
+	public void setSystem(Long system) {
+		this.system = system;
+	}
+	
+	
+	public Long getDevice() {
+		return device;
+	}
+	public void setDevice(Long device) {
+		this.device = device;
+	}
+	
+	
+	public Long getLocation() {
+		return location;
+	}
+	public void setLocation(Long location) {
+		this.location = location;
+	}
+	
+	public String getCn() {
+		return cn;
+	}
+	public void setCn(String cn) {
+		this.cn = cn;
+	}
+	public String getCn_city() {
+		return cn_city;
+	}
+	public void setCn_city(String cn_city) {
+		this.cn_city = cn_city;
+	}
+	public String getPlace() {
+		return place;
+	}
+	public void setPlace(String place) {
+		this.place = place;
+	}
+	public double getPv() {
+		return pv;
+	}
+	public void setPv(double pv) {
+		this.pv = pv;
+	}
+	public double getUv() {
+		return uv;
+	}
+	public void setUv(double uv) {
+		this.uv = uv;
+	}
+	public double getImpression() {
+		return impression;
+	}
+	public void setImpression(double impression) {
+		this.impression = impression;
+	}
+	public double getClick() {
+		return click;
+	}
+	public void setClick(double click) {
+		this.click = click;
+	}
+	public double getFillRate() {
+		return fillRate;
+	}
+	public void setFillRate(double fillRate) {
+		this.fillRate = fillRate;
+	}
+	public double getClickRate() {
+		return clickRate;
+	}
+	public void setClickRate(double clickRate) {
+		this.clickRate = clickRate;
+	}
+	public double geteCpm() {
+		return eCpm;
+	}
+	public void seteCpm(double eCpm) {
+		this.eCpm = eCpm;
+	}
+	public double getIncome() {
+		return income;
+	}
+	public void setIncome(double income) {
+		this.income = income;
+	}
+	public Date getReportDate() {
+		return reportDate;
+	}
+	public void setReportDate(Date reportDate) {
+		this.reportDate = reportDate;
+	}
+	
+	public Date getStartDate() {
+		return startDate;
+	}
+	public void setStartDate(Date startDate) {
+		this.startDate = startDate;
+	}
+	public Date getEndDate() {
+		return endDate;
+	}
+	public void setEndDate(Date endDate) {
+		this.endDate = endDate;
+	}
+	
+	@Override
+	public String toString() {
+		return "OperatorReport [id=" + id + ", zoneId=" + zoneId
+				+ ", zoneName=" + zoneName + ", viewRate=" + viewRate
+				+ ", width=" + width + ", height=" + height + ", position="
+				+ position + ", system=" + system + ", device=" + device
+				+ ", location=" + location + ", cn=" + cn + ", cnMark="
+				+ cnMark + ", cn_city=" + cn_city + ", place=" + place
+				+ ", apmac=" + apmac + ", pv=" + pv + ", uv=" + uv
+				+ ", impression=" + impression + ", uImpression=" + uImpression
+				+ ", click=" + click + ", uClick=" + uClick + ", fillRate="
+				+ fillRate + ", clickRate=" + clickRate + ", eCpm=" + eCpm
+				+ ", income=" + income + ", reportDate=" + reportDate
+				+ ", startDate=" + startDate + ", endDate=" + endDate + "]";
+	}
+	
+	
+	
+}

+ 154 - 0
src/main/java/com/cloudcross/ssp/back/model/Order.java

@@ -0,0 +1,154 @@
+package com.cloudcross.ssp.back.model;
+
+import java.util.Date;
+
+import com.cloudcross.ssp.web.widget.SelectorController.ISelector;
+
+/**
+ * 订单表
+ * <p/>
+ * 与t_order表相关。
+ */
+public class Order implements ISelector {
+		// 主键
+		private Long id;
+		// 广告主ID
+		private Long advertiserId;
+		// 订单名称
+		private String name;
+		// 订单预算
+		private float budget;
+		// 订单备注
+		private String comment;
+		// 状态(0开启,1暂停)
+		private Integer status;
+		// 更新日期
+		private Date updated;
+		// 新增/status更新时间
+		private Date supdated;
+		/**
+		 * 活动个数
+		 * <p/>
+		 * 与t_campaign表相关。
+		 */
+		//活动个数campaign
+		private Long campaignNumber;
+		
+		public Long getCampaignNumber() {
+			return campaignNumber;
+		}
+		public void setCampaignNumber(Long campaignNumber) {
+			this.campaignNumber = campaignNumber;
+		}
+		public Long getId() {
+			return id;
+		}
+		public void setId(Long id) {
+			this.id = id;
+		}
+		public Long getAdvertiserId() {
+			return advertiserId;
+		}
+		public void setAdvertiserId(Long advertiserId) {
+			this.advertiserId = advertiserId;
+		}
+		public String getName() {
+			return name;
+		}
+		public void setName(String name) {
+			this.name = name;
+		}
+		public float getBudget() {
+			return budget;
+		}
+		public void setBudget(float budget) {
+			this.budget = budget;
+		}
+		public String getComment() {
+			return comment;
+		}
+		public void setComment(String comment) {
+			this.comment = comment;
+		}
+		public Integer getStatus() {
+			return status;
+		}
+		public void setStatus(Integer status) {
+			this.status = status;
+		}
+		
+		public Date getUpdated() {
+			return updated;
+		}
+		public void setUpdated(Date updated) {
+			this.updated = updated;
+		}
+		public Date getSupdated() {
+			return supdated;
+		}
+		public void setSupdated(Date supdated) {
+			this.supdated = supdated;
+		}
+		@Override
+		public String toString() {
+			return "Order [id=" + id + ", advertiserId=" + advertiserId
+					+ ", name=" + name + ", budget=" + budget + ", comment="
+					+ comment + ", status=" + status + ", upDate=" + updated
+					+ "]";
+		}
+		@Override
+		public String getLabel() {
+			
+			return this.name;
+		}
+		@Override
+		public String getValue() {
+			
+			return String.valueOf(this.id);
+		}
+		@Override
+		public int hashCode() {
+			final int prime = 31;
+			int result = 1;
+			result = prime * result
+					+ ((advertiserId == null) ? 0 : advertiserId.hashCode());
+			result = prime * result + Float.floatToIntBits(budget);
+			result = prime * result
+					+ ((comment == null) ? 0 : comment.hashCode());
+			result = prime * result + ((name == null) ? 0 : name.hashCode());
+			return result;
+		}
+		@Override
+		public boolean equals(Object obj) {
+			if (this == obj)
+				return true;
+			if (obj == null)
+				return false;
+			if (getClass() != obj.getClass())
+				return false;
+			Order other = (Order) obj;
+			if (advertiserId == null) {
+				if (other.advertiserId != null)
+					return false;
+			} else if (!advertiserId.equals(other.advertiserId))
+				return false;
+			if (Float.floatToIntBits(budget) != Float
+					.floatToIntBits(other.budget))
+				return false;
+			if (comment == null) {
+				if (other.comment != null)
+					return false;
+			} else if (!comment.equals(other.comment))
+				return false;
+			if (name == null) {
+				if (other.name != null)
+					return false;
+			} else if (!name.equals(other.name))
+				return false;
+			return true;
+		}
+	
+		
+		
+		
+}

+ 44 - 0
src/main/java/com/cloudcross/ssp/back/model/Params.java

@@ -0,0 +1,44 @@
+package com.cloudcross.ssp.back.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * 前台发送的是一个对象数组
+ * 后台需要以下对象接受
+ * 例如:
+ * menus[0].id	    1
+ * menus[0].level	1
+ * menus[1].id	    3
+ * menus[1].level	2
+ * menus[2].id	    2
+ * menus[2].level	3
+ * 这个菜单数组对象要接收这个对象,必须在这里加一个list<Resourcess>
+ * @author lanyuan
+ * Email:mmm333zzz520@163.com
+ * date:2014-2-12
+ */
+public class Params {
+
+	
+	private List<Resources> resources = new ArrayList<Resources>();
+	private List<String> id = new ArrayList<String>();
+
+	public List<String> getId() {
+		return id;
+	}
+
+	public void setId(List<String> id) {
+		this.id = id;
+	}
+
+	public List<Resources> getResources() {
+		return resources;
+	}
+
+	public void setResources(List<Resources> resources) {
+		this.resources = resources;
+	}
+
+}

+ 107 - 0
src/main/java/com/cloudcross/ssp/back/model/Resources.java

@@ -0,0 +1,107 @@
+package com.cloudcross.ssp.back.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+@SuppressWarnings("serial")
+public class Resources implements java.io.Serializable {
+
+	private Integer id;
+	private String name;
+	private Integer parentId; //父类Id
+	private String parentName;
+	private String resKey;//这个权限KEY是唯一的,新增时要注意,
+	private String resUrl;//URL地址.例如:/videoType/query  不需要项目名和http://xxx:8080
+	private Integer level;//级别 菜单的顺序
+	private String type;//类型,目录 菜单  按扭..在spring security3安全权限中,涉及精确到按扭控制
+	private String description;
+	private List<Resources> children = new ArrayList<Resources>();
+
+	public Integer getId() {
+		return this.id;
+	}
+
+	public void setId(Integer id) {
+		this.id = id;
+	}
+
+	public String getType() {
+		return this.type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	public String getName() {
+		return this.name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getResUrl() {
+		return resUrl;
+	}
+
+	public void setResUrl(String resUrl) {
+		this.resUrl = resUrl;
+	}
+
+	public Integer getLevel() {
+		return level;
+	}
+
+	public void setLevel(Integer level) {
+		this.level = level;
+	}
+
+	public String getResKey() {
+		return resKey;
+	}
+
+	public void setResKey(String resKey) {
+		this.resKey = resKey;
+	}
+
+	public String getDescription() {
+		return description;
+	}
+
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	public Integer getParentId() {
+		return parentId;
+	}
+
+	public void setParentId(Integer parentId) {
+		this.parentId = parentId;
+	}
+
+
+	public String getParentName() {
+		return parentName;
+	}
+
+	public void setParentName(String parentName) {
+		this.parentName = parentName;
+	}
+
+	public List<Resources> getChildren() {
+		return children;
+	}
+
+	public void setChildren(List<Resources> children) {
+		this.children = children;
+	}
+
+	@Override
+	public String toString() {
+		return "Menu [id=" + id + ", name=" + name + ", parentId=" + parentId + ", parentName=" + parentName + ", resKey=" + resKey + ", resUrl=" + resUrl + ", level=" + level + ", type=" + type + ", description=" + description + ", children=" + children + "]";
+	}
+
+}

+ 20 - 0
src/main/java/com/cloudcross/ssp/back/model/ResourcesRole.java

@@ -0,0 +1,20 @@
+package com.cloudcross.ssp.back.model;
+
+import java.io.Serializable;
+@SuppressWarnings("serial")
+public class ResourcesRole implements Serializable{
+	private String resId;
+	private String roleId;
+	public String getResId() {
+		return resId;
+	}
+	public void setResId(String resId) {
+		this.resId = resId;
+	}
+	public String getRoleId() {
+		return roleId;
+	}
+	public void setRoleId(String roleId) {
+		this.roleId = roleId;
+	}
+}

+ 23 - 0
src/main/java/com/cloudcross/ssp/back/model/RoleAccount.java

@@ -0,0 +1,23 @@
+package com.cloudcross.ssp.back.model;
+
+import java.io.Serializable;
+
+@SuppressWarnings("serial")
+public class RoleAccount implements Serializable{
+
+	private Integer roleId;
+	private Integer accountId;
+	public Integer getRoleId() {
+		return roleId;
+	}
+	public void setRoleId(Integer roleId) {
+		this.roleId = roleId;
+	}
+	public Integer getAccountId() {
+		return accountId;
+	}
+	public void setAccountId(Integer accountId) {
+		this.accountId = accountId;
+	}
+	
+}

+ 67 - 0
src/main/java/com/cloudcross/ssp/back/model/Roles.java

@@ -0,0 +1,67 @@
+package com.cloudcross.ssp.back.model;
+
+import java.util.HashSet;
+import java.util.Set;
+
+@SuppressWarnings("serial")
+public class Roles implements java.io.Serializable {
+
+	private Integer id;
+	private String enable;//是否禁用角色 1 表示禁用 2 表示不禁用
+	private String name;
+	private String roleKey;//唯一,新境时,需要判断
+	private String description;
+	private Set<Resources> resources = new HashSet<Resources>(0);
+
+	public Roles() {
+	}
+
+	public Integer getId() {
+		return this.id;
+	}
+
+	public void setId(Integer id) {
+		this.id = id;
+	}
+
+	public String getEnable() {
+		return this.enable;
+	}
+
+	public void setEnable(String enable) {
+		this.enable = enable;
+	}
+
+	public String getName() {
+		return this.name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public Set<Resources> getResources() {
+		return resources;
+	}
+
+	public void setResources(Set<Resources> resources) {
+		this.resources = resources;
+	}
+
+	public String getDescription() {
+		return description;
+	}
+
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	public String getRoleKey() {
+		return roleKey;
+	}
+
+	public void setRoleKey(String roleKey) {
+		this.roleKey = roleKey;
+	}
+
+}

+ 130 - 0
src/main/java/com/cloudcross/ssp/back/model/RptZone.java

@@ -0,0 +1,130 @@
+package com.cloudcross.ssp.back.model;
+
+import java.util.Date;
+
+/**
+ * 对应数据库的t_rpt_zone表
+ * @author chenyou
+ *
+ */
+public class RptZone {
+	//主键
+	private Long id;
+	//运营商id
+	private Long operatorId;
+	//日期
+	private Date date;
+	//小时
+	private Integer hour;
+	//广告位id
+	private Long zoneId;
+	//pv
+	private Long pv;
+	//uv
+	private Long uv;
+	//曝光数
+	private Long impression;
+	//唯一曝光数
+	private Long uImpression;
+	//点击数
+	private Long click;
+	//唯一点击数
+	private Long uClick;
+	//ecpm
+	private Float ecpm;
+	//收入
+	private Long income;
+	
+	public Long getuImpression() {
+		return uImpression;
+	}
+	public void setuImpression(Long uImpression) {
+		this.uImpression = uImpression;
+	}
+	public Long getuClick() {
+		return uClick;
+	}
+	public void setuClick(Long uClick) {
+		this.uClick = uClick;
+	}
+	public Long getId() {
+		return id;
+	}
+	public void setId(Long id) {
+		this.id = id;
+	}
+	public Long getOperatorId() {
+		return operatorId;
+	}
+	public void setOperatorId(Long operatorId) {
+		this.operatorId = operatorId;
+	}
+	public Date getDate() {
+		return date;
+	}
+	public void setDate(Date date) {
+		this.date = date;
+	}
+	public Integer getHour() {
+		return hour;
+	}
+	public void setHour(Integer hour) {
+		this.hour = hour;
+	}
+	public Long getZoneId() {
+		return zoneId;
+	}
+	public void setZoneId(Long zoneId) {
+		this.zoneId = zoneId;
+	}
+	public Long getPv() {
+		return pv;
+	}
+	public void setPv(Long pv) {
+		this.pv = pv;
+	}
+	public Long getUv() {
+		return uv;
+	}
+	public void setUv(Long uv) {
+		this.uv = uv;
+	}
+	public Long getImpression() {
+		return impression;
+	}
+	public void setImpression(Long impression) {
+		this.impression = impression;
+	}
+	public Long getClick() {
+		return click;
+	}
+	public void setClick(Long click) {
+		this.click = click;
+	}
+	public Float getEcpm() {
+		return ecpm;
+	}
+	public void setEcpm(Float ecpm) {
+		this.ecpm = ecpm;
+	}
+	public Long getIncome() {
+		return income;
+	}
+	public void setIncome(Long income) {
+		this.income = income;
+	}
+	
+	@Override
+	public String toString() {
+		return "RptZone [id=" + id + ", operatorId=" + operatorId + ", date="
+				+ date + ", hour=" + hour + ", zoneId=" + zoneId + ", pv=" + pv
+				+ ", uv=" + uv + ", impression=" + impression
+				+ ", uImpression=" + uImpression + ", click=" + click
+				+ ", uClick=" + uClick + ", ecpm=" + ecpm + ", income="
+				+ income + "]";
+	}
+	
+	
+	
+	
+}

+ 129 - 0
src/main/java/com/cloudcross/ssp/back/model/RptZoneHour.java

@@ -0,0 +1,129 @@
+package com.cloudcross.ssp.back.model;
+
+import java.util.Date;
+
+/**
+ * 对应数据库表t_rpt_zone_hour
+ * 
+ * @author chenyou
+ *
+ */
+public class RptZoneHour {
+	// 主键
+	private Long id;
+	// 运营商id
+	private Long operatorId;
+	// 日期
+	private Date date;
+	// 小时
+	private Integer hour;
+	// 广告位id
+	private Long zoneId;
+	// pv
+	private Long pv;
+	// uv
+	private Long uv;
+	// 曝光数
+	private Long impression;
+	//唯一曝光数
+	private Long uImpression;
+	// 点击数
+	private Long click;
+	//唯一点击数
+	private Long uClick;
+	// ecpm
+	private Float ecpm;
+	// 收入
+	private Long income;
+	
+	public Long getId() {
+		return id;
+	}
+	public void setId(Long id) {
+		this.id = id;
+	}
+	public Long getOperatorId() {
+		return operatorId;
+	}
+	public void setOperatorId(Long operatorId) {
+		this.operatorId = operatorId;
+	}
+	public Date getDate() {
+		return date;
+	}
+	public void setDate(Date date) {
+		this.date = date;
+	}
+	public Integer getHour() {
+		return hour;
+	}
+	public void setHour(Integer hour) {
+		this.hour = hour;
+	}
+	public Long getZoneId() {
+		return zoneId;
+	}
+	public void setZoneId(Long zoneId) {
+		this.zoneId = zoneId;
+	}
+	public Long getPv() {
+		return pv;
+	}
+	public void setPv(Long pv) {
+		this.pv = pv;
+	}
+	public Long getUv() {
+		return uv;
+	}
+	public void setUv(Long uv) {
+		this.uv = uv;
+	}
+	public Long getImpression() {
+		return impression;
+	}
+	public void setImpression(Long impression) {
+		this.impression = impression;
+	}
+	public Long getuImpression() {
+		return uImpression;
+	}
+	public void setuImpression(Long uImpression) {
+		this.uImpression = uImpression;
+	}
+	public Long getClick() {
+		return click;
+	}
+	public void setClick(Long click) {
+		this.click = click;
+	}
+	public Long getuClick() {
+		return uClick;
+	}
+	public void setuClick(Long uClick) {
+		this.uClick = uClick;
+	}
+	public Float getEcpm() {
+		return ecpm;
+	}
+	public void setEcpm(Float ecpm) {
+		this.ecpm = ecpm;
+	}
+	public Long getIncome() {
+		return income;
+	}
+	public void setIncome(Long income) {
+		this.income = income;
+	}
+	
+	@Override
+	public String toString() {
+		return "RptZoneHour [id=" + id + ", operatorId=" + operatorId
+				+ ", date=" + date + ", hour=" + hour + ", zoneId=" + zoneId
+				+ ", pv=" + pv + ", uv=" + uv + ", impression=" + impression
+				+ ", uImpression=" + uImpression + ", click=" + click
+				+ ", uClick=" + uClick + ", ecpm=" + ecpm + ", income="
+				+ income + "]";
+	}
+	
+	
+}

+ 147 - 0
src/main/java/com/cloudcross/ssp/back/model/SystemReport.java

@@ -0,0 +1,147 @@
+package com.cloudcross.ssp.back.model;
+
+import java.util.Date;
+
+/**
+ * 媒体数据报表中的系统报表,指广告在那个系统中投放的
+ * @author Hao
+ *
+ */
+
+
+public class SystemReport {
+	    // id
+		private Long id;
+		
+		//运营商id
+		private Long operatorId;
+		
+		//日期
+		private Date date;
+		
+		//位置  (1-windows,2-ios,3-android,4-mac,5-wp,6-other)
+		private Integer os;
+		//系统名称
+		private String systemName;
+		
+		//PV
+		private Long pv;
+		//uv
+		private Long uv;
+		
+		//曝光
+		private Long impression;
+		
+		//点击
+		private Long click;
+		
+		//ecpm
+		private Float ecpm;
+		//收入
+		private Long income;
+		
+		//广告填充率
+		private Float fillRate;
+		//点击率
+		private Float clickRate;
+		//浏览量占比
+		private Float pageviewsPercent;
+		public Long getId() {
+			return id;
+		}
+		public void setId(Long id) {
+			this.id = id;
+		}
+		
+		public Long getOperatorId() {
+			return operatorId;
+		}
+		public void setOperatorId(Long operatorId) {
+			this.operatorId = operatorId;
+		}
+		public Date getDate() {
+			return date;
+		}
+		public void setDate(Date date) {
+			this.date = date;
+		}
+		public Integer getOs() {
+			return os;
+		}
+		public void setOs(Integer os) {
+			this.os = os;
+		}
+		public String getSystemName() {
+			return systemName;
+		}
+		public void setSystemName(String systemName) {
+			this.systemName = systemName;
+		}
+		public Long getPv() {
+			return pv;
+		}
+		public void setPv(Long pv) {
+			this.pv = pv;
+		}
+		public Long getUv() {
+			return uv;
+		}
+		public void setUv(Long uv) {
+			this.uv = uv;
+		}
+		public Long getImpression() {
+			return impression;
+		}
+		public void setImpression(Long impression) {
+			this.impression = impression;
+		}
+		public Long getClick() {
+			return click;
+		}
+		public void setClick(Long click) {
+			this.click = click;
+		}
+		public Float getEcpm() {
+			return ecpm;
+		}
+		public void setEcpm(Float ecpm) {
+			this.ecpm = ecpm;
+		}
+		public Long getIncome() {
+			return income;
+		}
+		public void setIncome(Long income) {
+			this.income = income;
+		}
+		public Float getFillRate() {
+			return fillRate;
+		}
+		public void setFillRate(Float fillRate) {
+			this.fillRate = fillRate;
+		}
+		public Float getClickRate() {
+			return clickRate;
+		}
+		public void setClickRate(Float clickRate) {
+			this.clickRate = clickRate;
+		}
+		public Float getPageviewsPercent() {
+			return pageviewsPercent;
+		}
+		public void setPageviewsPercent(Float pageviewsPercent) {
+			this.pageviewsPercent = pageviewsPercent;
+		}
+		@Override
+		public String toString() {
+			return "SystemReport [id=" + id + ", operatorId=" + operatorId + ", date=" + date + ", os=" + os
+					+ ", systemName=" + systemName + ", pv=" + pv + ", uv=" + uv + ", impression=" + impression
+					+ ", click=" + click + ", ecpm=" + ecpm + ", income=" + income + ", fillRate=" + fillRate
+					+ ", clickRate=" + clickRate + ", pageviewsPercent=" + pageviewsPercent + "]";
+		}
+		
+		
+		
+		
+		
+
+}

+ 138 - 0
src/main/java/com/cloudcross/ssp/back/model/TypeReport.java

@@ -0,0 +1,138 @@
+package com.cloudcross.ssp.back.model;
+
+import java.util.Date;
+
+/**
+ * 媒体数据报表中的类型报表
+ * @author Hao
+ *
+ */
+
+
+public class TypeReport {
+	// id
+	private Long id;
+	
+	//运营商id
+	private Long operatorId;
+	
+	//日期
+	private Date date;
+	
+	//类型,1-网页 , 2-app
+	private Integer device;
+	
+	//PV
+	private Long pv;
+	//uv
+	private Long uv;
+	
+	//曝光
+	private Long impression;
+	
+	//点击
+	private Long click;
+	
+	//ecpm
+	private Float ecpm;
+	//收入
+	private Long income;
+	
+	//广告填充率
+	private Float fillRate;
+	//点击率
+	private Float clickRate;
+	//浏览量占比
+	private Float pageviewsPercent;
+	public Long getId() {
+		return id;
+	}
+	public void setId(Long id) {
+		this.id = id;
+	}
+	public Long getOperatorId() {
+		return operatorId;
+	}
+	public void setOperatorId(Long operatorId) {
+		this.operatorId = operatorId;
+	}
+	public Date getDate() {
+		return date;
+	}
+	public void setDate(Date date) {
+		this.date = date;
+	}
+	public Integer getDevice() {
+		return device;
+	}
+	public void setDevice(Integer device) {
+		this.device = device;
+	}
+	public Long getPv() {
+		return pv;
+	}
+	public void setPv(Long pv) {
+		this.pv = pv;
+	}
+	public Long getUv() {
+		return uv;
+	}
+	public void setUv(Long uv) {
+		this.uv = uv;
+	}
+	public Long getImpression() {
+		return impression;
+	}
+	public void setImpression(Long impression) {
+		this.impression = impression;
+	}
+	public Long getClick() {
+		return click;
+	}
+	public void setClick(Long click) {
+		this.click = click;
+	}
+	public Float getEcpm() {
+		return ecpm;
+	}
+	public void setEcpm(Float ecpm) {
+		this.ecpm = ecpm;
+	}
+	public Long getIncome() {
+		return income;
+	}
+	public void setIncome(Long income) {
+		this.income = income;
+	}
+	public Float getFillRate() {
+		return fillRate;
+	}
+	public void setFillRate(Float fillRate) {
+		this.fillRate = fillRate;
+	}
+	public Float getClickRate() {
+		return clickRate;
+	}
+	public void setClickRate(Float clickRate) {
+		this.clickRate = clickRate;
+	}
+	public Float getPageviewsPercent() {
+		return pageviewsPercent;
+	}
+	public void setPageviewsPercent(Float pageviewsPercent) {
+		this.pageviewsPercent = pageviewsPercent;
+	}
+	
+	@Override
+	public String toString() {
+		return "TypeReport [id=" + id + ", operatorId=" + operatorId + ", date=" + date + ", device=" + device + ", pv="
+				+ pv + ", uv=" + uv + ", impression=" + impression + ", click=" + click + ", ecpm=" + ecpm + ", income="
+				+ income + ", fillRate=" + fillRate + ", clickRate=" + clickRate + ", pageviewsPercent="
+				+ pageviewsPercent + "]";
+	}
+	
+	
+	
+	
+
+}

+ 155 - 0
src/main/java/com/cloudcross/ssp/back/model/User.java

@@ -0,0 +1,155 @@
+package com.cloudcross.ssp.back.model;
+
+import java.util.Date;
+
+import com.cloudcross.ssp.web.widget.SelectorController.ISelector;
+
+
+/**
+ * 用户表
+ * <p/>
+ * 与rv_users表相关。
+ */
+public final class User implements ISelector {
+	// 主键
+	private Long id;
+	// 邮箱地址
+	private String email;
+	// 用户组ID
+	private Long userGroupId;
+	// 登录用户
+	private String username;
+	// 登录密码
+	private String password;
+	// 联系姓名
+	private String contactName;
+	// 联系电话
+	private String phone;
+	// 状态:活跃还是不活跃
+	private Integer status;
+	// 创建日期
+	private Date createDate;
+	// 更新日期
+	private Date modifyDate;
+	
+	/**
+	 * @return the id
+	 */
+	public Long getId() {
+		return id;
+	}
+	/**
+	 * @param id the id to set
+	 */
+	public void setId(Long id) {
+		this.id = id;
+	}
+	/**
+	 * @return the email
+	 */
+	public String getEmail() {
+		return email;
+	}
+	/**
+	 * @param email the email to set
+	 */
+	public void setEmail(String email) {
+		this.email = email;
+	}
+	/**
+	 * @return the username
+	 */
+	public String getUsername() {
+		return username;
+	}
+	/**
+	 * @param username the username to set
+	 */
+	public void setUsername(String username) {
+		this.username = username;
+	}
+	/**
+	 * @return the password
+	 */
+	public String getPassword() {
+		return password;
+	}
+	/**
+	 * @param password the password to set
+	 */
+	public void setPassword(String password) {
+		this.password = password;
+	}
+	/**
+	 * @return the status
+	 */
+	public Integer getStatus() {
+		return status;
+	}
+	/**
+	 * @param status the status to set
+	 */
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+	/**
+	 * @return the createDate
+	 */
+	public Date getCreateDate() {
+		return createDate;
+	}
+	/**
+	 * @param createDate the createDate to set
+	 */
+	public void setCreateDate(Date createDate) {
+		this.createDate = createDate;
+	}
+	/**
+	 * @return the modifyDate
+	 */
+	public Date getModifyDate() {
+		return modifyDate;
+	}
+	/**
+	 * @param modifyDate the modifyDate to set
+	 */
+	public void setModifyDate(Date modifyDate) {
+		this.modifyDate = modifyDate;
+	}
+	
+	public Long getUserGroupId() {
+		return userGroupId;
+	}
+	public void setUserGroupId(Long userGroupId) {
+		this.userGroupId = userGroupId;
+	}
+	public String getPhone() {
+		return phone;
+	}
+	public void setPhone(String phone) {
+		this.phone = phone;
+	}
+	public String getContactName() {
+		return contactName;
+	}
+	public void setContactName(String contactName) {
+		this.contactName = contactName;
+	}
+	@Override
+	public String toString() {
+		return "User [id=" + id + ", email=" + email + ", userGroupId="
+				+ userGroupId + ", username=" + username + ", password="
+				+ password + ", phone=" + phone + ", status=" + status
+				+ ", createDate=" + createDate + ", modifyDate=" + modifyDate
+				+ "]";
+	}
+	@Override
+	public String getLabel() {
+		return this.username;
+	}
+	@Override
+	public String getValue() {
+		return String.valueOf(this.id);
+	}
+	
+}

+ 45 - 0
src/main/java/com/cloudcross/ssp/back/model/UserGroup.java

@@ -0,0 +1,45 @@
+package com.cloudcross.ssp.back.model;
+
+/**
+ * 用户分组表。
+ * <p/>
+ * 与rv_accounts表内容相关。
+ *  
+ * @author qaohao
+ */
+public final class UserGroup {
+	private Long id;
+	private String userGroup;
+	private String userGroupType;
+	private String status;
+	public Long getId() {
+		return id;
+	}
+	public void setId(Long id) {
+		this.id = id;
+	}
+	public String getUserGroup() {
+		return userGroup;
+	}
+	public void setUserGroup(String userGroup) {
+		this.userGroup = userGroup;
+	}
+	public String getUserGroupType() {
+		return userGroupType;
+	}
+	public void setUserGroupType(String userGroupType) {
+		this.userGroupType = userGroupType;
+	}
+	public String getStatus() {
+		return status;
+	}
+	public void setStatus(String status) {
+		this.status = status;
+	}
+	@Override
+	public String toString() {
+		return "UserGroup [id=" + id + ", userGroup=" + userGroup
+				+ ", userGroupType=" + userGroupType + ", status=" + status
+				+ "]";
+	}
+}

+ 58 - 0
src/main/java/com/cloudcross/ssp/back/model/UserLogin.java

@@ -0,0 +1,58 @@
+package com.cloudcross.ssp.back.model;
+
+import java.util.Date;
+
+
+
+public class UserLogin implements java.io.Serializable  {
+ /**
+	 * 
+	 */
+	private static final long serialVersionUID = 4999821408224216189L;
+private Integer userId;
+private String userName;
+ private Date loginTime;
+ private String loginIP;
+ 
+ public void setUserId (Integer userId)
+ {
+	    this.userId = userId;
+ }
+ 
+ public Integer getUserId(){
+	 return userId;
+ }
+ 
+ public void setUserName (String userName)
+ {
+	    this.userName = userName;
+ }
+ 
+ public String getUserName(){
+	 return userName;
+ }
+ 
+ public void setLoginTime (Date loginTime)
+ {
+	    this.loginTime = loginTime;
+ }
+
+ public Date getLoginTime(){
+	 return loginTime;
+ }
+  
+ public void setloginIP (String loginIP)
+ {
+	    this.loginIP = loginIP;
+ }
+ 
+ public String getLoginIP(){
+	 return loginIP;
+ }
+ 
+ @Override
+	public String toString() {
+		return "Menu [userId=" + userId + ",userName=" + userName + ", loginTime=" + loginTime + ", loginIP=" + loginIP + "]";
+	}
+ 
+}

+ 169 - 0
src/main/java/com/cloudcross/ssp/back/model/Zone.java

@@ -0,0 +1,169 @@
+package com.cloudcross.ssp.back.model;
+
+
+import java.util.Date;
+
+
+import com.cloudcross.ssp.web.widget.SelectorController.ISelector;
+
+/**
+ * 广告位信息实体表
+ * @author chenyou
+ *
+ */
+public class Zone implements ISelector{
+	
+	//主键
+	private Long id;
+	//运营商id
+	private Long operatorId;
+	//广告位名称
+	private String name;
+	//广告位宽度
+	private Long width;
+	//广告位高度
+	private Long height;
+	//类型(1-网页,2-APP)
+	private Integer device;
+	//位置(1-认证,2-条状,3-上网过程)
+	private Integer position;
+	//垫底广告素材地址
+	private String defaultPath;
+	//垫底广告URL
+	private String defaultUrl;
+	//素材是否要再审核
+	private Integer reCheck;
+	//状态(0-开启,1-暂停,-1-删除)
+	private Integer status;
+	//更新时间
+	private Date updated;
+	//新增/width/height/device/position/default_path/default_url/recheck/status/上级status更新时间
+	private Date supdated;
+	
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Long getOperatorId() {
+		return operatorId;
+	}
+
+	public void setOperatorId(Long operatorId) {
+		this.operatorId = operatorId;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public Long getWidth() {
+		return width;
+	}
+
+	public void setWidth(Long width) {
+		this.width = width;
+	}
+
+	public Long getHeight() {
+		return height;
+	}
+
+	public void setHeight(Long height) {
+		this.height = height;
+	}
+
+	public Integer getDevice() {
+		return device;
+	}
+
+	public void setDevice(Integer device) {
+		this.device = device;
+	}
+
+	public Integer getPosition() {
+		return position;
+	}
+
+	public void setPosition(Integer position) {
+		this.position = position;
+	}
+
+	public String getDefaultPath() {
+		return defaultPath;
+	}
+
+	public void setDefaultPath(String defaultPath) {
+		this.defaultPath = defaultPath;
+	}
+
+	public String getDefaultUrl() {
+		return defaultUrl;
+	}
+
+	public void setDefaultUrl(String defaultUrl) {
+		this.defaultUrl = defaultUrl;
+	}
+
+	public Integer getReCheck() {
+		return reCheck;
+	}
+
+	public void setReCheck(Integer reCheck) {
+		this.reCheck = reCheck;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	public Date getUpdated() {
+		return updated;
+	}
+
+	public void setUpdated(Date updated) {
+		this.updated = updated;
+	}
+
+	public Date getSupdated() {
+		return supdated;
+	}
+
+	public void setSupdated(Date supdated) {
+		this.supdated = supdated;
+	}
+
+	@Override
+	public String getLabel() {
+		return this.name;
+	}
+
+	@Override
+	public String getValue() {
+		return String.valueOf(this.id);
+	}
+
+	@Override
+	public String toString() {
+		return "Zone [id=" + id + ", operatorId=" + operatorId + ", name="
+				+ name + ", width=" + width + ", height=" + height
+				+ ", device=" + device + ", position=" + position
+				+ ", defaultPath=" + defaultPath + ", defaultUrl=" + defaultUrl
+				+ ", reCheck=" + reCheck + ", status=" + status + ", updated="
+				+ updated + ", supdated=" + supdated + "]";
+	}
+	
+	
+	
+}

+ 275 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/account.sql.xml

@@ -0,0 +1,275 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
+    "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="back.accountSqlMapper">
+
+	<!--mybatis ehcache缓存配置 -->
+	<!-- 以下两个<cache>标签二选一,第一个可以输出日志,第二个不输出日志 <cache type="org.mybatis.caches.ehcache.LoggingEhcache" 
+		/> -->
+	<!-- <cache type="org.mybatis.caches.ehcache.EhcacheCache"/> -->
+	<!-- 以下与实体类的中字段一致 -->
+	<sql id="selectId">
+		id,
+		name as accountName,
+		(select group_concat(name) from t_ly_role
+		where t_ly_role.id
+		in (SELECT role_id FROM t_acc_role WHERE
+		acc_id=t_account.id) ) roleName,
+		password,
+		description,
+		state,
+		create_time as createTime,
+		real_name as realName,
+		tel,
+		type,
+		operator_id as operatorId,
+		agent_id as agentId,
+		advertiser_id as advertiserId,
+		sys_type as sysType
+	</sql>
+
+	<!--resultType="Account" 每返回一条结果封装到Account里 -->
+	<select id="queryAll" resultType="com.cloudcross.ssp.back.model.Account" parameterType="com.cloudcross.ssp.back.model.Account">
+		select
+		<include refid="selectId" />
+		from t_account
+		<where>
+			<if test="accountName != null and accountName != ''">
+				name like '%${accountName}%'
+			</if>
+		</where>
+	</select>
+	
+	<select id="selectByParams"  parameterType="map" resultType="com.cloudcross.ssp.back.model.Account">
+		select id,
+		name as accountName,
+		real_name as realName,tel,state,create_time as createTime
+		from t_account
+		where deletestatus != -1 
+		and operator_id = 0
+		and agent_id = 0
+		and advertiser_id = 0
+		<if test="value!=null">
+			and ( t_account.name like #{value}
+			or t_account.real_name like #{value} )
+		</if>
+		and id != #{loginAccount.id}
+		and sys_type = #{loginAccount.sysType}
+		order by id   desc
+		limit #{pager.offset}, #{pager.limit}
+	</select>
+
+	<select id="countByParams" parameterType="map" resultType="int">
+		select count(id) 
+		from t_account
+		where deletestatus != -1 
+		and operator_id = 0
+		and agent_id = 0
+		and advertiser_id = 0
+		<if test="value!=null">
+			and ( t_account.name like #{value}
+			or t_account.real_name like #{value} )
+		</if>
+		and id != #{loginAccount.id}
+		and sys_type = #{loginAccount.sysType}
+	</select>
+
+	<select id="isExist" resultType="com.cloudcross.ssp.back.model.Account" parameterType="String">
+		select
+		<include refid="selectId" />
+		from t_account
+		where name = #{accountName}
+	</select>
+
+	<!--resultType="Account" 每返回一条结果封装到Account里 -->
+	<select id="query" resultType="com.cloudcross.ssp.back.model.Account" parameterType="java.util.HashMap">
+		select
+		<include refid="selectId" />
+		from t_account
+		<where>
+			<if test="t.accountName != null and t.accountName != ''">
+				name like '%${t.accountName}%'
+			</if>
+		</where>
+	</select>
+
+	<select id="queryNoMatch" resultType="com.cloudcross.ssp.back.model.Account" parameterType="java.util.HashMap">
+		select
+		a.id,
+		a.name,
+		a.password,
+		a.accountType,
+		a.description,
+		a.state,
+		a.createTime,
+		(SELECT dp.name from department dp where dp.id =
+		d.subdep_id) depName
+		from account a LEFT JOIN dep_account d on
+		a.id=d.account_id
+		<where>
+			<if test="t.accountName != null and t.accountName != ''">
+				name like '%${t.accountName}%'
+			</if>
+		</where>
+	</select>
+	
+		<!-- 增加用户 -->
+	<insert id="add" parameterType="com.cloudcross.ssp.back.model.Account">
+		insert into t_account (
+		name,
+		password,
+		description,
+		state )
+		values (#{accountName},
+		#{password}, #{description},
+		#{state})
+	</insert>
+	<!-- 增加用户 -->
+	<insert id="addAccount" parameterType="com.cloudcross.ssp.back.model.Account" useGeneratedKeys="true" keyProperty="id">
+		insert into t_account
+		 (name,
+		 password,
+		 real_name,
+		 tel,
+		 description, 
+		 state,
+		 sys_type ) values (#{accountName}, #{password},#{realName}, 
+    	#{tel},#{description},#{state},#{sysType}) 
+	</insert>
+
+	<delete id="delete" parameterType="String">
+		delete from t_account where
+		id=#{id}
+	</delete>
+
+	<select id="getById" parameterType="String" resultType="com.cloudcross.ssp.back.model.Account">
+		select
+		id,
+		name as accountName,
+		(select group_concat(name) from t_ly_role
+		where t_ly_role.id
+		in (SELECT role_id FROM t_acc_role WHERE
+		acc_id=t_account.id) ) roleName,
+		password,
+		real_name as realName,
+		tel,
+		description,
+		state,
+		create_time as createTime,
+		type,
+		operator_id as operatorId,
+		agent_id as agentId,
+		advertiser_id as advertiserId,
+		sys_type as sysType
+		from t_account where id=#{id}
+	</select>
+
+	<update id="updateAccountStatus" parameterType="HashMap">
+		update t_account
+				set state=#{state}
+		where t_account.id in
+			<foreach item="accountId" collection="accountIdList"
+		      open="(" separator="," close=")">
+		        #{accountId}
+			</foreach>
+	</update>
+	
+	<update id="editAccount" parameterType="com.cloudcross.ssp.back.model.Account">
+		update t_account
+		<set>
+			<if test="accountName != null and accountName != ''">
+				name=#{accountName},
+			</if>
+			<if test="password != null and password != ''">
+				password=#{password},
+			</if>
+			<if test="description != null and description != ''">
+				description=#{description},
+			</if>
+			<if test="state != null and state != ''">
+				state=#{state},
+			</if>
+			<if test="createTime != null and createTime != ''">
+				create_time=#{createTime},
+			</if>
+			<if test="realName != null and realName != ''">
+				real_name=#{realName},
+			</if>
+			<if test="tel != null and tel != ''">
+				tel=#{tel},
+			</if>
+			<if test="operatorId != null and operatorId != 0">
+				operator_id=#{operatorId},
+			</if>
+			<if test="agentId != null and agentId !=0">
+				agent_id=#{agentId},
+			</if>
+			<if test="advertiserId != null and advertiserId !=0">
+				advertiser_id=#{advertiserId},
+			</if>
+		</set>
+		where id=#{id}
+	</update>
+	
+	<update id="update" parameterType="com.cloudcross.ssp.back.model.Account">
+		update t_account
+		<set>
+			<if test="accountName != null and accountName != ''">
+				name=#{accountName},
+			</if>
+			<if test="password != null and password != ''">
+				password=#{password},
+			</if>
+			<if test="description != null and description != ''">
+				description=#{description},
+			</if>
+			<if test="state != null and state != ''">
+				state=#{state},
+			</if>
+			<if test="createTime != null and createTime != ''">
+				createTime=#{createTime}
+			</if>
+			<if test="realName != null and realName != ''">
+				real_name=#{realName}
+			</if>
+			<if test="tel != null and tel != ''">
+				tel=#{tel}
+			</if>
+		</set>
+		where id=#{id}
+	</update>
+
+	<!-- 验证用户登陆 -->
+	<select id="countAccount" parameterType="com.cloudcross.ssp.back.model.Account" resultType="com.cloudcross.ssp.back.model.Account">
+		select
+		<include refid="selectId" />
+		from t_account where
+		name=#{accountName} and password=#{password}
+	</select>
+
+	<!-- 根据用户名查出id -->
+	<select id="querySingleAccount" parameterType="String"
+		resultType="Account">
+		select
+		<include refid="selectId" />
+		from t_account where name=#{accountName}
+	</select>
+	
+	<select id="findExcelAccount"  parameterType="map" resultType="com.cloudcross.ssp.back.model.Account">
+		select id,
+		name as accountName,
+		real_name as realName,tel,state,create_time as createTime
+		from t_account
+		where deletestatus != -1 
+		and operator_id = 0
+		and agent_id = 0
+		and advertiser_id = 0
+		<if test="value!=null">
+			and ( t_account.name like #{value}
+			or t_account.real_name like #{value} )
+		</if>
+		and id != #{loginAccount.id}
+		and sys_type = #{loginAccount.sysType}
+		order by id   desc
+	</select>
+</mapper>

+ 47 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/acls.sql.xml

@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.aclsSqlMapper">
+	<sql id="base_column">
+		banner_id as bannerId,
+		logical ,
+		type,
+		comparison,
+		data,
+		executionorder as executionOrder,
+		adgroup_id as adGroupId
+	</sql>
+	<insert id="addAcls" parameterType="com.cloudcross.ssp.back.model.Acls">
+		insert into  	t_acls(banner_id,logical,type,comparison,data,<if test="null!=executionOrder" >executionorder,</if>adgroup_id)
+		values (#{bannerId},#{logical},#{type},#{comparison},#{data},<if test="null!=executionOrder" >#{executionOrder},</if>#{adGroupId})
+	</insert>
+	<update id="editAcls" parameterType="com.cloudcross.ssp.back.model.Acls">
+		update t_acls
+		set logical=
+		#{logical},comparison = #{comparison},data=#{data}
+		where type=#{type} and adgroup_id=#{adGroupId}
+	</update>
+	
+	<select id="findById" parameterType="long"  resultType="com.cloudcross.ssp.back.model.Acls">
+		select  <include refid="base_column"/>  from t_acls  where  banner_id  =  #{bannerId}
+	</select>
+	
+	<delete id="deleteAcls" parameterType="long">
+		delete from t_acls where  banner_id = #{id} 
+	</delete>
+	
+	<delete id="deleteAclsBatch" parameterType="map">
+			delete from t_acls where  type=#{type} and banner_id in
+				<foreach item="id" collection="idList" open="("  separator="," close=")">
+				#{id}
+				</foreach>
+	</delete>
+	
+	<insert  id="addAclsBatch" parameterType="map">
+	    insert into t_acls  (banner_id,logical,type,comparison,data,
+						<if test="null!=acls.executionOrder" >executionorder,</if>adgroup_id)
+          values    <foreach collection="idList" item="item" index="index" separator=",">
+    					(#{item},#{acls.logical},#{acls.type},#{acls.comparison},#{acls.data},
+    					<if test="null!=acls.executionOrder" >#{acls.executionOrder},</if>#{adGroupId})
+    			    </foreach> 
+	</insert>
+</mapper>

+ 227 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/ad-group.sql.xml

@@ -0,0 +1,227 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.adGroupSqlMapper">
+	<sql id="base_column">
+		t_adgroup.id,
+		t_adgroup.agent_id as agentId,
+		t_adgroup.advertiser_id as advertiserId,
+		t_adgroup.order_id as orderId,
+		t_adgroup.campaign_id as campaignId,
+		name as adGroupName,
+		active_time as startDate,
+		expire_time as endDate,
+		totalbudget as totalBudget,
+		mode,
+		price,
+		dailybudget as dailyBudget,
+		impression as maxImpression,
+		click as maxClick,
+		conversion as maxConversion,
+		daily_impression as dailyMaxImpression,
+		daily_click as dailyMaxClick,
+		daily_conversion as dailyMaxConversion,
+		per_impression_type as perImpressionType,
+		per_impression as perImpression,
+		per_click_type as perClickType,
+		per_click as perClick,
+		position,
+		site,
+		retarget,
+		period,
+		status,
+		t_adgroup.updated as updated
+	</sql>
+	
+	
+	<select id="countByParams" parameterType="map" resultType="int">
+		select count(id) 
+		from t_adgroup
+		where status != -1
+		<if test="agentId!=null">
+			 and agent_id = #{agentId}
+		</if>
+		<if test="agentId == null">
+			and advertiser_id = #{advertiserId}
+		</if>
+		<if test="orderMark != null">
+			and order_id = #{orderId}
+		</if>
+		<if test="campaignMark != null">
+			and campaign_id = #{campaignId}
+		</if>
+		<if test="adGroupName != null">
+			and name like #{adGroupName}
+			</if>
+			<if test="selectedStatus1!=null">
+			and now()>active_time and expire_time>now() and status=0
+			</if>
+			<if test="selectedStatus2!=null">
+			and active_time>now()
+			</if>
+			<if test="selectedStatus3!=null">
+			and now()>expire_time and status=1
+			</if>
+			<if test="selectedStatus4!=null">
+			and status=1
+			</if>
+	</select>
+	
+	<select id="findAreas" parameterType="Long" resultType="map">
+		select *from t_target_show 
+		where adgroup_id = #{adGroupId} and targettype = "deliveryLimitations:Geo:City"
+	</select>
+	
+	
+	<select id="findByParams" parameterType="map" resultType="com.cloudcross.ssp.back.model.AdGroup">
+		select
+		<include refid="base_column"/>, count(banner_template_id) as bannerNumber
+		from t_adgroup left join t_banner
+		on t_adgroup.id=t_banner.adgroup_id
+		<where>
+			t_adgroup.campaign_id=#{campaignId} and status!=-1
+			<if test="agentId!=null">
+			 and agent_id = #{agentId}
+		</if>
+		<if test="agentId == null">
+			and advertiser_id = #{advertiserId}
+		</if>
+		<if test="orderMark != null">
+			and order_id = #{orderId}
+		</if>
+		<if test="campaignMark != null">
+			and campaign_id = #{campaignId}
+		</if>
+		<if test="adGroupName != null">
+			and name like #{adGroupName}
+			</if>
+			<if test="selectedStatus1!=null">
+			and now()>active_time and expire_time>now() and status=0
+			</if>
+			<if test="selectedStatus2!=null">
+			and active_time>now()
+			</if>
+			<if test="selectedStatus3!=null">
+			and now()>expire_time and status=1
+			</if>
+			<if test="selectedStatus4!=null">
+			and status=1
+			</if>
+		</where>
+		group by t_adgroup.id
+		order by t_adgroup.id desc
+		limit #{pager.offset}, #{pager.limit}
+	</select>
+	
+	
+	
+	<update id="updateAdGroupStatus" parameterType="HashMap">
+		update t_adgroup 
+		set status=#{status},updated = #{updated}
+		where id in
+		<foreach item="id" collection="idList" open="(" separator=","
+			close=")">
+			#{id}
+		</foreach>
+	</update>
+	
+	<update id="updatedSupdated" parameterType="Long">
+		update t_adgroup 
+		set supdated=NOW()
+		where id = #{adGroupId}
+	</update>
+	
+	<select id="findByCampaignId" parameterType="long" resultType="com.cloudcross.ssp.back.model.AdGroup">
+	    select
+		<include refid="base_column"/>
+		from t_adgroup 
+		where campaign_id=#{campaignId} and status!=-1
+	</select>
+	
+	<insert id="addAdGroup" parameterType="com.cloudcross.ssp.back.model.AdGroup"  useGeneratedKeys="true"
+		keyProperty="id">
+		insert into t_adgroup
+			(name,campaign_id,order_id,activate_time,expire_time,totalbudget,
+			<if test="price !=null">price,</if>
+			<if test="dailyBudget !=null">dailybudget,</if>
+			<if test="maxImpression !=null">impression,</if>
+			<if test="maxClick !=null">	click,</if>
+			<if test="maxConversion !=null"> conversion,</if>
+			<if test="dailyMaxImpression !=null">daily_impression,</if>
+			<if test="dailyMaxClick !=null">daily_click,</if>
+			<if test="dailyMaxConversion !=null">daily_conversion,</if>
+			<if test="perImpressionType !=null">per_impression_type,</if>
+			<if test="perImpression !=null">per_impression,</if>
+			<if test="perClickType !=null">per_click_type,</if>
+			<if test="perClick !=null">per_click,</if>			
+			<if test="retarget !=null">retarget,</if>
+			<if test="period !=null">period,</if>
+			<if test="site !=null">site,</if>
+			<if test="position !=null">position,</if>
+			status,updated,supdated)
+		values
+			(#{adGroupName},#{campaignId},#{orderId},#{startDate},#{endDate},#{totalBudget},
+			<if test="price !=null">#{price},</if>
+			<if test="dailyBudget !=null">#{dailyBudget},</if>
+			<if test="maxImpression !=null">#{maxImpression},</if>
+			<if test="maxClick !=null">#{maxClick},</if>
+			<if test="maxConversion !=null">#{maxConversion},</if>
+			<if test="dailyMaxImpression !=null">#{dailyMaxImpression},</if>
+			<if test="dailyMaxClick !=null">#{dailyMaxClick},</if>
+			<if test="dailyMaxConversion !=null">#{dailyMaxConversion},</if>
+			<if test="perImpressionType !=null">#{perImpressionType},</if>
+			<if test="perImpression !=null">#{perImpression},</if>
+			<if test="perClickType !=null">#{perClickType},</if>
+			<if test="perClick !=null">#{perClick},</if>			
+			<if test="retarget !=null">#{retarget},</if>
+			<if test="period !=null">#{period},</if>
+			<if test="site !=null">#{site},</if>
+			<if test="position !=null">#{position},</if>
+			#{status},NOW(),NOW())
+	</insert>
+	
+	<select id="findById" parameterType="long" resultType="AdGroup">
+		select
+		<include refid="base_column"/>
+		from t_adgroup
+		<where>
+		id = #{id}
+		</where>
+	</select>
+	
+	<update id="editAdGroup" parameterType="com.cloudcross.ssp.back.model.AdGroup">
+		update t_adgroup
+		set name = #{adGroupName},
+		activate_time = #{startDate},
+		expire_time = #{endDate},		
+		totalbudget = #{totalBudget},
+		price = #{price},		
+		dailybudget = IFNULL(#{dailyBudget},default(dailybudget)),
+		impression = IFNULL(#{maxImpression},default(impression)),
+		click =IFNULL( #{maxClick},default(click)),
+		conversion=IFNULL( #{maxConversion},default(conversion)),
+		daily_impression = IFNULL(#{dailyMaxImpression},default(daily_impression)),
+		daily_click =IFNULL( #{dailyMaxClick},default(daily_click)),
+		daily_conversion = IFNULL(#{dailyMaxConversion},default(daily_conversion)),
+		per_impression_type = IFNULL(#{perImpressionType},default(per_impression_type)),
+		per_impression = IFNULL( #{perImpression},default(per_impression)),
+		per_click_type =IFNULL( #{perClickType},default(per_click_type)),
+		per_click = IFNULL( #{perClick},default(per_click)),
+		retarget = IFNULL( #{retarget},default(retarget)),
+		period = IFNULL( #{period},default(period)),
+		site = IFNULL( #{site},default(site)),		
+		position =IFNULL( #{position},default(position)),		
+		status = #{status},
+		updated = NOW()
+		<where>
+			id = #{id}
+		</where>
+	</update>
+	
+	
+	<select id="findAdgroupByAdvertiserId_Dashboard" parameterType="long" resultType="map">  
+    select g.id as adGroupId, g.name as adGroupName
+    from t_order o, t_adgroup g
+    where o.id = g.order_id and o.advertiser_id = #{advertiserId} and  date(g.activate_time) &lt;=date(date_add(now(), interval -1 day)) and date(g.expire_time)>=date(date_add(now(), interval -1 day))
+    </select>
+	
+</mapper>

+ 41 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/adgroup-place.sql.xml

@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.adGroupPlaceSqlMapper">
+	<sql id="base_column">
+		id,
+		adgroup_id  as adGroupId,
+		place_id as placeId
+	</sql>
+
+	<insert id="addPlace" parameterType="com.cloudcross.ssp.back.model.AdGroupPlace">
+		insert into
+		t_adgroup_place (adgroup_id,place_id,supdated)
+		values (#{adGroupId},#{placeId},NOW())
+	</insert>
+
+	<select id="findAll" parameterType="long" resultType="com.cloudcross.ssp.back.model.AdGroupPlace">
+		select
+		<include refid="base_column"/>
+		from t_adgroup_place
+		<where>
+		adgroup_id = #{adGroupId}
+		</where>
+	</select>
+	
+	<delete id="delete" parameterType="long"> 
+	delete from t_adgroup_place where adgroup_id = #{adGroupId} 
+	</delete>
+	
+	<update id="updatedSupdate" parameterType="long">
+	update t_adgroup_place 
+	set supdated=NOW()
+	where adgroup_id= #{adGroupId}
+	</update>
+	
+	<select id="findAllByAdGroupId" parameterType="long" resultType="com.cloudcross.ssp.back.model.AdGroupPlace">
+		select
+		<include refid="base_column"/>
+		from t_adgroup_place
+		where adgroup_id = #{adGroupId}
+	</select>
+</mapper>

+ 28 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/adgroup-schedule.sql.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.adGroupScheduleSqlMapper">
+	<sql id="base_column">
+		id ,
+		adgroup_id as adGroupId ,
+		startdate as beginDate,
+		enddate as sEndDate,
+		dehours,
+		daily_impression as dailyImpression,
+		daily_click as dailyClick,
+		updated 
+	</sql>
+	
+	<insert  id="batchAdd" parameterType="map">
+	    insert into t_adgroup_schedule  (adgroup_id,startdate,enddate,dehours,daily_impression,updated)
+          values    <foreach collection="scheduleList" item="schedule" index="index" separator=",">
+    					(#{schedule.adGroupId},#{schedule.beginDate},#{schedule.sEndDate},#{schedule.dehours},
+    					#{schedule.dailyImpression},
+    					#{schedule.updated})
+    			    </foreach> 
+	</insert>
+	
+	<delete id="deleteByAdGroupId" parameterType="long">
+		delete from t_adgroup_schedule where adgroup_id = #{adGroupId}
+	</delete>
+	
+</mapper>

+ 78 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/adv-balance.sql.xml

@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.advBalanceSqlMapper">
+	<sql id="base_column">
+		t_adv_balance.id as id,
+		t_adv_balance.account_id as accountId,
+		t_adv_balance.agent_id as agentId,
+		t_adv_balance.advertiser_id as advertiserId,
+		t_adv_balance.act_time as actTime,
+		t_adv_balance.num as num,
+		t_adv_balance.charge as charge,
+		t_adv_balance.allocate as allocate,
+		t_adv_balance.memo as memo,
+		t_adv_balance.consume as consume,
+		t_adv_balance.balance as balance,
+		t_adv_balance.status as status
+	</sql>
+	
+	
+	<select id="countByParams" parameterType="map" resultType="int">
+		select count(id) from t_adv_balance
+		<where> 
+		advertiser_id = 0 and agent_id != 0 and status != -1
+		<if test="actTime != null">
+			and act_time like #{actTime}
+		</if>
+		</where>
+	</select>
+	
+	<select id="findByParams" parameterType="map" resultType="com.cloudcross.ssp.back.model.AdvBalance">
+		select <include refid="base_column"/>, name as agentName from t_adv_balance left join
+		t_adv_agent on t_adv_balance.agent_id = t_adv_agent.id
+		<where> 
+		t_adv_balance.advertiser_id = 0 and t_adv_balance.agent_id != 0 and t_adv_balance.status != -1
+		<if test="actTime != null">
+			and act_time like #{actTime}
+		</if>
+		</where>
+		order by act_time desc
+		limit #{pager.offset}, #{pager.limit} 
+	</select>
+	
+	<select id="findByParams1" parameterType="map" resultType="com.cloudcross.ssp.back.model.AdvBalance">
+	select <include refid="base_column"/>, name as agentName from t_adv_balance left join
+		t_adv_agent on t_adv_balance.agent_id = t_adv_agent.id
+		<where> 
+		t_adv_balance.advertiser_id = 0 and t_adv_balance.agent_id != 0 and t_adv_balance.status != -1
+		<if test="actTime != null">
+			and act_time like #{actTime}
+		</if>
+		</where>
+		order by act_time desc
+	</select>
+	
+	<select id="findBalanceByAgentId" parameterType="long" resultType="float">
+		select balance from t_adv_balance where agent_id = #{agentId} and status != -1 order by id desc limit 1
+	</select>
+	
+	
+	<insert id="add" parameterType="com.cloudcross.ssp.back.model.AdvBalance">
+		insert into t_adv_balance(account_id,agent_id,act_time,num,charge,balance) 
+		values(#{accountId},#{agentId},#{actTime},#{num},#{charge},#{balance})
+	</insert>
+	
+	<select id="findById" parameterType="long" resultType="com.cloudcross.ssp.back.model.AdvBalance">
+		select <include refid="base_column"/> from t_adv_balance
+		where id = #{id} and status != -1
+	</select>
+	
+	<update id="updateBalanceByAgentId" parameterType="map">
+		  update t_adv_balance set balance = #{balance}
+    	  where id in (select * from (select id from t_adv_balance where agent_id = #{agentId} and status != -1 order by id desc limit 1) as a)
+	</update>
+	
+	<delete id="deleteAdvBalanceById" parameterType="long">
+		delete from t_adv_balance where id = #{id}
+	</delete>
+</mapper>

+ 100 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/advAgent.sql.xml

@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.advAgentSqlMapper">
+
+	<sql id="base_column">
+		id,
+		name,
+		contacts,
+		tel,
+		mobile,
+		homepage as homePage,
+		address,
+		zip,
+		email,
+		title,
+		admin_id as adminId,
+		status
+	</sql>
+	
+	<select id="findById" parameterType="int" resultType="com.cloudcross.ssp.back.model.AdvAgent">
+		select 
+		<include refid="base_column" />
+		from t_adv_agent
+		<where>
+			id = #{id} and
+			status != -1
+		</where>
+	</select>
+	
+	<select id="findAll" resultType="com.cloudcross.ssp.back.model.AdvAgent">
+		select 
+		<include refid="base_column" />
+		from t_adv_agent
+		<where>
+			status != -1
+		</where>
+	</select>
+	
+	<select id="countByParams" parameterType="map" resultType="int">
+		select count(id)
+		from t_adv_agent where status != -1
+		<if test="value!=null">
+			and name like #{value}
+		</if>
+	</select>
+	
+	
+	<select id="findByParams" parameterType="map" resultType="int">
+		select 
+		<include refid="base_column" />
+		from t_adv_agent where status != -1
+		<if test="value!=null">
+			and name like #{value}
+		</if>
+		order by  id   desc
+	limit #{pager.offset}, #{pager.limit}
+	</select>
+	<select id="getNew" parameterType="AdvAgent" resultType="com.cloudcross.ssp.back.model.AdvAgent">
+		select 
+		<include refid="base_column" />
+		from t_adv_agent
+		<where>
+			status != -1 
+			and admin_id = #{adminId} 
+			and name = #{name}  
+		</where>
+	</select>
+	
+	<insert id="addAdvAgent" parameterType="AdvAgent">
+		insert into t_adv_agent(name,contacts,tel,mobile,homepage,address,zip,email,title,admin_id,status)
+		values(#{name},#{contacts},#{tel},#{mobile},#{homePage},#{address},#{zip},#{email},#{title},#{adminId},#{status})
+	</insert>
+	
+	<update id="editAdvAgent" parameterType="AdvAgent">
+		update t_adv_agent
+		set name=#{name},
+			contacts=#{contacts},
+			tel=#{tel},
+			mobile=#{mobile},
+			homepage=#{homePage},
+			address=#{address},
+			zip=#{zip},
+			email=#{email},
+			title=#{title},
+			admin_id=#{adminId},
+			status=#{status}
+		where id=#{id}
+	</update>
+	
+	<update id="updateAdvAgentStatus" parameterType="HashMap">
+		update t_adv_agent
+			set status = #{status}
+			where id in
+			<foreach item="advAgentId" collection="advAgentIdList"
+		      open="(" separator="," close=")">
+		        #{advAgentId}
+			</foreach>
+	</update>
+	
+</mapper>

+ 196 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/advertiser.sql.xml

@@ -0,0 +1,196 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.advertiserSqlMapper">
+	
+	<sql id="base_column">
+		t_advertiser.id as id,
+		agent_id as agentId,
+		industry_id as industryId,
+		t_advertiser.name as name,
+		reg_name as regName,
+		homepage as homePage,
+		t_advertiser.contacts,
+		t_advertiser.tel as tel,
+		t_advertiser.email as email,
+		t_advertiser.balance as balance,
+		t_advertiser.status as status,
+		t_advertiser.memo as memo,
+		t_advertiser.cpi_path as cpiPath,
+		t_advertiser.licence_path as licencePath,
+		t_advertiser.id_path as idPath,
+		t_advertiser.org_path as orgPath,
+		t_advertiser.check_account as checkAccount,
+		t_advertiser.check_status as checkStatus,
+		t_advertiser.check_memo as checkMemo,
+		t_advertiser.updated as updated
+	</sql>
+	
+	<select id="selectById" parameterType="int" resultType="com.cloudcross.ssp.back.model.Advertiser">
+		select 
+		<include refid="base_column" />
+		from t_advertiser
+		<where>
+			id = #{id} and
+			status != -1
+		</where>
+	</select>
+	
+	<select id="selectByAgentId" parameterType="int" resultType="com.cloudcross.ssp.back.model.Advertiser">
+		select 
+		<include refid="base_column" />
+		from t_advertiser
+		<where>
+			agent_id = #{id} and
+			status != -1
+		</where>
+	</select>
+	
+	<select id="selectByName" parameterType="String" resultType="long">
+		select 
+		max(id)
+		from t_advertiser
+		<where>
+		name = #{name} and
+			status != -1
+		</where>
+	</select>
+		
+	<select id="selectByOperator" parameterType="int" resultType="com.cloudcross.ssp.back.model.Advertiser">
+		select 
+		<include refid="base_column" />
+		from t_advertiser
+		<where>
+			agent_id = #{operatorId} and
+			status != -1.
+		</where>
+	</select>
+		
+	<select id="selectByParams"  parameterType="map" resultType="com.cloudcross.ssp.back.model.Advertiser">
+		select 
+		<include refid="base_column" />
+		,b.name as industryName, count(c.advertiser_id) as orderNum from t_industry b,t_advertiser left join t_order c
+		 on t_advertiser.id = c.advertiser_id 
+		 where 1 = 1 
+		 <if test="value!=null">
+			and t_advertiser.name like #{value}
+		</if>
+		 <if test="status!=null">	
+			and t_advertiser.status = #{status}
+		</if>
+		 <if test="industryId!=null">	
+			and t_advertiser.industry_id = #{industryId}
+		</if>
+		 <if test="agentId!=null">	
+			and t_advertiser.agent_id = #{agentId}
+		</if>
+		 and t_advertiser.status != -1
+		 and t_advertiser.industry_id = b.id 
+		group by t_advertiser.id
+		order by t_advertiser.id   desc
+		limit #{pager.offset}, #{pager.limit}
+	</select>
+	
+	<select id="selectByStatus"  parameterType="map" resultType="com.cloudcross.ssp.back.model.Advertiser">
+		select 
+		<include refid="base_column" />
+		,b.name as industryName, count(c.advertiser_id) as orderNum from t_industry b,t_advertiser left join t_order c
+		 on t_advertiser.id = c.advertiser_id 
+		 where 1 = 1 
+		 and t_advertiser.status = #{status}
+		 and t_advertiser.industry_id = b.id 
+		group by t_advertiser.id
+		order by t_advertiser.id   desc
+		limit #{pager.offset}, #{pager.limit}
+	</select>
+	
+	<select id="countByStatus" parameterType="map" resultType="int">
+		select count(a.id)
+		from t_advertiser a where status = #{status}
+	</select>
+	
+	<select id="countByParams" parameterType="map" resultType="int">
+		select count(a.id)
+		from t_advertiser a where status != -1
+		<if test="value!=null">
+			and a.name like #{value}
+		</if>
+		 <if test="status!=null">	
+			and a.status = #{status}
+		</if>
+		 <if test="industryId!=null">	
+			and a.industry_id = #{industryId}
+		</if>
+		 <if test="agentId!=null">	
+			and a.agent_id = #{agentId}
+		</if>
+	</select>
+	
+	<insert id="addAdvertiser" parameterType="com.cloudcross.ssp.back.model.Advertiser">
+		insert into t_advertiser(industry_id,name,reg_name,homepage,contacts,tel,email,memo
+		,cpi_path,licence_path,id_path,org_path,check_memo,updated)
+		values(#{industryId},#{name},#{regName},#{homePage},#{contacts},#{tel}, #{email},#{memo}
+		,#{cpiPath},#{licencePath},#{idPath}, #{orgPath},#{checkMemo},NOW())
+	</insert>
+	
+	<update id="editAdvertiser" parameterType="com.cloudcross.ssp.back.model.Advertiser">
+		update t_advertiser 
+		set industry_id = #{industryId},name = #{name},reg_name = #{regName},homepage = #{homePage},contacts = #{contacts},tel=#{tel}
+		,email = #{email},memo = #{memo},updated = NOW()
+		,cpi_path = #{cpiPath},licence_path = #{licencePath},id_path = #{idPath},org_path = #{orgPath},check_memo = #{checkMemo}
+		where t_advertiser.id=#{id}
+	</update>
+	
+	<update id="updateAdvertiserStatus" parameterType="HashMap">
+		update t_advertiser 
+			set status = #{status},updated = NOW()
+			where t_advertiser.id in
+			<foreach item="advertiserId" collection="advertiserIdList"
+		      open="(" separator="," close=")">
+		        #{advertiserId}
+			</foreach>
+	</update>
+	
+	<update id="updateSupdated" parameterType="HashMap">
+		update t_adgroup
+			set t_adgroup.supdated= NOW()
+			where  t_adgroup.advertiser_id in
+			<foreach item="advertiserId" collection="advertiserIdList"
+		      open="(" separator="," close=")">
+		        #{advertiserId}
+			</foreach>
+	</update>
+	
+	<select id="sumBalanceById" parameterType="map" resultType="double">
+		 select sum(ad.balance) from t_advertiser ad
+		 where status != -1
+		<if test="agentId != null">		    
+		  and ad.agent_id=#{agentId} 
+	   </if>  
+	</select>
+	
+	<!-- 导出Excel用 -->
+	<select id="findDeliverEffectAnalysis" parameterType="map" resultType="com.cloudcross.ssp.back.model.Advertiser">
+		select 
+		<include refid="base_column" />
+		,b.name as industryName, count(c.advertiser_id) as orderNum from t_industry b,t_advertiser left join t_order c
+		 on t_advertiser.id = c.advertiser_id 
+		 where 1 = 1 
+		 <if test="key!=null and value!=null">
+			<choose>
+				<when test="key=='name'">
+					and t_advertiser.name like #{value}
+				</when>
+			</choose>	
+		</if>
+		 <if test="status!=null">	
+			and t_advertiser.status = #{status}
+		</if>
+		 <if test="industryId!=null">	
+			and t_advertiser.industry_id = #{industryId}
+		</if>
+		 and t_advertiser.status != -1
+		 and t_advertiser.industry_id = b.id 
+		group by t_advertiser.id
+		order by t_advertiser.id   desc
+	</select>
+</mapper>

+ 143 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/audit-banner.sql.xml

@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.auditBannerSqlMapper">
+	<sql id="base_column">
+		id,
+		banner_template_id as bannerTemplateId,
+		order_id as orderId,
+		campaign_id as campaignId,
+		adgroup_id as adGroupId,
+		visit_address as visitAddress,
+		click_address as clickAddress,
+		impression_address as impressionAddress
+		checked,
+		updated,
+		memo
+	</sql>
+	
+	<select id="countByParams" parameterType="map" resultType="int">
+	select count(a.id) from t_banner a ,t_banner_template b 
+		<where>
+		b.status != -1
+				and a.banner_template_id = b.id 
+				<if test="key!=null and value!=null">
+					<choose>
+						<when test="key=='name'">
+							and b.name like #{value}
+						</when>
+					</choose>
+				</if>
+				<if test="checked !=null">
+					and a.checked like #{checked}
+				</if>
+		</where>
+	</select>
+	
+	<select id="findByParams" parameterType="map" resultMap="AuditBanner">  
+	
+	select a.id as id,a.banner_template_id as bannerTemplateId,a.order_id as orderId,a.campaign_id as campaignId,a.adgroup_id as adGroupId,a.visit_address as visitAddress,a.click_address as clickAddress,a.impression_address as impressionAddress,
+	a.checked as checked,a.updated as updated,a.memo as memo,
+	b.id as bannerTemplateId,b.advertiser_id as advertiserId,b.name as name,b.path as path,b.path_small as pathSmall,b.type as type,b.width as width,b.height as height,b.status as status,b.updated as updated ,
+(select	name from t_advertiser where id=b.advertiser_id) as advertiserName,(select name from t_industry where id = (select industry_id from t_advertiser where id=b.advertiser_id)) as industryName from t_banner a
+    left join t_banner_template b on a.banner_template_id=b.id
+	left join t_order c on a.order_id= c.id
+	left JOIN t_advertiser d on c.advertiser_id = d.id
+	left join t_industry e on d.industry_id = e.id
+	<where>
+	b.status != -1
+			<if test="key!=null and value!=null">
+					<choose>
+						<when test="key=='name'">
+							and b.name like #{value}
+						</when>
+					</choose>
+			</if>
+			<if test="checked !=null">
+				and a.checked like #{checked}
+			</if>
+	</where>
+	order by a.id   desc
+	limit #{pager.offset}, #{pager.limit}
+	</select>
+	
+	<select id="findAudit" parameterType="map" resultMap="AuditBanner">  
+	
+	select a.id as id,a.banner_template_id as bannerTemplateId,a.order_id as orderId,a.campaign_id as campaignId,a.adgroup_id as adGroupId,a.visit_address as visitAddress,a.click_address as clickAddress,a.impression_address as impressionAddress,
+	a.checked as checked,a.updated as updated,a.memo as memo,
+	b.id as bannerTemplateId,b.advertiser_id as advertiserId,b.name as name,b.path as path,b.path_small as pathSmall,b.type as type,b.width as width,b.height as height,b.status as status,b.updated as updated ,
+	(select	name from t_advertiser where id=b.advertiser_id) as advertiserName,(select name from t_industry where id = (select industry_id from t_advertiser where id=b.advertiser_id)) as industryName from t_banner a
+    left join t_banner_template b on a.banner_template_id=b.id
+	left join t_order c on a.order_id= c.id
+	left JOIN t_advertiser d on c.advertiser_id = d.id
+	left join t_industry e on d.industry_id = e.id
+	<where>
+	b.status != -1
+			<if test="key!=null and value!=null">
+					<choose>
+						<when test="key=='name'">
+							and b.name like #{value}
+						</when>
+					</choose>
+			</if>
+			<if test="checked !=null">
+				and a.checked like #{checked}
+			</if>
+	</where>
+	order by a.id   desc
+	</select>
+	
+	<resultMap type="com.cloudcross.ssp.back.model.AuditBanner" id="AuditBanner">
+	<id property="id" column="id"/>
+	  <result property="bannerTemplateId" column="bannerTemplateId"/> 
+	<result property="orderId" column="orderId"/>
+	<result property="campaignId" column="campaignId"/> 
+  	<result property="adGroupId" column="adGroupId"/>   
+    <result property="visitAddress" column="visitAddress"/> 
+    <result property="clickAddress" column="clickAddress"/> 
+    <result property="impressionAddress" column="impressionAddress"/>
+    <result property="checked" column="checked"/>
+    <result property="updated" column="updated"/> 
+     <result property="memo" column="memo"/>
+     <result property="industryName" column="industryName"/>
+     <result property="advertiserName" column="advertiserName"/>
+    <association property="bannerTemplate" javaType="com.cloudcross.ssp.back.model.BannerTemplate" resultMap="bannerTemplate"/>
+</resultMap>  
+<resultMap type="com.cloudcross.ssp.back.model.BannerTemplate" id="bannerTemplate">  
+   <id property="id" column="bannerTemplateId"/>  
+   <result property="advertiserId" column="advertiserId"/> 
+   <result property="name" column="name"/>
+    <result property="path" column="path"/>
+    <result property="pathSmall" column="pathSmall"/>  
+   <result property="type" column="type"/>
+   <result property="width" column="width"/> 
+   <result property="height" column="height"/> 
+   <result property="status" column="status"/>   
+   <result property="updated" column="updated"/>     
+</resultMap>  
+	
+	<update id="updateBannerStatus" parameterType="HashMap">
+		update t_banner a,t_banner_template b
+		set a.checked=#{checked},b.updated = #{updated},a.updated = #{updated}
+		<if test="memo != null">
+		,a.memo = #{memo}
+		</if>
+		where
+		a.banner_template_id = b.id and
+		a.id in
+		<foreach item="id" collection="auditBannerIdList" open="(" separator=","
+			close=")">
+			#{id}
+		</foreach>
+	</update>
+	
+	<update id="updateOperatorBannerTime" parameterType="HashMap">
+		update t_banner_operator
+		set supdated = #{supdated}
+		where banner_id in
+		<foreach item="id" collection="auditBannerIdList" open="(" separator=","
+			close=")">
+			#{id}
+		</foreach>
+	</update>
+	
+</mapper>

+ 175 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/audit.sql.xml

@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.auditSqlMapper">
+	
+	<sql id="base_column">
+		t_advertiser.id as id,
+		t_industry.id as industryId,
+		t_advertiser.name as name,
+		t_advertiser.reg_name as regName,
+		t_advertiser.homepage as homePage,
+		t_advertiser.contacts,
+		t_advertiser.tel as tel,
+		t_advertiser.email as email,
+		t_advertiser.updated as updated,
+		t_advertiser.cpi_path as cpiPath,
+		t_advertiser.licence_path as licencePath,
+		t_advertiser.id_path as idPath,
+		t_advertiser.org_path as orgPath,
+		t_advertiser.check_account as checkAccount,
+		t_advertiser.check_status as checkStatus,
+		t_advertiser.check_memo as checkMemo
+	</sql>
+	
+	
+	
+	
+			
+	<select id="selectByParams"  parameterType="map" resultType="com.cloudcross.ssp.back.model.Audit">
+		select 
+		<include refid="base_column" />
+		,t_adv_agent.name as agentName,t_industry.name as industryName
+		from t_adv_agent,t_industry,t_advertiser 
+		where t_adv_agent.id=t_advertiser.agent_id 
+		
+		 <if test="key!=null and value!=null">
+			<choose>
+				<when test="key=='name'">
+					and t_advertiser.name like #{value}
+				</when>
+			</choose>	
+		</if>
+		 <if test="checkStatus!=null">	
+			and t_advertiser.check_status = #{checkStatus}
+		</if>
+		 <if test="industryId!=null">	
+			and t_advertiser.industry_id = #{industryId}
+		</if>
+		 and t_advertiser.status != -1
+		 and t_advertiser.industry_id = t_industry.id 
+		
+		order by t_advertiser.id   desc
+		limit #{pager.offset}, #{pager.limit}
+		
+	</select>
+	
+	
+	
+	<select id="countByParams" parameterType="map" resultType="int">
+		select count(a.id)
+		from t_advertiser a,t_adv_agent b 
+		where b.id=a.agent_id 
+		and a.status != -1
+		<if test="key!=null and value!=null">
+			<choose>
+				<when test="key=='name'">
+					and a.name like #{value}
+				</when>
+			</choose>	
+		</if>
+		 <if test="checkStatus!=null">	
+			and a.check_status = #{checkStatus}
+		</if>
+		 <if test="industryId!=null">	
+			and a.industry_id = #{industryId}
+		</if>
+		
+		
+	</select>
+<!-- 
+from t_advertiser a,t_adv_agent b 
+		where b.id=a.agent_id 
+		and a.status != -1
+
+<select id="selectByStatus"  parameterType="map" resultType="audit">
+		select 
+		<include refid="base_column" />
+		,b.name as industryName, count(c.advertiser_id) as orderNum from t_industry b,t_advertiser left join t_order c
+		 on t_advertiser.id = c.advertiser_id 
+		 where 1 = 1 
+		 and t_advertiser.check_status = #{checkStatus}
+		 and t_advertiser.industry_id = b.id 
+		group by t_advertiser.id
+		order by t_advertiser.id   desc
+		limit #{pager.offset}, #{pager.limit}
+	</select>
+ -->
+	<select id="selectById" parameterType="int" resultType="com.cloudcross.ssp.back.model.Audit">
+		select 
+		<include refid="base_column" />
+		
+		,t_industry.name as industryName                       
+        from t_advertiser,t_industry
+        where t_industry.id = t_advertiser.industry_id and t_advertiser.id = #{id}
+        
+	<!--	from t_advertiser 
+		<where>
+			id = #{id}
+		</where> -->
+	</select>
+	
+	<select id="selectByStatus"  parameterType="map" resultType="com.cloudcross.ssp.back.model.Audit">
+		select 
+		<include refid="base_column" />
+		,b.name as industryName, count(c.advertiser_id) as orderNum from t_industry b,t_advertiser left join t_order c
+		 on t_advertiser.id = c.advertiser_id 
+		 where 1 = 1 
+		 and t_advertiser.check_status = #{checkStatus}
+		 and t_advertiser.industry_id = b.id 
+		group by t_advertiser.id
+		order by t_advertiser.id   desc
+		limit #{pager.offset}, #{pager.limit}
+	</select>
+	
+	<select id="countByStatus" parameterType="map" resultType="int">
+		select count(a.id)
+		from t_advertiser a where check_status = #{checkStatus}
+		
+	</select>
+<!-- 	<update id="updateStatus" parameterType="HashMap">
+		update t_advertiser 
+			set check_status = #{checkStatus},updated = #{modifyDate}
+			where t_advertiser.id in
+			<foreach item="advertiserId" collection="advertiserIdList"
+		      open="(" separator="," close=")">
+		        #{auditId}
+			</foreach>
+	</update>
+ -->	
+ 	<update id="updateCheckStatus" parameterType="HashMap">
+		update t_advertiser 
+			set check_status = #{checkStatus},updated = NOW(),check_memo = #{checkMemo}
+			where t_advertiser.id =#{auditId}			
+	</update>
+	
+	
+	<!-- 导出Excel用 -->
+	<select id="findDeliverEffectAnalysis" parameterType="map" resultType="com.cloudcross.ssp.back.model.Audit">		
+		
+		select 
+		<include refid="base_column" />
+		,t_adv_agent.name as agentName,t_industry.name as industryName
+		from t_adv_agent,t_industry,t_advertiser 
+		where t_adv_agent.id=t_advertiser.agent_id 
+		
+		 <if test="key!=null and value!=null">
+			<choose>
+				<when test="key=='name'">
+					and t_advertiser.name like #{value}
+				</when>
+			</choose>	
+		</if>
+		 <if test="checkStatus!=null">	
+			and t_advertiser.check_status = #{checkStatus}
+		</if>
+		 <if test="industryId!=null">	
+			and t_advertiser.industry_id = #{industryId}
+		</if>
+		 and t_advertiser.status != -1
+		 and t_advertiser.industry_id = t_industry.id 
+		
+		order by t_advertiser.id   desc
+		
+	</select>
+	
+</mapper>

+ 172 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/campaign.sql.xml

@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.campaignSqlMapper">
+	<sql id="base_column">
+	    t_campaign.id as id,
+	    t_campaign.order_id as orderId,
+	    t_campaign.name as name,
+	    t_campaign.activate_time as activeTime,
+	    t_campaign.expire_time as expireTime,
+	    t_campaign.totalbudget as totalBudget,
+	    t_campaign.dailybudget as dailyBudget,
+	    t_campaign.impression as impression,
+	    t_campaign.click as click,
+	    t_campaign.conversion as conversion,
+	    t_campaign.daily_impression as dailyImpression,
+	    t_campaign.daily_click as dailyClick,
+	    t_campaign.daily_conversion as dailyConversion,
+	    t_campaign.memo as memo,
+	    t_campaign.status as status,
+	    t_campaign.updated as upDated
+	</sql>
+	
+	<insert id="addCampaign" parameterType="com.cloudcross.ssp.back.model.Campaign">
+		insert into t_campaign
+			(name,order_id,activate_time,expire_time,
+			totalbudget,dailybudget,impression,click,conversion,daily_impression,
+			daily_click,daily_conversion,memo,updated)
+		values
+			(#{name},#{orderId},#{activeTime},#{expireTime},#{totalBudget},
+			#{dailyBudget},#{impression},#{click},#{conversion},#{dailyImpression},
+			#{dailyClick},#{dailyConversion},#{memo},NOW())
+	</insert>
+	
+	<update id="editCampaign" parameterType="com.cloudcross.ssp.back.model.Campaign">
+		update t_campaign set
+		name = #{name},
+		activate_time = #{activeTime},
+		expire_time = #{expireTime},
+		totalbudget = #{totalBudget},
+		dailybudget = IFNULL(#{dailyBudget},default(dailybudget)),
+		conversion =IFNULL(#{conversion},default(conversion)),
+		click = IFNULL(#{click},default(click)),
+		impression =IFNULL(#{impression},default(impression)),
+		daily_click = IFNULL(#{dailyClick},default(daily_click)),
+		daily_conversion = 0,
+		daily_impression = IFNULL(#{dailyImpression},default(daily_impression)),
+		memo = IFNULL(#{memo},default(memo)),
+		updated = NOW()
+		where t_campaign.id = #{id}
+	</update>
+		
+	
+	<select id="findByParams" parameterType="map" resultType="com.cloudcross.ssp.back.model.Campaign">
+		select
+		<include refid="base_column" />
+		,count(t_adgroup.campaign_id) as groupNumber from t_campaign left join t_adgroup
+		    on t_campaign.id = t_adgroup.campaign_id 
+		    where t_campaign.order_id = #{orderId} and t_campaign.status != -1
+		 	<if test="value!=null">
+				and t_campaign.name like #{value}
+			</if>			
+		<if test="status!=null">	
+			and t_campaign.status = #{status}
+		</if>						
+			  group by t_campaign.id
+		order by t_campaign.id desc
+		limit #{pager.offset}, #{pager.limit}
+	</select>
+
+	<select id="countByParams" parameterType="map" resultType="int">
+		select count(id) from t_campaign
+		<where>
+			order_id = #{orderId} and status != -1
+			<if test="value!=null">
+				and name like #{value}
+			</if>
+						
+		<if test="status!=null">	
+			and t_campaign.status = #{status}
+		</if>
+		</where>
+	</select>
+
+	
+	<update id="updateCampaignStatus" parameterType="HashMap">
+		update t_campaign 
+		set status=#{status},
+			updated = #{upDated}
+		where
+		id in
+		<foreach item="id" collection="idList" open="(" separator=","
+			close=")">
+			#{id}
+		</foreach>
+	</update>
+	
+	<update id="updateSupdated" parameterType="HashMap">
+		update t_adgroup
+			set t_adgroup.supdated= NOW()
+			where  t_adgroup.campaign_id in
+			<foreach item="id" collection="idList" open="(" separator=","
+			close=")">
+			#{id}
+		</foreach>
+	</update>
+	
+	<select id="findById" parameterType="long" resultType="com.cloudcross.ssp.back.model.Campaign">
+		select
+		<include refid="base_column" />
+		from t_campaign 
+		where id = #{id}
+	</select>
+	
+	<select id="findByName" parameterType="String" resultType="long">
+		select
+		max(id)
+		from t_campaign 
+		where name = #{name}
+	</select>
+	
+	
+	<delete id="deleteByID" parameterType="int">
+	delete from t_campaign where id=#{id}
+	</delete>
+	
+	
+	<select id="findByOrderId" parameterType="long" resultType="com.cloudcross.ssp.back.model.Campaign">
+		select
+		<include refid="base_column" />
+		from t_campaign
+		<where>
+			order_id = #{orderId} and status != -1
+		</where>
+	</select>
+	
+	
+	<select id="selectByStatus"  parameterType="map" resultType="com.cloudcross.ssp.back.model.Campaign">
+		select 
+		<include refid="base_column" />
+		,count(t_adgroup.campaign_id) as groupNumber from t_campaign left join t_adgroup
+		 on t_campaign.id = t_adgroup.campaign_id 
+		 where 1 = 1 
+		 and t_campaign.status = #{status}
+		 and t_campaign.order_id = #{orderId}  
+		group by t_campaign.id
+		order by t_campaign.id   desc
+		limit #{pager.offset}, #{pager.limit}
+	</select>	
+	
+	<!-- 导出Excel用 -->
+	<select id="findDeliverEffectAnalysis" parameterType="map" resultType="com.cloudcross.ssp.back.model.Campaign">
+		select
+		<include refid="base_column" />
+		,count(t_adgroup.campaign_id) as groupNumber from t_campaign left join t_adgroup
+		    on t_campaign.id = t_adgroup.campaign_id 
+		    where t_campaign.order_id = #{orderId} and t_campaign.status != -1
+		 	<if test="key!=null and value!=null">
+	            <choose>
+					<when test="key=='name'">
+						and t_campaign.name like #{value}
+					</when>				
+				</choose>
+			</if>			
+		<if test="status!=null">	
+			and t_campaign.status = #{status}
+		</if>						
+			  group by t_campaign.id
+		order by t_campaign.id desc
+	</select>
+	
+
+</mapper>

+ 51 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/clientAccount.sql.xml

@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.clientAccountSqlMapper">
+
+	<select id="findOperatorByParams"  parameterType="map" resultType="com.cloudcross.ssp.back.model.ClientAccount">
+		 select t_account.id as id,t_account.name as accountName,
+    t_operator.company_name as companyName, t_operator.link_man as linkMan,
+    t_operator.tel as mobilePhone,t_account.tel as tel,t_account.state as status,t_account.sys_type as sysType from
+    t_operator,t_account where t_account.id = t_operator.admin_id and t_account.state != -1 and t_operator.status != -1 and t_account.sys_type = 2  
+		<if test="value!=null">
+			and (t_account.name like #{value}
+			or t_operator.company_name like #{value})
+		</if>
+		order by  t_account.id   desc
+	</select>
+	
+	<select id="countOperatorByParams" parameterType="map" resultType="int">
+		select count(t_account.id) 
+    	 from
+    	t_operator,t_account where t_account.id = t_operator.admin_id 
+    	and t_account.state != -1 
+    	and t_operator.status != -1 and t_account.sys_type = 2
+		<if test="value!=null">
+			and (t_account.name like #{value}
+			or t_operator.company_name like #{value})
+		</if>
+	</select>
+	
+	<select id="findAgentByParams"  parameterType="map" resultType="com.cloudcross.ssp.back.model.ClientAccount">
+		 select t_account.id as id,t_account.name as accountName,
+    t_adv_agent.name as companyName, t_adv_agent.contacts as linkMan,
+    t_adv_agent.mobile as mobilePhone,t_adv_agent.tel as tel,t_account.state as status,t_account.sys_type as sysType from
+    t_adv_agent,t_account where t_account.id = t_adv_agent.admin_id and t_account.state != -1 and t_adv_agent.status != -1 and t_account.sys_type = 3
+		<if test="value!=null">
+			and (t_account.name like #{value}
+			or t_adv_agent.name like #{value})
+		</if>
+		order by  t_account.id   desc
+	</select>
+	
+	<select id="countAgentByParams" parameterType="map" resultType="int">
+		 select count(t_account.id) from
+     t_adv_agent,t_account where t_account.id = t_adv_agent.admin_id 
+     and t_account.state != -1 and t_adv_agent.status != -1 and t_account.sys_type = 3
+		<if test="value!=null">
+			and (t_account.name like #{value}
+			or t_adv_agent.name like #{value})
+		</if>
+	</select>
+
+</mapper>

+ 98 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/dimension.sql.xml

@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.dimensionSqlMapper">
+	
+	<sql id="base_column">
+		id,
+		name,
+		account_id as advertisertId,	
+		content,
+		is_default as isDefault	
+	</sql>
+	
+	<select id="selectByName"  parameterType="string" resultType="com.cloudcross.ssp.back.model.Dimension">
+		select 
+		<include refid="base_column" />
+		from t_rpt_adv_schema
+		<where>
+			name = #{name}
+		</where>
+		order by id  desc
+	</select>
+	
+	
+	<select id="selectById" parameterType="int" resultType="com.cloudcross.ssp.back.model.Dimension">
+		select 
+		<include refid="base_column" />
+		from t_rpt_adv_schema
+		<where>
+			id = #{id} 
+			
+		</where>
+	</select>
+	
+	
+	<select id="selectByParams"  parameterType="map" resultType="com.cloudcross.ssp.back.model.Dimension">
+		select 
+		<include refid="base_column" />
+ 		from t_rpt_adv_schema 			
+		limit #{pager.offset}, #{pager.limit}
+	</select>
+	
+	<select id="selectByParams1"  parameterType="map" resultType="com.cloudcross.ssp.back.model.Dimension">
+		select 
+		<include refid="base_column" />
+ 		from t_rpt_adv_schema 			
+	</select>
+	
+	<select id="countByParams" parameterType="map" resultType="int">
+		select count(1)
+		from t_rpt_adv_schema 	 	
+			<if test="key!=null and value!=null">
+			<choose>
+				<when test="key=='id'">
+					and id like #{value}
+				</when>
+				<when test="key=='name'">
+					and name like #{value}
+				</when>
+			</choose>	
+		</if>
+		
+	</select>
+	
+	
+	
+	<insert id="addDimension" parameterType="com.cloudcross.ssp.back.model.Dimension">
+		insert into t_rpt_adv_schema(name,content,is_default)
+		values(#{name},#{content},#{isDefault})
+	</insert>
+	
+	
+	<update id="editDimension" parameterType="com.cloudcross.ssp.back.model.Dimension">
+		update t_rpt_adv_schema 
+		set name=#{name},content=#{content}
+		where id = #{id}
+	</update>
+	
+	<delete id="deleteById" parameterType="HashMap">
+		delete from t_rpt_adv_schema
+		where id in
+		<foreach item="id" collection="idList" open="(" separator=","
+			close=")">
+			#{id}
+		</foreach>
+	</delete>
+	
+	<update id="updateDimensionDefaultById" parameterType="int">
+		update t_rpt_adv_schema set is_default=1 where id = #{dimensionId};
+	</update>
+	
+	<update id="updateDimensionDefault" parameterType="int">
+		update t_rpt_adv_schema set is_default=0 where is_default = 1 and id != #{dimensionId};
+	</update>
+	
+	<select id="selectDimensionIdBydefault" parameterType="int" resultType="map">
+		select count(id) as num,id,name from t_rpt_adv_schema where is_default=1
+	</select>
+</mapper>

+ 42 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/direct.sql.xml

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.directSqlMapper">
+	<sql id="base_column">
+		id ,
+		adgroup_id  as adGroupId,
+		targettype as directType,
+		targetshow as backShow,
+		targetdata as data,
+		updated
+	</sql>
+
+	<insert id="addDirect" parameterType="com.cloudcross.ssp.back.model.Direct">
+		insert into
+		t_target_show (adgroup_id,targettype,targetshow,targetdata,updated)
+		values (#{adGroupId},#{directType},#{backShow},#{data},NOW())
+	</insert>
+
+	<select id="findByAdGroupId" parameterType="map"  resultType="com.cloudcross.ssp.back.model.Direct">
+		select
+		<include refid="base_column" />
+		from t_target_show
+		where adgroup_id=#{adGroupId}  
+			<if test="directType!=null">
+				and  targettype=#{directType} 
+			</if>
+	</select>
+
+	<update id="editDirect" parameterType="com.cloudcross.ssp.back.model.Direct">
+		UPDATE t_target_show
+		SET
+		targetshow =#{backShow},
+		targetdata = #{data},
+		updated = NOW()
+		WHERE adgroup_id=#{adGroupId}  and targettype = #{directType}
+	</update>
+
+	<delete id="deleteDirect" parameterType="map" >
+	    delete from t_target_show where adgroup_id=#{adGroupId}  and targettype = #{directType}
+	</delete>
+
+</mapper>

+ 40 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/location.sql.xml

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.locationSqlMapper">
+	<sql id="base_column">
+		id,
+		location,
+		location_t as locationT,
+		location1,
+		location2,
+		location3,
+		country,
+		cn,
+		cn_city as cnCity,
+		cn_district as cnDistrict,
+		py,
+		en_city as enCity,
+		en_district as enDistrict,
+		en
+	</sql>
+	
+	<select id="findAll" resultType="com.cloudcross.ssp.back.model.Location">
+		select
+		<include refid="base_column" />
+		from t_location where country = #{country}  
+	</select>
+	
+	<select id="findByProvince" resultType="com.cloudcross.ssp.back.model.Location">
+		select
+		<include refid="base_column" />
+		from t_location where location1 = #{location1}
+		and location2 = #{location2}
+	</select>
+	
+	
+	<select id="findByLocationT" parameterType="String" resultType="com.cloudcross.ssp.back.model.Location">
+		select <include refid="base_column" /> 
+		from t_location
+		where location_t = #{locationT}
+	</select>
+</mapper>

+ 82 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/message.sql.xml

@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.messageSqlMapper">
+	
+	<sql id="base_column">
+		t_message.id,
+		t_message.content,	
+		t_message.send_time as sendTime,
+		t_message.type
+	</sql>
+	
+	<insert id="addMessage" parameterType="com.cloudcross.ssp.back.model.Message">
+		insert into t_message(content,send_time,type)
+		values(#{content},#{sendTime},#{type})
+	</insert>
+	
+	<select id="selectByParams"  parameterType="map" resultType="com.cloudcross.ssp.back.model.Message">
+		select 
+		<include refid="base_column" />
+		from t_message
+		<where>
+			<if test="type!=null">	
+				and type = #{type}
+			</if>
+			<if test="value!=null">	
+				and content like #{value}
+			</if>
+		</where>	
+		
+		order by id   desc
+		limit #{pager.offset}, #{pager.limit}
+	</select>
+	
+	<select id="countByParams" parameterType="map" resultType="int">
+		select count(id) from t_message
+		<where>
+			<if test="type!=null">	
+				and type = #{type}
+			</if>
+			<if test="value!=null">	
+				and content like #{value}
+			</if>
+		</where>	
+	</select>
+
+	
+<select id="selectByType" parameterType="int" resultType="com.cloudcross.ssp.back.model.Message">
+		select 
+		<include refid="base_column" />
+		from t_message
+		<where>
+		<if test="type!=null">	
+			and type = #{type}
+		</if>
+			
+		</where>
+	</select>
+<!-- 	
+	<select id="selectByRead"  parameterType="int"  resultType="Message">
+		select t_message.*,t_message_read.account_id 
+	 from t_message left join t_message_read on t_message.id=t_message_read.message_id  	
+	</select>	
+	
+<select id="selectByParams"  parameterType="map" resultType="Message">
+		select 
+		<include refid="base_column" />
+		from t_message where 1 = 1
+			
+		<if test="type!=null">	
+			and type = #{type}
+		</if>
+		
+		order by id   desc
+		limit #{pager.offset}, #{pager.limit}
+	</select>
+
+
+  -->	
+
+	
+</mapper>
+	

+ 57 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/messageRead.sql.xml

@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.messageReadSqlMapper">
+	
+	<sql id="base_column">
+		id,
+		message_id as messageId,
+		account_id as accountId,
+	</sql>
+	
+	<insert id="addMessageRead" parameterType="com.cloudcross.ssp.back.model.MessageRead">
+		insert into t_message_read (message_id,account_id)
+		values(#{messageId},#{accountId})
+	</insert>
+	
+<!-- 	<select id="selectByParams"  parameterType="map" resultType="Message">
+		select 
+		<include refid="base_column" />
+		from t_message where 1 = 1
+	
+		<if test="type!=null">	
+			and t_message.type = #{type}
+		</if>
+		
+		order by id   desc
+		limit #{pager.offset}, #{pager.limit}
+	</select>
+	
+	<select id="countByParams" parameterType="map" resultType="int">
+		select count(id)
+		from t_message where 1 = 1	
+	</select>
+	
+	<update id="updateRead" parameterType="HashMap">
+	update t_order 
+		set t_message.read = #{read},send_time = #{modifyDate}
+		where t_message.id in
+		<foreach item="messageId" collection="messageIdList"
+	      open="(" separator="," close=")">
+	        #{messageId}
+		</foreach>
+	</update>
+
+	 -->
+	<select id="selectByAccountId" parameterType="java.lang.Long" resultType="long">
+		select message_id from t_message_read where 1=1
+		
+		<if test="_parameter!=null">	
+		 and t_message_read.account_id = #{_parameter,jdbcType=VARCHAR}
+		</if>
+		
+	</select>
+	
+
+	
+</mapper>
+	

+ 60 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/operator-balance.sql.xml

@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.operatorBalanceSqlMapper">
+	<sql id="base_column">
+		id,
+		operator_id as operatorId,
+		act_time as actTime,
+		num,
+		amount,
+		state,
+		balance,
+		income
+	</sql>
+	
+	<select id="findSumAmountByOperatorId" parameterType="long" resultType="float">
+		select sum(amount) from t_operator_balance where
+		operator_id = #{operatorId} and state != 2
+	</select>
+	
+	<select id="countByParams" parameterType="map" resultType="int">
+		select count(id) from t_operator_balance
+		<where> 
+		amount > 0
+		<if test="num != null">
+			and num like #{num}
+		</if>
+		</where>
+	</select>
+	
+	<select id="findByParams" parameterType="map" resultType="com.cloudcross.ssp.back.model.OperatorBalance">
+		select <include refid="base_column"/> from t_operator_balance
+		<where> 
+		amount > 0
+		<if test="num != null">
+			and num like #{num}
+		</if>
+		</where>
+		order by act_time desc
+		limit #{pager.offset}, #{pager.limit} 
+	</select>
+	
+	<update id="updateOperatorBalanceStatus" parameterType="HashMap">
+		update t_operator_balance 
+		set state=#{state}
+		<if test="reason != null">
+			  ,memo=#{reason}
+		</if>
+		where id in
+		<foreach item="id" collection="idList" open="(" separator=","
+			close=")">
+			#{id}
+		</foreach>
+	</update>
+	
+	<update id="moneyBackToOperator" parameterType="long">
+		update t_operator_balance  set balance = balance + (select amount from (select amount from t_operator_balance where id = #{id}) as a) where id = (select id from 
+(select id from t_operator_balance where operator_id = (select operator_id from t_operator_balance where id = #{id}) order by id desc limit 1) as foo )
+	</update>
+	
+</mapper>

+ 418 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/operator-report.sql.xml

@@ -0,0 +1,418 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.operatorReportSqlMapper">
+	
+	<select id="findCountForDeliverEffectAnalysis" parameterType="map" resultType="int">
+		select count(date) from ((
+		select distinct date 
+		from t_rpt_zone  
+		<where>
+		date &gt;= #{startDate} and #{endDate} &gt;=date
+		<if test="zoneId != null">
+		and zone_id=#{zoneId}
+		</if>
+		<if test="operatorId != null">
+		and operator_id=#{operatorId}
+		</if>
+		</where>
+		) as a)
+	</select>
+	
+	
+	<select id="findDeliverEffectAnalysis" parameterType="map" resultType="com.cloudcross.ssp.back.model.OperatorReport">
+		select 
+		zone_id as zoneId,date as reportDate,sum(pv) as pv,sum(uv) as uv,sum(impression) as impression,
+		sum(uimpression) as uImpression, sum(uclick) as uClick,
+		100*sum(impression)/sum(pv) as fillRate,
+        sum(click) as click,100* sum(click)/sum(impression) as clickRate,sum(ecpm) as eCpm,sum(income) as income
+		from t_rpt_zone 
+		<where>
+		date &gt;= #{startDate} and #{endDate} &gt;=date
+		<if test="zoneId!=null">
+		and zone_id=#{zoneId}
+		</if>
+		<if test="operatorId != null">
+		and operator_id=#{operatorId}
+		</if>
+		</where>
+		group by date
+		limit #{pager.offset}, #{pager.limit}
+	</select>
+	
+	<select id="findSum" parameterType="map" resultType="com.cloudcross.ssp.back.model.OperatorReport">
+		select sum(pv) as pv, sum(uv) as uv, sum(impression) as impression, sum(click) as click, sum(income) as income
+		from t_rpt_zone where date &gt;= #{startDate} and #{endDate} &gt;=date
+		<if test="zoneId!=null">
+		and zone_id=#{zoneId}
+		</if>
+		<if test="operatorId != null">
+		and operator_id=#{operatorId}
+		</if>
+	</select>
+	
+	
+	<select id="findDeliverEffectAnalysis1" parameterType="map" resultType="com.cloudcross.ssp.back.model.OperatorReport">
+		select 
+		zone_id as zoneId,date as reportDate,sum(pv) as pv,sum(uv) as uv,sum(impression) as impression,
+		sum(uimpression) as uImpression, sum(uclick) as uClick,
+		100*sum(impression)/sum(pv) as fillRate,
+        sum(click) as click,100* sum(click)/sum(impression) as clickRate,sum(ecpm) as eCpm,sum(income) as income
+		from t_rpt_zone 
+		<where>
+		date &gt;= #{startDate} and #{endDate} &gt;=date
+		<if test="zoneId!=null">
+		and zone_id=#{zoneId}
+		</if>
+		<if test="operatorId != null">
+		and operator_id=#{operatorId}
+		</if>
+		</where>
+		group by date
+	</select>
+	
+	<select id="countBySize" parameterType="map" resultType="int">
+		 select count(height) from ((select distinct width,height from t_rpt_zone_size where 
+		  date &gt;= #{startDate} and #{endDate} &gt;=date
+		  <if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		 </if>
+		 ) as a )
+	</select>
+	
+	<select id="findBySize" parameterType="map" resultType="com.cloudcross.ssp.back.model.OperatorReport">
+		select 
+	    id,date as reportDate,width ,height,100*sum(pv)/(select sum(pv) from t_rpt_zone_size 
+	    where
+            date &gt;= #{startDate} and #{endDate} &gt;=date
+		  <if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		 </if>
+		) as viewRate,sum(pv) as pv,sum(uv) as uv,sum(impression) as impression,
+		sum(uimpression) as uImpression, sum(uclick) as uClick,
+		100*impression/pv as fillRate,sum(click) as click,100*sum(click)/sum(impression) as clickRate,sum(ecpm) as eCpm,sum(income) as income
+		from t_rpt_zone_size 
+		where
+            date &gt;= #{startDate} and #{endDate} &gt;=date
+		  <if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		 </if>
+		group by width,height
+		order by impression desc
+		limit #{pager.offset}, #{pager.limit}
+	</select>
+	
+	<select id="findBySize1" parameterType="map" resultType="com.cloudcross.ssp.back.model.OperatorReport">
+		select 
+	    id,date as reportDate,width ,height,100*sum(pv)/(select sum(pv) from t_rpt_zone_size 
+	    where
+            date &gt;= #{startDate} and #{endDate} &gt;=date
+		  <if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		 </if>
+		) as viewRate,sum(pv) as pv,sum(uv) as uv,sum(impression) as impression,
+		sum(uimpression) as uImpression, sum(uclick) as uClick,
+		100*sum(impression)/sum(pv) as fillRate,sum(click) as click,100*sum(click)/sum(impression) as clickRate,sum(ecpm) as eCpm,sum(income) as income
+		from t_rpt_zone_size 
+		where
+            date &gt;= #{startDate} and #{endDate} &gt;=date
+		  <if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		 </if>
+		group by width,height
+		order by impression desc
+	</select>
+	
+	
+	<select id="countByPosition" parameterType="map" resultType="int">
+		select count(position) from ((select distinct position from t_rpt_zone_position where 
+		 date &gt;= #{startDate} and #{endDate} &gt;=date
+		  <if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		 </if>
+		 ) as a )
+	</select>
+	
+	<select id="findByPosition" parameterType="map" resultType="com.cloudcross.ssp.back.model.OperatorReport">
+		select 
+	    id,date as reportDate,position,100*sum(pv)/(select sum(pv) from t_rpt_zone_position where 
+		 date &gt;= #{startDate} and #{endDate} &gt;=date
+		  <if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		 </if>
+		 ) as viewRate,sum(pv) as pv,sum(uv) as uv,sum(impression) as impression ,
+		 sum(uimpression) as uImpression, sum(uclick) as uClick,
+		 100*sum(impression)/sum(pv) as fillRate,sum(click) as click ,100*sum(click)/sum(impression) as clickRate,sum(eCpm) as eCpm,sum(income) as income 
+		from t_rpt_zone_position
+		where 
+		 date &gt;= #{startDate} and #{endDate} &gt;=date
+		  <if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		 </if>
+		group by position 
+		order by impression desc 
+      	limit #{pager.offset}, #{pager.limit}
+	</select>
+	
+	<select id="findByPosition1" parameterType="map" resultType="com.cloudcross.ssp.back.model.OperatorReport">
+		select 
+	    id,date as reportDate,position,100*sum(pv)/(select sum(pv) from t_rpt_zone_position where 
+		 date &gt;= #{startDate} and #{endDate} &gt;=date
+		  <if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		 </if>
+		 ) as viewRate,sum(pv) as pv,sum(uv) as uv,sum(impression) as impression ,
+		 sum(uimpression) as uImpression, sum(uclick) as uClick,
+		 100*sum(impression)/sum(pv) as fillRate,sum(click) as click ,100*sum(click)/sum(impression) as clickRate,sum(eCpm) as eCpm,sum(income) as income 
+		from t_rpt_zone_position
+		where 
+		 date &gt;= #{startDate} and #{endDate} &gt;=date
+		  <if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		 </if>
+		group by position  
+		order by impression desc
+	</select>
+	
+	<select id="countBySystem" parameterType="map" resultType="int">
+		  select count(os) from ((select distinct os from t_rpt_zone_os where 
+		  date &gt;= #{startDate} and #{endDate} &gt;=date
+		  <if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		 </if>
+		  ) as a)
+	</select>
+	<select id="findBySystem" parameterType="map" resultType="com.cloudcross.ssp.back.model.OperatorReport">
+		select 
+	    os as system,100*(sum(pv)/(select sum(pv) from t_rpt_zone_os
+		where date &gt;= #{startDate} and #{endDate} &gt;=date
+		<if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		</if> 
+		   )) as viewRate,
+		sum(pv) as pv,sum(uv) as uv,sum(impression) as impression,
+		sum(uimpression) as uImpression, sum(uclick) as uClick,
+		100*(sum(impression)/sum(pv)) as fillRate,
+        sum(click) as click,100*(sum(click)/sum(impression)) as clickRate,sum(ecpm) as eCpm,sum(income) as income
+		from t_rpt_zone_os 
+		where date &gt;= #{startDate} and #{endDate} &gt;=date
+		<if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		</if>
+		group by os
+		order by impression desc
+		limit #{pager.offset}, #{pager.limit}
+	</select>
+	
+	
+	<select id="findBySystem1" parameterType="map" resultType="com.cloudcross.ssp.back.model.OperatorReport">
+		select 
+	    os as system,100*(sum(pv)/(select sum(pv) from t_rpt_zone_os
+		where date &gt;= #{startDate} and #{endDate} &gt;=date
+		<if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		</if> 
+		   )) as viewRate,
+		sum(pv) as pv,sum(uv) as uv,sum(impression) as impression,
+		sum(uimpression) as uImpression, sum(uclick) as uClick,
+		100*(sum(impression)/sum(pv)) as fillRate,
+        sum(click) as click,100*(sum(click)/sum(impression)) as clickRate,sum(ecpm) as eCpm,sum(income) as income
+		from t_rpt_zone_os 
+		where date &gt;= #{startDate} and #{endDate} &gt;=date
+		<if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		</if>
+		group by os
+		order by impression desc
+	</select>
+	
+	
+	<select id="findByDevice" parameterType="map" resultType="com.cloudcross.ssp.back.model.OperatorReport">
+		select 
+	    id,date as reportDate,device,100*sum(pv)/
+	    (select sum(pv) from t_rpt_zone_device where date &gt;= #{startDate} and #{endDate} &gt;=date
+		<if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		</if> ) as viewRate,
+	    sum(pv) as pv,sum(uv) as uv,sum(impression) as impression ,
+	    sum(uimpression) as uImpression, sum(uclick) as uClick,
+	    100*sum(impression)/sum(pv) as fillRate,sum(click) as click ,100*sum(click)/sum(impression) as clickRate,sum(eCpm) as eCpm,sum(income) as income
+        from t_rpt_zone_device
+		where date &gt;= #{startDate} and #{endDate} &gt;=date
+		<if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		</if> 
+		group by device 
+		order by impression desc
+	</select>
+	
+	<select id="countByAllAreal" parameterType="map" resultType="int">
+		select count(cn) from ((select distinct cn from t_rpt_zone_location a,t_location b 
+  		where
+		a.location = b.location and date &gt;= #{startDate} and #{endDate} &gt;=date
+		<if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		</if> ) as t)
+	</select>
+	
+	<select id="findByAllAreal" parameterType="map" resultType="com.cloudcross.ssp.back.model.OperatorReport">
+		  select 
+	    a.id,a.date as reportDate,b.cn,b.cn_city,100*sum(a.pv)/(select sum(pv) from t_rpt_zone_location where date &gt;= #{startDate} and #{endDate} &gt;=date
+		<if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		</if>) as viewRate,
+	    sum(a.pv) as pv,sum(a.uv) as uv,sum(a.impression) as impression,
+	    sum(uimpression) as uImpression, sum(uclick) as uClick,100*sum(a.impression)/sum(a.pv) as fillRate,sum(a.click) as click,100*sum(a.click)/sum(a.impression) as clickRate,sum(a.eCpm) as eCpm,sum(a.income) as income
+		from t_rpt_zone_location a,t_location b
+	 	where
+		a.location = b.location  and a.date &gt;= #{startDate} and #{endDate} &gt;=a.date
+		<if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		</if>
+		group by b.cn 
+		 order by cn
+		limit #{pager.offset}, #{pager.limit}
+	</select>
+	
+	<select id="findByAreal" parameterType="map" resultType="com.cloudcross.ssp.back.model.OperatorReport">
+		select 
+	    b.cn,b.cn_city,100*sum(a.pv)/(select sum(pv) from t_rpt_zone_location where date &gt;= #{startDate} and #{endDate} &gt;=date
+		<if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		</if>) as viewRate,
+	    sum(a.pv) as pv,sum(a.uv) as uv,sum(a.impression),
+	    sum(uimpression) as uImpression, sum(uclick) as uClick,
+	    100*sum(a.impression)/sum(a.pv) as fillRate,sum(a.click),100*sum(a.click)/sum(a.impression) as clickRate,sum(a.eCpm) as eCpm,sum(a.income) as income
+		from t_rpt_zone_location a,t_location b
+		where
+		a.location=b.location and b.cn=#{cn} and date &gt;= #{startDate} and #{endDate} &gt;=date
+		<if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		</if>
+       group by b.cn_city
+	</select>
+	
+	<select id="findAllArea" parameterType="map" resultType="com.cloudcross.ssp.back.model.OperatorReport">
+		select 
+	    a.id,a.date as reportDate,b.cn,b.cn_city,100*sum(a.pv)/(select sum(pv) from t_rpt_zone_location where date &gt;= #{startDate} and #{endDate} &gt;=date
+		<if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		</if>) as viewRate,
+	    sum(a.pv) as pv,sum(a.uv) as uv,sum(a.impression) as impression,
+	    sum(uimpression) as uImpression, sum(uclick) as uClick,
+	    100*sum(a.impression)/sum(a.pv) as fillRate,sum(a.click) as click,100*sum(a.click)/sum(a.impression) as clickRate,sum(a.eCpm) as eCpm,sum(a.income) as income
+		from t_rpt_zone_location a,t_location b
+	 	where
+		a.location = b.location  and a.date &gt;= #{startDate} and #{endDate} &gt;=a.date
+		<if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		</if>
+		group by b.cn 
+		order by b.cn
+	</select>
+	
+	
+	<select id="countByPlace" parameterType="map" resultType="int">
+		select count(place_id) from ((select distinct place_id from t_rpt_zone_place where 
+		date &gt;= #{startDate} and #{endDate} &gt;=date
+		<if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		</if>) as a) 
+	</select>
+	
+	<select id="findByPlace" parameterType="map" resultType="com.cloudcross.ssp.back.model.OperatorReport">
+		select t_place.name as place,sum(p.pv) as pv, sum(p.uv) as uv, sum(p.impression) as impression,
+		sum(uimpression) as uImpression, sum(uclick) as uClick,
+		 sum(p.click) as click, sum(p.ecpm) as eCpm,
+    sum(p.income) as income, 100 * sum(p.pv) / (select sum(pv) from t_rpt_zone_place where date &gt;= #{startDate} and #{endDate} &gt;=date
+		<if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		</if> ) as viewRate, 
+    100 * sum(p.impression) / sum(p.pv) as fillRate, 100 * sum(p.click) / sum(p.impression) as clickRate
+    from ((select distinct place_id from t_rpt_zone_place where date &gt;= #{startDate} and #{endDate} &gt;=date
+		<if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		</if> ) as a ), 
+    t_rpt_zone_place as p, t_place where a.place_id = p.place_id and a.place_id = t_place.id
+    and date &gt;= #{startDate} and #{endDate} &gt;=date
+		<if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		</if> 
+    group by p.place_id
+    order by p.impression desc
+	limit #{pager.offset}, #{pager.limit}
+	</select>
+	
+	
+	<select id="findByPlace1" parameterType="map" resultType="com.cloudcross.ssp.back.model.OperatorReport">
+		select t_place.name as place,sum(p.pv) as pv, sum(p.uv) as uv, sum(p.impression) as impression, 
+		sum(uimpression) as uImpression, sum(uclick) as uClick,
+		sum(p.click) as click, sum(p.ecpm) as eCpm,
+    sum(p.income) as income, 100 * sum(p.pv) / (select sum(pv) from t_rpt_zone_place where date &gt;= #{startDate} and #{endDate} &gt;=date
+		<if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		</if> ) as viewRate, 
+    100 * sum(p.impression) / sum(p.pv) as fillRate, 100 * sum(p.click) / sum(p.impression) as clickRate
+    from ((select distinct place_id from t_rpt_zone_place where date &gt;= #{startDate} and #{endDate} &gt;=date
+		<if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		</if> ) as a ), 
+    t_rpt_zone_place as p, t_place where a.place_id = p.place_id and a.place_id = t_place.id
+    and date &gt;= #{startDate} and #{endDate} &gt;=date
+		<if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		</if> 
+    group by p.place_id
+    order by p.impression desc
+	</select>
+	
+	<select id="countByApmac" parameterType="map" resultType="int">
+			select count(apmac) from ((select distinct apmac from t_rpt_zone_ap where 
+		 date &gt;= #{startDate} and date &lt;= #{endDate}
+		 <if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+		</if>
+		 ) as a) 
+	</select>
+	
+	<select id="findByApmac" parameterType="map" resultType="com.cloudcross.ssp.back.model.OperatorReport">
+		select apmac, sum(pv) as pv, sum(uv) as uv, sum(impression) as impression, 
+		sum(uimpression) as uImpression,
+		sum(uclick) as uClick,sum(click) as click, sum(ecpm) as eCpm,
+    sum(income) as income, 100 * sum(pv) / (select sum(pv) from t_rpt_zone_ap where date &gt;= #{startDate} and date &lt;= #{endDate}
+    <if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+	</if>
+    ) as viewRate, 
+    100 * sum(impression) / sum(pv) as fillRate, 100 * sum(click) / sum(impression) as clickRate
+    from  t_rpt_zone_ap  where 
+    date &gt;= #{startDate} and date &lt;= #{endDate}
+    <if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+	</if>
+    group by apmac
+    order by impression desc
+	limit #{pager.offset}, #{pager.limit}
+	</select>
+	
+	<select id="findByApmac1" parameterType="map" resultType="com.cloudcross.ssp.back.model.OperatorReport">
+			select apmac, sum(pv) as pv, sum(uv) as uv, sum(impression) as impression, 
+		sum(uimpression) as uImpression,
+		sum(uclick) as uClick,sum(click) as click, sum(ecpm) as eCpm,
+    sum(income) as income, 100 * sum(pv) / (select sum(pv) from t_rpt_zone_ap where date &gt;= #{startDate} and date &lt;= #{endDate}
+    <if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+	</if>
+    ) as viewRate, 
+    100 * sum(impression) / sum(pv) as fillRate, 100 * sum(click) / sum(impression) as clickRate
+    from  t_rpt_zone_ap  where 
+    date &gt;= #{startDate} and date &lt;= #{endDate}
+    <if test="operatorId!=null">
+		    and operator_id=#{operatorId}
+	</if>
+    group by apmac
+    order by impression desc
+	</select>
+	
+	
+	
+</mapper>

+ 115 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/operator.sql.xml

@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.operatorSqlMapper">
+	
+	<sql id="base_column">
+	id,
+	company_name as companyName,
+	link_man as linkMan,
+	tel,
+	account,
+	mobile,
+	homepage as homePage,
+	account_name as accountName,
+	bank,
+	status,
+	admin_id as adminId,
+	address,
+	zip,
+	email
+	</sql>
+	<select id="findById" parameterType="long" resultType="com.cloudcross.ssp.back.model.Operator">
+		select 
+		<include refid="base_column" />
+		from t_operator
+		<where>
+			id = #{id} and status !=-1
+		</where>
+	</select>
+	
+	<select id="getNew" parameterType="com.cloudcross.ssp.back.model.Operator" resultType="com.cloudcross.ssp.back.model.Operator">
+		select 
+		<include refid="base_column" />
+		from t_operator
+		<where>
+			status !=-1 and admin_id = #{adminId} and account_name = #{accountName}  and company_name = #{companyName}
+		</where>
+	</select>
+	
+	<select id="findAllOperator" resultType="com.cloudcross.ssp.back.model.Operator">
+		select 
+		<include refid="base_column" />
+		from t_operator
+		<where>
+			 status !=-1
+		</where>
+	</select>
+	
+	<update id="editOperator" parameterType="com.cloudcross.ssp.back.model.Operator">
+		update t_operator
+		<set>
+			<if test="accountName != null and accountName != ''">
+				account_name=#{accountName},
+			</if>
+			<if test="account != null and account != ''">
+				account=#{account},
+			</if>
+			<if test="companyName != null and companyName != ''">
+				company_name=#{companyName},
+			</if>
+			<if test="status != null and status != ''">
+				status=#{status},
+			</if>
+			<if test="linkMan != null and linkMan != ''">
+				link_man=#{linkMan},
+			</if>
+			<if test="tel != null and tel != ''">
+				tel=#{tel},
+			</if>
+			<if test="bank != null and bank != ''">
+				bank=#{bank},
+			</if>
+			<if test="mobile != null and mobile != ''">
+				mobile=#{mobile},
+			</if>
+			<if test="homePage != null and homePage != ''">
+				homepage=#{homePage},
+			</if>
+			<if test="address != null and address != ''">
+				address=#{address},
+			</if>
+			<if test="zip != null and zip != ''">
+				zip=#{zip},
+			</if>
+			<if test="email != null and email != ''">
+				email=#{email}
+			</if>
+		</set>
+		where id=#{id}
+	</update>
+	
+	<insert id="add" parameterType="com.cloudcross.ssp.back.model.Operator">
+		insert into t_operator(company_name,link_man,tel,mobile,account,homepage,account_name,bank,status,admin_id,address,zip,email)
+		values(#{companyName},#{linkMan},#{tel},#{mobile},#{account},#{homePage},#{accountName},#{bank}, #{status},#{adminId},#{address},#{zip},#{email})
+	</insert>
+	
+	<select id="selectById" parameterType="int" resultType="com.cloudcross.ssp.back.model.Operator">
+		select 
+		<include refid="base_column" />
+		from t_operator
+		<where>
+			id = #{id} and status !=-1
+		</where>
+	</select>
+	
+	<update id="updateOperatorStatus" parameterType="HashMap">
+		update t_operator
+			set status = #{status},supdated = NOW()
+			where id in
+			<foreach item="operatorId" collection="operatorList"
+		      open="(" separator="," close=")">
+		        #{operatorId}
+			</foreach>
+	</update>
+	
+</mapper>

+ 180 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/order.sql.xml

@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.orderSqlMapper">
+	
+	<sql id="base_column">
+		t_order.id as id,
+		advertiser_id as advertiserId,
+		t_order.name as name,
+		t_order.budget as budget,
+		t_order.comment as comment,
+		t_order.status as status,
+		t_order.updated as updated
+		
+	</sql>
+	
+	
+	
+<!-- 	<select id="countByParams" parameterType="map" resultType="int">
+		select count(id) from t_order 
+		<if test="key!=null and value!=null">
+			<choose>
+				<when test="key=='name'">
+					where name like #{value}
+				</when>
+				<when test="key=='advertiserId'">
+					where id like #{value}
+				</when>
+			</choose>	
+		</if>
+	</select>
+	 -->
+	<select id="selectByParams"  parameterType="map" resultType="com.cloudcross.ssp.back.model.Order">
+		select 
+		<include refid="base_column" />
+	,count(t_campaign.order_id) as campaignNumber from t_order left join t_campaign on t_order.id = t_campaign.order_id 
+		where
+		t_order.advertiser_id = #{advertiserId} 
+		and t_order.status != -1
+		<if test="value!=null">
+			and t_order.name like #{value}
+		</if>
+		
+		<if test="status!=null">	
+			and t_order.status = #{status}
+		</if>
+		group by t_order.id	
+		order by t_order.id   desc
+		limit #{pager.offset}, #{pager.limit}
+	</select>
+	
+	  <select id="countByParams" parameterType="map" resultType="int">
+		select count(t_order.id)
+		from t_order where status != -1
+		and t_order.advertiser_id = #{advertiserId} 
+		<if test="value!=null">
+			and t_order.name like #{value}
+		</if>
+		
+		<if test="status!=null">	
+			and t_order.status = #{status}
+		</if>
+		
+		 <if test="status!=null">	
+			and t_order.status = #{status}
+		</if>	
+	</select>
+	
+	  <select id="selectByAdvertiserType" parameterType="string" resultType="com.cloudcross.ssp.back.model.Order">
+		select
+		<include refid="base_column" />
+		from t_order where advertiser_id=#{advertiserType} 
+		and status != -1
+	</select>
+	
+	
+	<select id="selectByStatus"  parameterType="map" resultType="com.cloudcross.ssp.back.model.Order">
+		select 
+		<include refid="base_column" />
+		,count(t_campaign.order_id) as campaignNumber from t_order left join t_campaign on t_order.id = t_campaign.order_id 
+		 where 1 = 1 
+		 and t_order.status = #{status}
+		 and t_order.advertiser_id = #{advertiserId}  
+		group by t_order.id
+		order by t_order.id   desc
+		limit #{pager.offset}, #{pager.limit}
+	</select>
+	
+
+	
+	<select id="selectById" parameterType="int" resultType="com.cloudcross.ssp.back.model.Order">
+		select 
+		<include refid="base_column" />
+		from t_order
+		<where>
+			id = #{id} and
+			status != -1
+		</where>
+	</select>
+	
+	<select id="findByAdvertiserId" parameterType="int" resultType="com.cloudcross.ssp.back.model.Order">
+		select 
+		<include refid="base_column" />
+		from t_order
+		<where>
+			advertiser_id = #{advertiserId}
+			and
+			status != -1
+		</where>
+	</select>
+	
+	<select id="selectByName" parameterType="String" resultType="long">
+		select
+		max(id)
+		from t_order
+		<where>
+			t_order.name = #{name} and
+			status != -1
+		</where>
+	</select>
+	
+	
+	<insert id="addOrder" parameterType="com.cloudcross.ssp.back.model.Order">
+		insert into t_order(name,budget,comment,updated,advertiser_id)
+		values(#{name},#{budget},#{comment},#{updated},#{advertiserId})
+	</insert>
+	
+	<update id="editOrder" parameterType="com.cloudcross.ssp.back.model.Order">
+		update t_order set t_order.name=#{name},t_order.budget=#{budget},t_order.comment=#{comment},
+		<if test="status !=null">
+			status=#{status},
+			</if>
+			updated=#{updated} 
+		 where t_order.id=#{id}
+	</update>
+	
+	<update id="updateOrderStatus" parameterType="HashMap">
+		update t_order 
+			set status = #{status},updated = #{modifyDate}
+			where t_order.id in
+			<foreach item="orderId" collection="orderIdList"
+		      open="(" separator="," close=")">
+		        #{orderId}
+			</foreach>
+	</update>
+	
+	<update id="updateSupdated" parameterType="HashMap">
+		update t_adgroup
+			set t_adgroup.supdated= NOW()
+			where  t_adgroup.order_id in
+			<foreach item="orderId" collection="orderIdList"
+		      open="(" separator="," close=")">
+		        #{orderId}
+			</foreach>
+	</update>
+	
+	<!-- 导出Excel用 -->
+	<select id="findDeliverEffectAnalysis" parameterType="map" resultType="com.cloudcross.ssp.back.model.Order">
+		select 
+		<include refid="base_column" />
+	,count(t_campaign.order_id) as campaignNumber from t_order left join t_campaign on t_order.id = t_campaign.order_id 
+		where
+		t_order.advertiser_id = #{advertiserId} 
+		and t_order.status != -1
+		<if test="key!=null and value!=null">
+			<choose>
+				<when test="key=='name'">
+					and t_order.name like #{value}
+				</when>
+			</choose>	
+		</if>
+		
+		<if test="status!=null">	
+			and t_order.status = #{status}
+		</if>
+		group by t_order.id	
+		order by t_order.id   desc
+	</select>
+	
+</mapper>
+	

+ 1275 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/report.sql.xml

@@ -0,0 +1,1275 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.adReportSqlMapper">
+	
+	<sql id="base_column">
+		id, 
+		advertiser_id as advertiserId,
+		order_id as orderId,
+		campaign_id as campaignId,
+		adgroup_id  as adGroupId,
+		 banner.id as bannerId,
+		t_banner.banner_template_id as bannerTemplateId,
+		t_advertiser.name as advertiserName,
+		t_order.name as orderName,
+		t_campaign.name as campaignName,
+		t_adgroup.name  as adGroupName,
+		t_banner_template.name as bannerName,
+		date as reportDate,
+		request,
+		impression,
+		impressionRate,
+		click,
+		visit,
+		conversion,
+		conversionRate,
+		clickRate,
+		visitRate,
+		conversionRate,
+		ecmp as eCmp,
+		consume,
+		os,
+		location,
+		impressionSum,
+		clickSum,
+		visitSum,
+		conversionSum,
+		eCmpSum,
+		consumeSum,
+		clickRatesum,
+		visitRatesum,
+		conversionRatesum
+		
+	</sql>
+	
+	<select id="findCountForDeliverEffectAnalysis" parameterType="map" resultType="int">
+		select count(1) 
+		from t_rpt_advertiser ad,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template
+           
+        <where>
+	 	    ad.advertiser_id=t_advertiser.id  and  ad.order_id = t_order.id  and ad.campaign_id= t_campaign.id   
+	 	    and  ad.adgroup_id=t_adgroup.id
+            and  ad.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id
+	 	   
+			<if test="advertiserId !=null">
+			 and ad.advertiser_id=#{advertiserId}
+			</if>
+			
+			<if test="orderId !=null">
+			 and ad.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and ad.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and ad.adgroup_id=#{adGroupId}
+			</if>
+		 
+			<if test="startDate!=null and endDate!=null"> 
+	            and ad.date &gt;= #{startDate} and #{endDate} &gt;=ad.date
+			</if>
+		
+		</where>
+	</select>
+	
+	
+	
+	
+	
+	
+	<select id="findCountForLocation" parameterType="map" resultType="int">
+		select count(1) 
+		from t_rpt_adv_location rl, t_advertiser, t_order, t_campaign, t_adgroup
+        
+       	<where>	
+            rl.advertiser_id = t_advertiser.id  and  rl.order_id =  t_order.id and rl.campaign_id = t_campaign.id  and rl.adgroup_id =  t_adgroup.id
+	 	   	
+			<if test="advertiserId !=null">
+			 and rl.advertiser_id=#{advertiserId}
+			</if>
+			
+			<if test="orderId !=null">
+			 and rl.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and rl.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and rl.adgroup_id=#{adGroupId}
+			</if>
+		 
+			<if test="startDate!=null and endDate!=null"> 
+	            and rl.date &gt;= #{startDate} and #{endDate} &gt;=rl.date
+			</if>
+		
+		</where>
+	</select>
+	
+    <select id="findCountForOs" parameterType="map" resultType="int">
+		select count(1) 
+		from t_rpt_adv_os ros, t_advertiser, t_order, t_campaign, t_adgroup        
+        <where>	          
+           ros.advertiser_id = t_advertiser.id  and  ros.order_id =  t_order.id and ros.campaign_id = t_campaign.id  and ros.adgroup_id =  t_adgroup.id
+	 	   
+			<if test="advertiserId !=null">
+			 and ros.advertiser_id=#{advertiserId}
+			</if>
+			
+			<if test="orderId !=null">
+			 and ros.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and ros.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and ros.adgroup_id=#{adGroupId}
+			</if>
+		 
+			<if test="startDate!=null and endDate!=null"> 
+	            and ros.date &gt;= #{startDate} and #{endDate} &gt;=ros.date
+			</if>
+		
+		</where>
+	</select>
+	
+	
+    <select id="findCountForScene" parameterType="map" resultType="int">
+		select count(1) 
+		from t_rpt_adv_place rp, t_advertiser, t_order, t_campaign, t_adgroup , t_place      
+
+        <where>      
+            rp.place_id = t_place.id and  rp.advertiser_id = t_advertiser.id  
+            and  rp.order_id = t_order.id and rp.campaign_id = t_campaign.id  and rp.adgroup_id =  t_adgroup.id
+			<if test="advertiserId !=null">
+			 and rp.advertiser_id=#{advertiserId}
+			</if>
+			
+			<if test="orderId !=null">
+			 and rp.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and rp.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and rp.adgroup_id=#{adGroupId}
+			</if>
+		 
+			<if test="startDate!=null and endDate!=null"> 
+	         and rp.date &gt;= #{startDate} and rp.date &lt;= #{endDate}
+			</if>
+		
+		</where>
+	</select>
+	
+	
+	 <select id="findByTotalReport" parameterType="map" resultType="com.cloudcross.ssp.back.model.DeliverAnalysis">
+		select 
+		t_advertiser.name as advertiserName,  t_order.name as orderName, t_campaign.name as campaignName, t_adgroup.name  as adGroupName, t_banner_template.name as bannerName, 
+        
+         ad.date as reportDate,     
+        (select sum(t_rpt_advertiser.impression) from  t_rpt_advertiser ,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template where  t_rpt_advertiser.advertiser_id=t_advertiser.id  and  t_rpt_advertiser.order_id = t_order.id  and t_rpt_advertiser.campaign_id= t_campaign.id   
+	 	    and  t_rpt_advertiser.adgroup_id=t_adgroup.id
+            and  t_rpt_advertiser.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id 
+
+			<if test="advertiserId !=null">
+			 and t_rpt_advertiser.advertiser_id=#{advertiserId}
+			</if>
+			<if test="orderId !=null">
+			 and t_rpt_advertiser.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and t_rpt_advertiser.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and t_rpt_advertiser.adgroup_id=#{adGroupId}
+			</if>
+		 
+	    <if test="startDate!=null and endDate!=null"> 
+            and date &gt;= #{startDate} and #{endDate} &gt;=date
+	    </if>) as impressionSum,ad.impression,ad.click,visit,ad.conversion, 
+        100*ad.click/ad.impression as clickRate ,100*visit/ad.click as visitRate ,100*ad.conversion/visit as conversionRate ,ecmp as eCmp,ad.consume,
+		(select sum(t_rpt_advertiser.click) from t_rpt_advertiser ,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template where  t_rpt_advertiser.advertiser_id=t_advertiser.id  and  t_rpt_advertiser.order_id = t_order.id  and t_rpt_advertiser.campaign_id= t_campaign.id   
+	 	    and  t_rpt_advertiser.adgroup_id=t_adgroup.id
+            and  t_rpt_advertiser.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id 
+
+			<if test="advertiserId !=null">
+			 and t_rpt_advertiser.advertiser_id=#{advertiserId}
+			</if>
+			<if test="orderId !=null">
+			 and t_rpt_advertiser.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and t_rpt_advertiser.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and t_rpt_advertiser.adgroup_id=#{adGroupId}
+			</if>
+		 
+	    <if test="startDate!=null and endDate!=null"> 
+            and date &gt;= #{startDate} and #{endDate} &gt;=date
+	    </if>) as clickSum, (select sum(t_rpt_advertiser.visit) from t_rpt_advertiser ,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template where  t_rpt_advertiser.advertiser_id=t_advertiser.id  and  t_rpt_advertiser.order_id = t_order.id  and t_rpt_advertiser.campaign_id= t_campaign.id   
+	 	    and  t_rpt_advertiser.adgroup_id=t_adgroup.id
+            and  t_rpt_advertiser.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id 
+
+			<if test="advertiserId !=null">
+			 and t_rpt_advertiser.advertiser_id=#{advertiserId}
+			</if>
+			<if test="orderId !=null">
+			 and t_rpt_advertiser.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and t_rpt_advertiser.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and t_rpt_advertiser.adgroup_id=#{adGroupId}
+			</if>
+		 
+	    <if test="startDate!=null and endDate!=null"> 
+            and date &gt;= #{startDate} and #{endDate} &gt;=date
+	    </if>) as visitSum,
+        (select sum(t_rpt_advertiser.conversion) from t_rpt_advertiser ,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template where  t_rpt_advertiser.advertiser_id=t_advertiser.id  and  t_rpt_advertiser.order_id = t_order.id  and t_rpt_advertiser.campaign_id= t_campaign.id   
+	 	    and  t_rpt_advertiser.adgroup_id=t_adgroup.id
+            and  t_rpt_advertiser.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id 
+
+			<if test="advertiserId !=null">
+			 and t_rpt_advertiser.advertiser_id=#{advertiserId}
+			</if>
+			<if test="orderId !=null">
+			 and t_rpt_advertiser.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and t_rpt_advertiser.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and t_rpt_advertiser.adgroup_id=#{adGroupId}
+			</if>
+		 
+	    <if test="startDate!=null and endDate!=null"> 
+            and date &gt;= #{startDate} and #{endDate} &gt;=date
+	    </if>) as conversionSum, 
+		(select sum(t_rpt_advertiser.ecmp) from t_rpt_advertiser ,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template where  t_rpt_advertiser.advertiser_id=t_advertiser.id  and  t_rpt_advertiser.order_id = t_order.id  and t_rpt_advertiser.campaign_id= t_campaign.id   
+	 	    and  t_rpt_advertiser.adgroup_id=t_adgroup.id
+            and  t_rpt_advertiser.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id 
+
+			<if test="advertiserId !=null">
+			 and t_rpt_advertiser.advertiser_id=#{advertiserId}
+			</if>
+			<if test="orderId !=null">
+			 and t_rpt_advertiser.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and t_rpt_advertiser.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and t_rpt_advertiser.adgroup_id=#{adGroupId}
+			</if>
+		 
+	    <if test="startDate!=null and endDate!=null"> 
+            and date &gt;= #{startDate} and #{endDate} &gt;=date
+	    </if>) as eCmpSum, (select sum(t_rpt_advertiser.consume) from t_rpt_advertiser ,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template where  t_rpt_advertiser.advertiser_id=t_advertiser.id  and  t_rpt_advertiser.order_id = t_order.id  and t_rpt_advertiser.campaign_id= t_campaign.id   
+	 	    and  t_rpt_advertiser.adgroup_id=t_adgroup.id
+            and  t_rpt_advertiser.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id 
+
+			<if test="advertiserId !=null">
+			 and t_rpt_advertiser.advertiser_id=#{advertiserId}
+			</if>
+			<if test="orderId !=null">
+			 and t_rpt_advertiser.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and t_rpt_advertiser.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and t_rpt_advertiser.adgroup_id=#{adGroupId}
+			</if>
+		 
+	    <if test="startDate!=null and endDate!=null"> 
+            and date &gt;= #{startDate} and #{endDate} &gt;=date
+	    </if>) as consumeSum, 
+        100*(select sum(t_rpt_advertiser.click) from t_rpt_advertiser ,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template where  t_rpt_advertiser.advertiser_id=t_advertiser.id  and  t_rpt_advertiser.order_id = t_order.id  and t_rpt_advertiser.campaign_id= t_campaign.id   
+	 	    and  t_rpt_advertiser.adgroup_id=t_adgroup.id
+            and  t_rpt_advertiser.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id 
+
+			<if test="advertiserId !=null">
+			 and t_rpt_advertiser.advertiser_id=#{advertiserId}
+			</if>
+			<if test="orderId !=null">
+			 and t_rpt_advertiser.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and t_rpt_advertiser.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and t_rpt_advertiser.adgroup_id=#{adGroupId}
+			</if>
+		 
+	    <if test="startDate!=null and endDate!=null"> 
+            and date &gt;= #{startDate} and #{endDate} &gt;=date
+	    </if>)/(select sum(t_rpt_advertiser.impression) from t_rpt_advertiser ,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template where  t_rpt_advertiser.advertiser_id=t_advertiser.id  and  t_rpt_advertiser.order_id = t_order.id  and t_rpt_advertiser.campaign_id= t_campaign.id   
+	 	    and  t_rpt_advertiser.adgroup_id=t_adgroup.id
+            and  t_rpt_advertiser.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id 
+
+			<if test="advertiserId !=null">
+			 and t_rpt_advertiser.advertiser_id=#{advertiserId}
+			</if>
+			<if test="orderId !=null">
+			 and t_rpt_advertiser.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and t_rpt_advertiser.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and t_rpt_advertiser.adgroup_id=#{adGroupId}
+			</if>
+		 
+	    <if test="startDate!=null and endDate!=null"> 
+            and date &gt;= #{startDate} and #{endDate} &gt;=date
+	    </if>) as clickRatesum, 
+		100*(select sum(t_rpt_advertiser.visit) from t_rpt_advertiser ,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template where  t_rpt_advertiser.advertiser_id=t_advertiser.id  and  t_rpt_advertiser.order_id = t_order.id  and t_rpt_advertiser.campaign_id= t_campaign.id   
+	 	    and  t_rpt_advertiser.adgroup_id=t_adgroup.id
+            and  t_rpt_advertiser.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id 
+
+			<if test="advertiserId !=null">
+			 and t_rpt_advertiser.advertiser_id=#{advertiserId}
+			</if>
+			<if test="orderId !=null">
+			 and t_rpt_advertiser.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and t_rpt_advertiser.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and t_rpt_advertiser.adgroup_id=#{adGroupId}
+			</if>
+		 
+	    <if test="startDate!=null and endDate!=null"> 
+            and date &gt;= #{startDate} and #{endDate} &gt;=date
+	    </if>)/(select sum(t_rpt_advertiser.click) from t_rpt_advertiser ,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template where  t_rpt_advertiser.advertiser_id=t_advertiser.id  and  t_rpt_advertiser.order_id = t_order.id  and t_rpt_advertiser.campaign_id= t_campaign.id   
+	 	    and  t_rpt_advertiser.adgroup_id=t_adgroup.id
+            and  t_rpt_advertiser.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id 
+
+			<if test="advertiserId !=null">
+			 and t_rpt_advertiser.advertiser_id=#{advertiserId}
+			</if>
+			<if test="orderId !=null">
+			 and t_rpt_advertiser.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and t_rpt_advertiser.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and t_rpt_advertiser.adgroup_id=#{adGroupId}
+			</if>
+		 
+	    <if test="startDate!=null and endDate!=null"> 
+            and date &gt;= #{startDate} and #{endDate} &gt;=date
+	    </if>) as visitRatesum,
+		100*(select sum(t_rpt_advertiser.conversion) from t_rpt_advertiser ,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template where  t_rpt_advertiser.advertiser_id=t_advertiser.id  and  t_rpt_advertiser.order_id = t_order.id  and t_rpt_advertiser.campaign_id= t_campaign.id   
+	 	    and  t_rpt_advertiser.adgroup_id=t_adgroup.id
+            and  t_rpt_advertiser.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id 
+
+			<if test="advertiserId !=null">
+			 and t_rpt_advertiser.advertiser_id=#{advertiserId}
+			</if>
+			<if test="orderId !=null">
+			 and t_rpt_advertiser.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and t_rpt_advertiser.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and t_rpt_advertiser.adgroup_id=#{adGroupId}
+			</if>
+		 
+	    <if test="startDate!=null and endDate!=null"> 
+            and date &gt;= #{startDate} and #{endDate} &gt;=date
+	    </if>)/(select sum(t_rpt_advertiser.visit) from t_rpt_advertiser ,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template where  t_rpt_advertiser.advertiser_id=t_advertiser.id  and  t_rpt_advertiser.order_id = t_order.id  and t_rpt_advertiser.campaign_id= t_campaign.id   
+	 	    and  t_rpt_advertiser.adgroup_id=t_adgroup.id
+            and  t_rpt_advertiser.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id 
+
+			<if test="advertiserId !=null">
+			 and t_rpt_advertiser.advertiser_id=#{advertiserId}
+			</if>
+			<if test="orderId !=null">
+			 and t_rpt_advertiser.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and t_rpt_advertiser.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and t_rpt_advertiser.adgroup_id=#{adGroupId}
+			</if>
+		 
+	    <if test="startDate!=null and endDate!=null"> 
+            and date &gt;= #{startDate} and #{endDate} &gt;=date
+	    </if>) as conversionRatesum
+		
+		from t_rpt_advertiser ad,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template
+           
+           
+           <where>
+	 	    ad.advertiser_id=t_advertiser.id  and  ad.order_id = t_order.id  and ad.campaign_id= t_campaign.id   
+	 	    and  ad.adgroup_id=t_adgroup.id
+            and  ad.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id
+
+			<if test="advertiserId !=null">
+			 and ad.advertiser_id=#{advertiserId}
+			</if>
+			
+			<if test="orderId !=null">
+			 and ad.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and ad.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and ad.adgroup_id=#{adGroupId}
+			</if>
+		 
+	
+	    <if test="startDate!=null and endDate!=null"> 
+            and date &gt;= #{startDate} and #{endDate} &gt;=date
+	    </if>
+	  
+		  </where> 
+		
+		  limit #{pager.offset}, #{pager.limit}
+	</select>
+	
+	
+	
+	
+	
+	<select id="findByTotalReport2" parameterType="map" resultType="com.cloudcross.ssp.back.model.DeliverAnalysis">
+		select 
+		t_advertiser.name as advertiserName,  t_order.name as orderName, t_campaign.name as campaignName, t_adgroup.name  as adGroupName, t_banner_template.name as bannerName, 
+        
+         ad.date as reportDate,   ad.hour as hour,  
+        (select sum(impression) from t_rpt_advertiser_hour) as impressionSum,ad.impression,ad.click,visit,ad.conversion, 
+        100*ad.click/ad.impression as clickRate ,100*visit/ad.click as visitRate ,100*ad.conversion/visit as conversionRate ,ecmp as eCmp,ad.consume,
+		(select sum(click) from t_rpt_advertiser_hour) as clickSum, (select sum(visit) from t_rpt_advertiser_hour) as visitSum,
+        (select sum(conversion) from t_rpt_advertiser_hour) as conversionSum, 
+		(select sum(ecmp) from t_rpt_advertiser_hour) as eCmpSum, (select sum(consume) from t_rpt_advertiser_hour) as consumeSum, 
+        100*(select sum(click) from t_rpt_advertiser_hour)/(select sum(impression) from t_rpt_advertiser_hour) as clickRatesum, 
+		100*(select sum(visit) from t_rpt_advertiser_hour)/(select sum(click) from t_rpt_advertiser_hour) as visitRatesum,
+		100*(select sum(conversion) from t_rpt_advertiser_hour)/(select sum(visit) from t_rpt_advertiser_hour) as conversionRatesum
+		
+		from t_rpt_advertiser_hour ad,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template
+           
+           
+           <where>
+	 	    ad.advertiser_id=t_advertiser.id  and  ad.order_id = t_order.id  and ad.campaign_id= t_campaign.id   
+	 	    and  ad.adgroup_id=t_adgroup.id
+            and  ad.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id
+
+			<if test="advertiserId !=null">
+			 and ad.advertiser_id=#{advertiserId}
+			</if>
+			
+			<if test="orderId !=null">
+			 and ad.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and ad.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and ad.adgroup_id=#{adGroupId}
+			</if>
+		 
+		 <if test="startDate!=null and endDate!=null"> 
+            and date &gt;= #{startDate} and #{endDate} &gt;=date
+		</if>
+		 
+		  </where> 
+		
+		  limit #{pager.offset}, #{pager.limit}
+	</select>
+	
+	
+	<select id="findByLocation" parameterType="map" resultType="com.cloudcross.ssp.back.model.DeliverAnalysis">
+		select 
+		t_advertiser.name as advertiserName,  t_order.name as orderName, t_campaign.name as campaignName, t_adgroup.name  as adGroupName,
+
+               rl.date as reportDate,
+        rl.impression,rl.click,visit,rl.conversion,location,
+        100*rl.impression/(select sum(t_rpt_adv_location.impression) from t_rpt_adv_location , t_advertiser, t_order, t_campaign, t_adgroup
+        
+           where	
+            t_rpt_adv_location.advertiser_id = t_advertiser.id  and  t_rpt_adv_location.order_id =  t_order.id and t_rpt_adv_location.campaign_id = t_campaign.id  and t_rpt_adv_location.adgroup_id =  t_adgroup.id
+         	   
+			<if test="advertiserId !=null">
+			 and t_rpt_adv_location.advertiser_id=#{advertiserId}
+			</if> 
+			
+			<if test="orderId !=null">
+			 and t_rpt_adv_location.order_id=#{orderId}
+			</if>
+		     
+		     <if test="campaignId !=null">
+			 and t_rpt_adv_location.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and t_rpt_adv_location.adgroup_id=#{adGroupId}
+			</if>
+		
+	  	 <if test="startDate!=null and endDate!=null"> 
+            and t_rpt_adv_location.date &gt;= #{startDate} and #{endDate} &gt;=t_rpt_adv_location.date
+		 </if>) as impressionRate,100*rl.click/rl.impression as clickRate ,
+        100*visit/rl.click as visitRate ,100*rl.conversion/visit as conversionRate,ecmp as eCmp,consume   
+        from t_rpt_adv_location rl, t_advertiser, t_order, t_campaign, t_adgroup
+        
+           <where>	
+            rl.advertiser_id = t_advertiser.id  and  rl.order_id =  t_order.id and rl.campaign_id = t_campaign.id  and rl.adgroup_id =  t_adgroup.id
+         	   
+			<if test="advertiserId !=null">
+			 and rl.advertiser_id=#{advertiserId}
+			</if> 
+			
+			<if test="orderId !=null">
+			 and rl.order_id=#{orderId}
+			</if>
+		     
+		     <if test="campaignId !=null">
+			 and rl.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and rl.adgroup_id=#{adGroupId}
+			</if>
+		
+	  	 <if test="startDate!=null and endDate!=null"> 
+            and rl.date &gt;= #{startDate} and #{endDate} &gt;=rl.date
+		      </if>
+	    
+		    </where> 
+		    
+		limit #{pager.offset}, #{pager.limit}
+	   </select>
+	
+	
+	
+	<select id="findByOs" parameterType="map" resultType="com.cloudcross.ssp.back.model.DeliverAnalysis">
+		select 
+		t_advertiser.name as advertiserName,  t_order.name as orderName, t_campaign.name as campaignName, t_adgroup.name  as adGroupName,
+
+              ros.date as reportDate,
+        ros.impression,ros.click,visit,ros.conversion,os,
+        100*ros.impression/(select sum(t_rpt_adv_os.impression) from t_rpt_adv_os, t_advertiser, t_order, t_campaign, t_adgroup        
+
+
+            where	          
+         
+           t_rpt_adv_os.advertiser_id = t_advertiser.id  and  t_rpt_adv_os.order_id =  t_order.id and t_rpt_adv_os.campaign_id = t_campaign.id  and t_rpt_adv_os.adgroup_id =  t_adgroup.id
+		     	   
+			<if test="advertiserId !=null">
+			 and t_rpt_adv_os.advertiser_id=#{advertiserId}
+			</if> 
+			
+			<if test="orderId !=null">
+			 and t_rpt_adv_os.order_id=#{orderId}
+			</if>
+		     
+		     <if test="campaignId !=null">
+			 and t_rpt_adv_os.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and t_rpt_adv_os.adgroup_id=#{adGroupId}
+			</if>
+			
+	 		<if test="startDate!=null and endDate!=null"> 
+            and t_rpt_adv_os.date &gt;= #{startDate} and #{endDate} &gt;=t_rpt_adv_os.date
+		     </if>
+	) as impressionRate,100*ros.click/ros.impression as clickRate ,
+        100*visit/ros.click as visitRate ,100*ros.conversion/visit as conversionRate,ecmp as eCmp,consume   
+        from t_rpt_adv_os ros, t_advertiser, t_order, t_campaign, t_adgroup        
+
+
+            <where>	          
+         
+           ros.advertiser_id = t_advertiser.id  and  ros.order_id =  t_order.id and ros.campaign_id = t_campaign.id  and ros.adgroup_id =  t_adgroup.id
+		     	   
+			<if test="advertiserId !=null">
+			 and ros.advertiser_id=#{advertiserId}
+			</if> 
+			
+			<if test="orderId !=null">
+			 and ros.order_id=#{orderId}
+			</if>
+		     
+		     <if test="campaignId !=null">
+			 and ros.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and ros.adgroup_id=#{adGroupId}
+			</if>
+			
+	 		<if test="startDate!=null and endDate!=null"> 
+            and ros.date &gt;= #{startDate} and #{endDate} &gt;=ros.date
+		     </if>
+	
+		   </where> 
+
+		limit #{pager.offset}, #{pager.limit}
+	</select>
+	
+	
+	
+
+	
+	 <select id="findByPlaceName" parameterType="map" resultType="com.cloudcross.ssp.back.model.DeliverAnalysis">
+		select 
+	             t_place.name as placeName,	t_advertiser.name as advertiserName,  t_order.name as orderName, 
+	             t_campaign.name as campaignName, t_adgroup.name as adGroupName,
+	             
+	              rp.date as reportDate,
+                  rp.impression,rp.click,visit,rp.conversion,
+              100*rp.impression/(select sum(t_rpt_adv_place.impression) from t_rpt_adv_place , t_advertiser, t_order, t_campaign, t_adgroup , t_place      
+
+
+             where      
+            t_rpt_adv_place.place_id = t_place.id and  t_rpt_adv_place.advertiser_id = t_advertiser.id  
+            and  t_rpt_adv_place.order_id = t_order.id and t_rpt_adv_place.campaign_id = t_campaign.id  and t_rpt_adv_place.adgroup_id =  t_adgroup.id
+	   
+			<if test="advertiserId !=null">
+			 and t_rpt_adv_place.advertiser_id=#{advertiserId}
+			</if> 
+			
+			<if test="orderId !=null">
+			 and t_rpt_adv_place.order_id=#{orderId}
+			</if>
+		     
+		     <if test="campaignId !=null">
+			 and t_rpt_adv_place.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and t_rpt_adv_place.adgroup_id=#{adGroupId}
+			</if>
+		 
+	  		 <if test="startDate!=null and endDate!=null"> 
+            and t_rpt_adv_place.date &gt;= #{startDate} and #{endDate} &gt;=t_rpt_adv_place.date
+		        </if>) as impressionRate,100*rp.click/rp.impression as clickRate ,
+              100*visit/rp.click as visitRate ,100*rp.conversion/visit as conversionRate,ecmp as eCmp,consume   
+            from t_rpt_adv_place rp, t_advertiser, t_order, t_campaign, t_adgroup , t_place      
+
+
+              <where>      
+            rp.place_id = t_place.id and  rp.advertiser_id = t_advertiser.id  
+            and  rp.order_id = t_order.id and rp.campaign_id = t_campaign.id  and rp.adgroup_id =  t_adgroup.id
+	   
+			<if test="advertiserId !=null">
+			 and rp.advertiser_id=#{advertiserId}
+			</if> 
+			
+			<if test="orderId !=null">
+			 and rp.order_id=#{orderId}
+			</if>
+		     
+		     <if test="campaignId !=null">
+			 and rp.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and rp.adgroup_id=#{adGroupId}
+			</if>
+		 
+	  		 <if test="startDate!=null and endDate!=null"> 
+            and rp.date &gt;= #{startDate} and #{endDate} &gt;=rp.date
+		        </if>
+		     
+		  </where> 
+		limit #{pager.offset}, #{pager.limit}
+	</select>
+	
+
+	
+	<!--<select id="findByOrderName" parameterType="map" resultType="DeliverAnalysis">
+		select 
+		t_order.name as orderName,impression,click,visit,conversion,click/impression as clickRate ,visit/click as visitRate ,conversion/visit as conversionRate,eCmp,income
+		from t_rpt_daily
+		left join t_order
+		ON t_rpt_daily.order_id=t_order.id
+		order by order_id desc
+		limit #{pager.offset}, #{pager.limit}
+	</select>
+	
+	<select id="findByCampaignName" parameterType="map" resultType="DeliverAnalysis">
+		select 
+		t_campaign.name as campaignName,impression,click,visit,conversion,click/impression as clickRate ,visit/click as visitRate ,conversion/visit as conversionRate ,eCmp,income
+		from t_rpt_daily
+		left join t_campaign
+		ON t_rpt_daily.campaign_id=t_campaign.id
+		order by campaign_id desc
+		limit #{pager.offset}, #{pager.limit}
+	</select>
+	
+	<select id="findByAdGroupName" parameterType="map" resultType="DeliverAnalysis">
+		select 
+		t_adgroup.name as adGroupName,impression,click,visit,conversion,click/impression as clickRate ,visit/click as visitRate ,conversion/visit as conversionRate ,eCmp,income
+		from t_rpt_daily
+		left join t_adgroup
+		ON t_rpt_daily.adgroup_id=t_adgroup.id
+		order by adgroup_id desc
+		limit #{pager.offset}, #{pager.limit}
+	</select>
+	
+	<select id="findByBannerName" parameterType="map" resultType="DeliverAnalysis">
+		select 
+		t_banner.name as bannerName,impression,click,visit,conversion,click/impression as clickRate ,visit/click as visitRate ,conversion/visit as conversionRate ,eCmp,income
+		from t_rpt_daily
+		left join t_banner
+		ON t_rpt_daily.banner_id=t_banner.id
+		order by banner_id desc
+		limit #{pager.offset}, #{pager.limit}
+	</select>  -->
+	
+	
+	
+	
+	<select id="findByAdvertiser" parameterType="map" resultType="map">
+		select ad.name as advertiserName,date as reportDate,sum(a.consume) as totalConsume,sum(a.impression) as totalImpression,
+sum(click) as totalClick, if(sum(a.impression) > 0,sum(a.click)/sum(a.impression),0)
+		as clickRate from t_rpt_advertiser as a left join t_advertiser ad on a.advertiser_id=ad.id
+		where a.advertiser_id=#{advertiserId}
+		and a.date >= #{startDate} and a.date &lt;=#{endDate}
+		group by date(a.date)
+	</select>
+	
+	<select id="findByAdvertiser3" parameterType="map" resultType="map">
+		select ad.name as advertiserName,date as reportDate,sum(a.consume) as totalConsume,sum(a.impression) as totalImpression,
+sum(click) as totalClick, if(sum(a.impression) > 0,sum(a.click)/sum(a.impression),0)
+		as clickRate from t_rpt_advertiser as a left join t_advertiser ad on a.advertiser_id=ad.id
+		where a.advertiser_id=#{advertiserId}
+		and a.date >= #{startDate} and a.date &lt;=#{endDate}
+		group by date(a.date)
+		limit #{pager.offset}, #{pager.limit} 
+	</select>
+	
+	
+	<select id="findByAdvertiser1" parameterType="map" resultType="map">
+		select ad.name as advertiserName,date as reportDate, a.hour as hour,sum(a.consume) as totalConsume,sum(a.impression) as totalImpression,
+sum(click) as totalClick, if(sum(a.impression) > 0,sum(a.click)/sum(a.impression),0)
+		as clickRate from t_rpt_advertiser_hour as a left join t_advertiser ad on a.advertiser_id=ad.id
+		where a.advertiser_id=#{advertiserId} and a.date = #{startDate}
+		group by a.hour
+	</select>
+	
+	
+	<select id="findByAdvertiser2" parameterType="map" resultType="map">
+		select ad.name as advertiserName,date as reportDate, a.hour as hour,sum(a.consume) as totalConsume,sum(a.impression) as totalImpression,
+sum(click) as totalClick, if(sum(a.impression) > 0,sum(a.click)/sum(a.impression),0)
+		as clickRate from t_rpt_advertiser_hour as a left join t_advertiser ad on a.advertiser_id=ad.id
+		where a.advertiser_id=#{advertiserId} and a.date = #{startDate}
+		group by a.hour
+		limit #{pager.offset}, #{pager.limit} 
+	</select>
+	
+	<select id="findCountForChart" parameterType="map" resultType="int">
+	select count(date) from((select distinct date from t_rpt_advertiser where advertiser_id=#{advertiserId}
+		and date >= #{startDate} and date &lt;=#{endDate}) as a)
+	</select>
+	
+	<select id="findCountForChart1" parameterType="map" resultType="int">
+		select count(hour) from ((select distinct hour from t_rpt_advertiser_hour where advertiser_id=#{advertiserId} and date = #{startDate}) as a) 
+	</select>
+	
+	<select id="findTotalImpressionAndClickByAdvertiserId" parameterType="map" resultType="map">
+		select sum(impression) as totalImpression, sum(click) as totalClick
+		from t_rpt_advertiser 
+		where advertiser_id = #{advertiserId} and date = #{date}
+	</select>
+	
+	
+	<select id="findTotalImpressionAndClickByAgentId" parameterType="map" resultType="map">
+		select sum(a.impression) as totalImpression, sum(a.click) as totalClick
+		from t_rpt_advertiser  a,t_advertiser b
+		where b.id = a.advertiser_id and b.agent_id = #{agentId}
+		and a.date = #{date}
+	
+	</select>
+	
+	<!-- 导出excel -->
+	<select id="findByTotalForExcel" parameterType="map" resultType="com.cloudcross.ssp.back.model.DeliverAnalysis">
+		select 
+		t_advertiser.name as advertiserName,  t_order.name as orderName, t_campaign.name as campaignName, t_adgroup.name  as adGroupName, t_banner_template.name as bannerName, 
+        
+         ad.date as reportDate,     
+        (select sum(t_rpt_advertiser.impression) from  t_rpt_advertiser ,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template where  t_rpt_advertiser.advertiser_id=t_advertiser.id  and  t_rpt_advertiser.order_id = t_order.id  and t_rpt_advertiser.campaign_id= t_campaign.id   
+	 	    and  t_rpt_advertiser.adgroup_id=t_adgroup.id
+            and  t_rpt_advertiser.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id 
+
+			<if test="advertiserId !=null">
+			 and t_rpt_advertiser.advertiser_id=#{advertiserId}
+			</if>
+			<if test="orderId !=null">
+			 and t_rpt_advertiser.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and t_rpt_advertiser.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and t_rpt_advertiser.adgroup_id=#{adGroupId}
+			</if>
+		 
+	    <if test="startDate!=null and endDate!=null"> 
+            and date &gt;= #{startDate} and #{endDate} &gt;=date
+	    </if>) as impressionSum,ad.impression,ad.click,visit,ad.conversion, 
+        100*ad.click/ad.impression as clickRate ,100*visit/ad.click as visitRate ,100*ad.conversion/visit as conversionRate ,ecmp as eCmp,ad.consume,
+		(select sum(t_rpt_advertiser.click) from t_rpt_advertiser ,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template where  t_rpt_advertiser.advertiser_id=t_advertiser.id  and  t_rpt_advertiser.order_id = t_order.id  and t_rpt_advertiser.campaign_id= t_campaign.id   
+	 	    and  t_rpt_advertiser.adgroup_id=t_adgroup.id
+            and  t_rpt_advertiser.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id 
+
+			<if test="advertiserId !=null">
+			 and t_rpt_advertiser.advertiser_id=#{advertiserId}
+			</if>
+			<if test="orderId !=null">
+			 and t_rpt_advertiser.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and t_rpt_advertiser.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and t_rpt_advertiser.adgroup_id=#{adGroupId}
+			</if>
+		 
+	    <if test="startDate!=null and endDate!=null"> 
+            and date &gt;= #{startDate} and #{endDate} &gt;=date
+	    </if>) as clickSum, (select sum(t_rpt_advertiser.visit) from t_rpt_advertiser ,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template where  t_rpt_advertiser.advertiser_id=t_advertiser.id  and  t_rpt_advertiser.order_id = t_order.id  and t_rpt_advertiser.campaign_id= t_campaign.id   
+	 	    and  t_rpt_advertiser.adgroup_id=t_adgroup.id
+            and  t_rpt_advertiser.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id 
+
+			<if test="advertiserId !=null">
+			 and t_rpt_advertiser.advertiser_id=#{advertiserId}
+			</if>
+			<if test="orderId !=null">
+			 and t_rpt_advertiser.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and t_rpt_advertiser.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and t_rpt_advertiser.adgroup_id=#{adGroupId}
+			</if>
+		 
+	    <if test="startDate!=null and endDate!=null"> 
+            and date &gt;= #{startDate} and #{endDate} &gt;=date
+	    </if>) as visitSum,
+        (select sum(t_rpt_advertiser.conversion) from t_rpt_advertiser ,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template where  t_rpt_advertiser.advertiser_id=t_advertiser.id  and  t_rpt_advertiser.order_id = t_order.id  and t_rpt_advertiser.campaign_id= t_campaign.id   
+	 	    and  t_rpt_advertiser.adgroup_id=t_adgroup.id
+            and  t_rpt_advertiser.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id 
+
+			<if test="advertiserId !=null">
+			 and t_rpt_advertiser.advertiser_id=#{advertiserId}
+			</if>
+			<if test="orderId !=null">
+			 and t_rpt_advertiser.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and t_rpt_advertiser.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and t_rpt_advertiser.adgroup_id=#{adGroupId}
+			</if>
+		 
+	    <if test="startDate!=null and endDate!=null"> 
+            and date &gt;= #{startDate} and #{endDate} &gt;=date
+	    </if>) as conversionSum, 
+		(select sum(t_rpt_advertiser.ecmp) from t_rpt_advertiser ,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template where  t_rpt_advertiser.advertiser_id=t_advertiser.id  and  t_rpt_advertiser.order_id = t_order.id  and t_rpt_advertiser.campaign_id= t_campaign.id   
+	 	    and  t_rpt_advertiser.adgroup_id=t_adgroup.id
+            and  t_rpt_advertiser.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id 
+
+			<if test="advertiserId !=null">
+			 and t_rpt_advertiser.advertiser_id=#{advertiserId}
+			</if>
+			<if test="orderId !=null">
+			 and t_rpt_advertiser.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and t_rpt_advertiser.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and t_rpt_advertiser.adgroup_id=#{adGroupId}
+			</if>
+		 
+	    <if test="startDate!=null and endDate!=null"> 
+            and date &gt;= #{startDate} and #{endDate} &gt;=date
+	    </if>) as eCmpSum, (select sum(t_rpt_advertiser.consume) from t_rpt_advertiser ,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template where  t_rpt_advertiser.advertiser_id=t_advertiser.id  and  t_rpt_advertiser.order_id = t_order.id  and t_rpt_advertiser.campaign_id= t_campaign.id   
+	 	    and  t_rpt_advertiser.adgroup_id=t_adgroup.id
+            and  t_rpt_advertiser.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id 
+
+			<if test="advertiserId !=null">
+			 and t_rpt_advertiser.advertiser_id=#{advertiserId}
+			</if>
+			<if test="orderId !=null">
+			 and t_rpt_advertiser.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and t_rpt_advertiser.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and t_rpt_advertiser.adgroup_id=#{adGroupId}
+			</if>
+		 
+	    <if test="startDate!=null and endDate!=null"> 
+            and date &gt;= #{startDate} and #{endDate} &gt;=date
+	    </if>) as consumeSum, 
+        100*(select sum(t_rpt_advertiser.click) from t_rpt_advertiser ,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template where  t_rpt_advertiser.advertiser_id=t_advertiser.id  and  t_rpt_advertiser.order_id = t_order.id  and t_rpt_advertiser.campaign_id= t_campaign.id   
+	 	    and  t_rpt_advertiser.adgroup_id=t_adgroup.id
+            and  t_rpt_advertiser.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id 
+
+			<if test="advertiserId !=null">
+			 and t_rpt_advertiser.advertiser_id=#{advertiserId}
+			</if>
+			<if test="orderId !=null">
+			 and t_rpt_advertiser.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and t_rpt_advertiser.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and t_rpt_advertiser.adgroup_id=#{adGroupId}
+			</if>
+		 
+	    <if test="startDate!=null and endDate!=null"> 
+            and date &gt;= #{startDate} and #{endDate} &gt;=date
+	    </if>)/(select sum(t_rpt_advertiser.impression) from t_rpt_advertiser ,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template where  t_rpt_advertiser.advertiser_id=t_advertiser.id  and  t_rpt_advertiser.order_id = t_order.id  and t_rpt_advertiser.campaign_id= t_campaign.id   
+	 	    and  t_rpt_advertiser.adgroup_id=t_adgroup.id
+            and  t_rpt_advertiser.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id 
+
+			<if test="advertiserId !=null">
+			 and t_rpt_advertiser.advertiser_id=#{advertiserId}
+			</if>
+			<if test="orderId !=null">
+			 and t_rpt_advertiser.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and t_rpt_advertiser.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and t_rpt_advertiser.adgroup_id=#{adGroupId}
+			</if>
+		 
+	    <if test="startDate!=null and endDate!=null"> 
+            and date &gt;= #{startDate} and #{endDate} &gt;=date
+	    </if>) as clickRatesum, 
+		100*(select sum(t_rpt_advertiser.visit) from t_rpt_advertiser ,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template where  t_rpt_advertiser.advertiser_id=t_advertiser.id  and  t_rpt_advertiser.order_id = t_order.id  and t_rpt_advertiser.campaign_id= t_campaign.id   
+	 	    and  t_rpt_advertiser.adgroup_id=t_adgroup.id
+            and  t_rpt_advertiser.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id 
+
+			<if test="advertiserId !=null">
+			 and t_rpt_advertiser.advertiser_id=#{advertiserId}
+			</if>
+			<if test="orderId !=null">
+			 and t_rpt_advertiser.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and t_rpt_advertiser.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and t_rpt_advertiser.adgroup_id=#{adGroupId}
+			</if>
+		 
+	    <if test="startDate!=null and endDate!=null"> 
+            and date &gt;= #{startDate} and #{endDate} &gt;=date
+	    </if>)/(select sum(t_rpt_advertiser.click) from t_rpt_advertiser ,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template where  t_rpt_advertiser.advertiser_id=t_advertiser.id  and  t_rpt_advertiser.order_id = t_order.id  and t_rpt_advertiser.campaign_id= t_campaign.id   
+	 	    and  t_rpt_advertiser.adgroup_id=t_adgroup.id
+            and  t_rpt_advertiser.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id 
+
+			<if test="advertiserId !=null">
+			 and t_rpt_advertiser.advertiser_id=#{advertiserId}
+			</if>
+			<if test="orderId !=null">
+			 and t_rpt_advertiser.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and t_rpt_advertiser.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and t_rpt_advertiser.adgroup_id=#{adGroupId}
+			</if>
+		 
+	    <if test="startDate!=null and endDate!=null"> 
+            and date &gt;= #{startDate} and #{endDate} &gt;=date
+	    </if>) as visitRatesum,
+		100*(select sum(t_rpt_advertiser.conversion) from t_rpt_advertiser ,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template where  t_rpt_advertiser.advertiser_id=t_advertiser.id  and  t_rpt_advertiser.order_id = t_order.id  and t_rpt_advertiser.campaign_id= t_campaign.id   
+	 	    and  t_rpt_advertiser.adgroup_id=t_adgroup.id
+            and  t_rpt_advertiser.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id 
+
+			<if test="advertiserId !=null">
+			 and t_rpt_advertiser.advertiser_id=#{advertiserId}
+			</if>
+			<if test="orderId !=null">
+			 and t_rpt_advertiser.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and t_rpt_advertiser.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and t_rpt_advertiser.adgroup_id=#{adGroupId}
+			</if>
+		 
+	    <if test="startDate!=null and endDate!=null"> 
+            and date &gt;= #{startDate} and #{endDate} &gt;=date
+	    </if>)/(select sum(t_rpt_advertiser.visit) from t_rpt_advertiser ,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template where  t_rpt_advertiser.advertiser_id=t_advertiser.id  and  t_rpt_advertiser.order_id = t_order.id  and t_rpt_advertiser.campaign_id= t_campaign.id   
+	 	    and  t_rpt_advertiser.adgroup_id=t_adgroup.id
+            and  t_rpt_advertiser.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id 
+
+			<if test="advertiserId !=null">
+			 and t_rpt_advertiser.advertiser_id=#{advertiserId}
+			</if>
+			<if test="orderId !=null">
+			 and t_rpt_advertiser.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and t_rpt_advertiser.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and t_rpt_advertiser.adgroup_id=#{adGroupId}
+			</if>
+		 
+	    <if test="startDate!=null and endDate!=null"> 
+            and date &gt;= #{startDate} and #{endDate} &gt;=date
+	    </if>) as conversionRatesum
+		
+		from t_rpt_advertiser ad,t_advertiser,t_order, t_campaign, t_banner, t_adgroup, t_banner_template
+           
+           
+           <where>
+	 	    ad.advertiser_id=t_advertiser.id  and  ad.order_id = t_order.id  and ad.campaign_id= t_campaign.id   
+	 	    and  ad.adgroup_id=t_adgroup.id
+            and  ad.banner_id=t_banner.id 
+            and  t_banner.banner_template_id = t_banner_template.id
+
+			<if test="advertiserId !=null">
+			 and ad.advertiser_id=#{advertiserId}
+			</if>
+			
+			<if test="orderId !=null">
+			 and ad.order_id=#{orderId}
+			</if>
+			  
+		     <if test="campaignId !=null">
+			 and ad.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and ad.adgroup_id=#{adGroupId}
+			</if>
+		 
+	
+	    <if test="startDate!=null and endDate!=null"> 
+            and date &gt;= #{startDate} and #{endDate} &gt;=date
+	    </if>
+	  
+		  </where> 
+		
+	</select>
+	
+	<select id="findByLocationForExcel" parameterType="map" resultType="com.cloudcross.ssp.back.model.DeliverAnalysis">
+		select 
+		t_advertiser.name as advertiserName,  t_order.name as orderName, t_campaign.name as campaignName, t_adgroup.name  as adGroupName,
+
+               rl.date as reportDate,
+        rl.impression,rl.click,visit,rl.conversion,location,
+        100*rl.impression/(select sum(impression) from t_rpt_adv_location) as impressionRate,100*rl.click/rl.impression as clickRate ,
+        100*visit/rl.click as visitRate ,100*rl.conversion/visit as conversionRate,ecmp as eCmp,consume   
+        from t_rpt_adv_location rl, t_advertiser, t_order, t_campaign, t_adgroup
+        
+           <where>	
+            rl.advertiser_id = t_advertiser.id  and  rl.order_id =  t_order.id and rl.campaign_id = t_campaign.id  and rl.adgroup_id =  t_adgroup.id
+         	   
+			<if test="advertiserId !=null">
+			 and rl.advertiser_id=#{advertiserId}
+			</if> 
+			
+			<if test="orderId !=null">
+			 and rl.order_id=#{orderId}
+			</if>
+		     
+		     <if test="campaignId !=null">
+			 and rl.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and rl.adgroup_id=#{adGroupId}
+			</if>
+		
+	  	 <if test="startDate!=null and endDate!=null"> 
+            and rl.date &gt;= #{startDate} and #{endDate} &gt;=rl.date
+		      </if>
+	    
+		    </where> 
+		    
+	   </select>
+	
+	
+	
+	<select id="findByOsForExcel" parameterType="map" resultType="com.cloudcross.ssp.back.model.DeliverAnalysis">
+		select 
+		t_advertiser.name as advertiserName,  t_order.name as orderName, t_campaign.name as campaignName, t_adgroup.name  as adGroupName,
+
+              ros.date as reportDate,
+        ros.impression,ros.click,visit,ros.conversion,os,
+        100*ros.impression/(select sum(impression) from t_rpt_adv_os) as impressionRate,100*ros.click/ros.impression as clickRate ,
+        100*visit/ros.click as visitRate ,100*ros.conversion/visit as conversionRate,ecmp as eCmp,consume   
+        from t_rpt_adv_os ros, t_advertiser, t_order, t_campaign, t_adgroup        
+
+
+            <where>	          
+         
+           ros.advertiser_id = t_advertiser.id  and  ros.order_id =  t_order.id and ros.campaign_id = t_campaign.id  and ros.adgroup_id =  t_adgroup.id
+		     	   
+			<if test="advertiserId !=null">
+			 and ros.advertiser_id=#{advertiserId}
+			</if> 
+			
+			<if test="orderId !=null">
+			 and ros.order_id=#{orderId}
+			</if>
+		     
+		     <if test="campaignId !=null">
+			 and ros.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and ros.adgroup_id=#{adGroupId}
+			</if>
+			
+	 		<if test="startDate!=null and endDate!=null"> 
+            and ros.date &gt;= #{startDate} and #{endDate} &gt;=ros.date
+		     </if>
+	
+		   </where> 
+
+	</select>
+	
+	 <select id="findByPlaceNameForExcel" parameterType="map" resultType="com.cloudcross.ssp.back.model.DeliverAnalysis">
+		select 
+	             t_place.name as placeName,	t_advertiser.name as advertiserName,  t_order.name as orderName, 
+	             t_campaign.name as campaignName, t_adgroup.name as adGroupName,
+	             
+	              rp.date as reportDate,
+                  rp.impression,rp.click,visit,rp.conversion,
+              100*rp.impression/(select sum(impression) from t_rpt_adv_place) as impressionRate,100*rp.click/rp.impression as clickRate ,
+              100*visit/rp.click as visitRate ,100*rp.conversion/visit as conversionRate,ecmp as eCmp,consume   
+            from t_rpt_adv_place rp, t_advertiser, t_order, t_campaign, t_adgroup , t_place      
+
+
+              <where>      
+            rp.place_id = t_place.id and  rp.advertiser_id = t_advertiser.id  
+            and  rp.order_id = t_order.id and rp.campaign_id = t_campaign.id  and rp.adgroup_id =  t_adgroup.id
+	   
+			<if test="advertiserId !=null">
+			 and rp.advertiser_id=#{advertiserId}
+			</if> 
+			
+			<if test="orderId !=null">
+			 and rp.order_id=#{orderId}
+			</if>
+		     
+		     <if test="campaignId !=null">
+			 and rp.campaign_id=#{campaignId}
+			</if>
+			
+			<if test="adGroupId !=null">
+			 and rp.adgroup_id=#{adGroupId}
+			</if>
+		 
+	  		 <if test="startDate!=null and endDate!=null"> 
+            and rp.date &gt;= #{startDate} and #{endDate} &gt;=rp.date
+		        </if>
+		     
+		  </where> 
+	</select>
+	
+</mapper>

+ 169 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/resources.sql.xml

@@ -0,0 +1,169 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
+    "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="back.resourcesSqlMapper">
+<!--mybatis ehcache缓存配置  -->
+<!-- 以下两个<cache>标签二选一,第一个可以输出日志,第二个不输出日志
+<cache type="org.mybatis.caches.ehcache.LoggingEhcache" /> -->
+<!-- <cache type="org.mybatis.caches.ehcache.EhcacheCache"/> -->
+
+	<!-- 以下与实体类的中字段一致 -->
+	<sql id="selectId">
+	id,
+	name,
+	parentId,
+	(select r.name from t_resources r where r.id = t_resources.parentId ) parentName,
+	resKey,
+	type,
+	resUrl,
+	level,
+	description
+	</sql>
+	
+	<select id="queryAll" resultType="com.cloudcross.ssp.back.model.Resources" parameterType="com.cloudcross.ssp.back.model.Resources">
+		select
+		<include refid="selectId" />
+		from t_resources 
+		where 1+1
+		<if test="name != null and name != ''">
+				and name like '%${name}%'
+				</if>
+		<if test="parentId != null">
+				and parentId =#{parentId}
+		</if>
+		order By level asc
+	</select>
+	<!-- -->
+	<select id="getMaxLevel" resultType="int">
+		select max(level)+1  from t_resources
+	</select>
+	<!--resultType="Resources" 每返回一条结果封装到Resources里 -->
+	<select id="query" resultType="com.cloudcross.ssp.back.model.Resources" parameterType="java.util.HashMap">
+		select
+		<include refid="selectId" />
+		from t_resources
+		<where>
+			<if test="t.name != null and t.name != ''">
+				name like '%${t.name}%'
+				</if>
+		</where>
+		order By level asc
+	</select>
+	
+	<!--查找菜单名称是否是否存在-->
+		<select id="isExist" resultType="com.cloudcross.ssp.back.model.Resources" parameterType="String">
+		select
+		<include refid="selectId" />
+		from t_resources
+		where name = #{accountName}
+	</select>
+	<!-- 新增 -->
+	<insert id="add" parameterType="com.cloudcross.ssp.back.model.Resources">
+		insert into t_resources (
+					name,
+					parentId,
+					resKey,
+					type,
+					resUrl,
+					level,
+					description
+								) 
+		values (
+				#{name},
+				#{parentId},
+				#{resKey},
+				#{type},
+				#{resUrl},
+				#{level},
+				#{description}
+				)
+	</insert>
+	
+	<!-- 删 -->
+	<delete id="delete" parameterType="String">
+		delete from t_resources
+		where id=#{id}
+	</delete>
+	
+	<select id="getById" parameterType="String" resultType="com.cloudcross.ssp.back.model.Resources">
+		SELECT 
+		<include refid="selectId" />
+		 from t_resources where id=#{id}
+	</select>
+	
+	<select id="queryByParentId" parameterType="java.util.HashMap" resultType="com.cloudcross.ssp.back.model.Resources">
+		SELECT 
+		<include refid="selectId" />
+		 from t_resources where  type =  convert(#{type},SIGNED) - 1
+	</select>
+	
+	
+	<!-- 更新 -->
+	<update id="update" parameterType="com.cloudcross.ssp.back.model.Resources">
+	    update t_resources
+	    set
+	    	name = #{name},
+	    	parentId = #{parentId},
+			resKey = #{resKey},
+			type = #{type},
+			resUrl = #{resUrl},
+			level = #{level},
+			description = #{description}
+	   where id = #{id}
+	</update>
+	
+	<!-- 更新 -->
+	<update id="updateSortOrder" parameterType="com.cloudcross.ssp.back.model.Resources">
+	    update t_resources
+	    set level = #{level}
+	   where id = #{id}
+	</update>
+	<!-- 根据部门Id获取该用户的权限-->
+	<select id="findRoleRes" parameterType="String" resultType="com.cloudcross.ssp.back.model.Resources">
+		SELECT 
+		<include refid="selectId" />
+		FROM t_resources WHERE id in(
+		SELECT resc_id FROM
+		t_res_roles WHERE role_id = #{roleId})
+		order By level asc
+	</select>
+	
+    
+  	<select id="findResourcesByAccount" parameterType="int" resultType="com.cloudcross.ssp.back.model.Resources">
+		select
+		<include refid="selectId" /> 
+ 		from t_resources where t_resources.id in 
+    	(select res_id from t_res_accounts where t_res_accounts.account_id = #{id})
+		order By level asc
+	</select>
+	
+	<delete id="deleteAccountResources" parameterType="long">
+		delete from t_res_accounts
+		where account_id=#{accountId}
+	</delete>
+	
+	<!-- 根据账号Id获取该用户的权限-->
+	<select id="findAccountResourcess" parameterType="String" resultType="com.cloudcross.ssp.back.model.Resources">
+		SELECT 
+		<include refid="selectId" />
+		FROM t_resources WHERE id in(
+		SELECT resc_id FROM
+		t_res_roles WHERE role_id in(
+		SELECT role_id FROM t_acc_role
+		WHERE acc_id=#{id}))
+		order By level asc
+	</select>
+	<!-- 删 -->
+	<delete id="deleteResourcesRole" parameterType="String">
+		delete from t_res_roles
+		where role_id=#{id}
+	</delete>
+	
+	<insert id="addRoleRes" parameterType="ResourcesRole">
+	insert into t_res_roles (role_id,resc_id) value (#{roleId},#{resId})
+	</insert>
+	
+	<insert id="addAccountResourcess" parameterType="AccountResources">
+	insert into t_res_accounts (account_id,res_id) value (#{accountId},#{resourceId})
+	</insert>
+</mapper>

+ 92 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/roles.sql.xml

@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
+    "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="back.rolesSqlMapper">
+
+<!--mybatis ehcache缓存配置  -->
+<!-- 以下两个<cache>标签二选一,第一个可以输出日志,第二个不输出日志 
+<cache type="org.mybatis.caches.ehcache.LoggingEhcache" />-->
+<!-- <cache type="org.mybatis.caches.ehcache.EhcacheCache"/> -->
+	<!-- 以下与实体类的中字段一致 -->
+	<sql id="selectId">
+		id,
+		enable,
+		name,
+		roleKey,
+		description
+	</sql>
+	
+	<!--resultType="Roles" 每返回一条结果封装到Account里 -->
+	<select id="query" resultType="com.cloudcross.ssp.back.model.Roles" parameterType="java.util.HashMap">
+		select
+		<include refid="selectId" />
+		from t_ly_role
+		<where>
+			<if test="t.name != null and t.name != ''">
+				name like '%${t.name}%'
+			</if>
+		</where>
+	</select>
+	<select id="queryAll" resultType="com.cloudcross.ssp.back.model.Roles" parameterType="com.cloudcross.ssp.back.model.Roles">
+		select
+		<include refid="selectId" />
+		from t_ly_role
+		<where>
+			<if test="name != null and name != ''">
+				name like '%${name}%'
+			</if>
+		</where>
+	</select>
+	<select id="isExist" resultType="Roles" parameterType="String">
+		select
+		<include refid="selectId" />
+		from t_ly_role
+		where name = #{name}
+	</select>
+	
+	<insert id="add" parameterType="com.cloudcross.ssp.back.model.Roles">
+		insert into t_ly_role ( enable,name,roleKey,description)
+		values (#{enable},
+		#{name}, #{roleKey},
+		#{description})
+	</insert>
+	<delete id="delete" parameterType="String">
+		delete from t_ly_role where
+		id=#{id}
+	</delete>
+	<select id="getById" parameterType="String" resultType="com.cloudcross.ssp.back.model.Roles">
+		select
+		<include refid="selectId" />
+		from t_ly_role where id=#{id}
+	</select>
+	<update id="update" parameterType="com.cloudcross.ssp.back.model.Roles">
+		update t_ly_role
+		<set>
+			<if test="name != null and name != ''">
+				name=#{name},
+			</if>
+			<if test="enable != null and enable != ''">
+				enable=#{enable},
+			</if>
+			<if test="description != null and description != ''">
+				description=#{description},
+			</if>
+			<if test="roleKey != null and roleKey != ''">
+				roleKey=#{roleKey}
+			</if>
+		</set>
+		where id=#{id}
+	</update>
+	<select id="findbyAccountRole" parameterType="String" resultType="com.cloudcross.ssp.back.model.Roles">
+  select 
+  <include refid="selectId" /> 
+  from t_ly_role where id in (SELECT role_id FROM t_acc_role WHERE acc_id=#{accountId}) 
+  </select>
+  <delete id="deleteAccountRole" parameterType="String">
+		delete from t_acc_role
+		where acc_id=#{accountId}
+	</delete>
+  <insert id="addAccRole" parameterType="RoleAccount">
+	insert into t_acc_role (acc_id,role_id) value (#{accountId},#{roleId})
+	</insert>
+</mapper>

+ 19 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/rpt-zone-hour.sql.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.rptZoneHourSqlMapper">
+	
+	<select id="findEveryHourData" parameterType="map" resultType="com.cloudcross.ssp.back.model.RptZoneHour">
+		select hour,sum(pv) as pv,sum(uv) as uv, sum(impression) as impression, 
+		sum(uimpression) as uImpression,sum(uclick) as uClick,
+		sum(click) as click, sum(income) as income
+		from t_rpt_zone_hour where date = #{startDate}
+		<if test="zoneId!=null">
+        	and zone_id = #{zoneId}
+        </if>      
+        <if test="operatorId!=null">
+        	and operator_id = #{operatorId}
+        </if>
+		group by hour
+	</select>
+
+</mapper>

+ 10 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/rpt-zone.sql.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.rptZoneSqlMapper">
+
+	<select id="findByDate" parameterType="map" resultType="com.cloudcross.ssp.back.model.RptZone">
+		select operator_id as operatorId, date, sum(pv) as pv, sum(uv) as uv,
+        sum(impression) as impression, sum(click) as click,sum(income) as income from t_rpt_zone
+        where date=#{date}
+	</select>
+</mapper>

+ 48 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/systemreport.sql.xml

@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.systemReportSqlMapper">
+	
+	<sql id="base_column">
+	   id,
+	   operator_id as operatatorId,
+	   date,
+	   os,
+	   pv,
+	   uv,
+	   impression,
+	   click,
+	   ecpm,
+	   income
+	</sql>
+	
+	<select id="findByParams"  parameterType="map" resultType="com.cloudcross.ssp.back.model.SystemReport">
+	    select 
+	    a.id,os,100*(sum(impression)/(select sum(impression) from t_rpt_zone_os a, t_operator b
+		where a.operator_id=b.id 
+		<if test="operatorId!=null">
+		    and a.operator_id=#{operatorId}
+		</if> 
+		   )) as pageviewsPercent,
+		sum(pv) as pv,sum(uv) as uv,sum(impression) as impression,100*(sum(impression)/sum(pv)) as fillRate,
+        sum(click) as click,100*(sum(click)/sum(impression)) as clickRate,sum(ecpm) as ecpm,sum(income) as income
+		from t_rpt_zone_os a, t_operator b
+		where a.operator_id=b.id 
+		<if test="operatorId!=null">
+		    and a.operator_id=#{operatorId}
+		</if>
+		group by os
+		order by id asc 
+		limit #{pager.offset}, #{pager.limit}    
+	</select>
+	
+	<select id="countByParams" parameterType="map" resultType="int">
+	    select count(a.id)
+	    from t_rpt_zone_os a, t_operator b
+		where a.operator_id=b.id 
+		<if test="operatorId!=null">
+		    and a.operator_id=#{operatorId}
+		</if>
+	</select>
+	
+
+</mapper>

+ 48 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/typereport.sql.xml

@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.typereportSqlMapper">
+	
+	<sql id="base_column">
+	   id,
+	   operator_id as operatatorId,
+	   date,
+	   device,
+	   pv,
+	   uv,
+	   impression,
+	   click,
+	   ecpm,
+	   income
+	</sql>
+	
+	<select id="findByParams"  parameterType="map" resultType="com.cloudcross.ssp.back.model.TypeReport">
+	    select 
+	    a.id,device,100*(sum(impression)/(select sum(impression) from t_rpt_zone_device a, t_operator b
+		where a.operator_id=b.id 
+		<if test="operatorId!=null">
+		    and a.operator_id=#{operatorId}
+		</if> 
+		   )) as pageviewsPercent,
+		sum(pv) as pv,sum(uv) as uv,sum(impression) as impression,100*(sum(impression)/sum(pv)) as fillRate,
+        sum(click) as click,100*(sum(click)/sum(impression)) as clickRate,sum(ecpm) as ecpm,sum(income) as income
+		from t_rpt_zone_device a, t_operator b
+		where a.operator_id=b.id 
+		<if test="operatorId!=null">
+		    and a.operator_id=#{operatorId}
+		</if>
+		group by device
+		order by id asc 
+		limit #{pager.offset}, #{pager.limit}    
+	</select>
+	
+	<select id="countByParams" parameterType="map" resultType="int">
+	    select count(a.id)
+	    from t_rpt_zone_device a, t_operator b
+		where a.operator_id=b.id 
+		<if test="operatorId!=null">
+		    and a.operator_id=#{operatorId}
+		</if>
+	</select>
+	
+
+</mapper>

+ 25 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/user-group.sql.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.userGroupSqlMapper">
+	
+	<sql id="base_column">
+		account_id as id,
+		account_type as userGroupType,
+		account_name as userGroup,
+		active as status
+	</sql>
+	
+	<insert id="addUserGroup" parameterType="com.cloudcross.ssp.back.model.UserGroup" useGeneratedKeys="true"
+		keyProperty="id">
+		insert into rv_accounts(account_type,account_name) values(#{userGroupType},#{userGroup});
+	</insert>
+	
+	<select id="findUserGroupById" parameterType="long" resultType="com.cloudcross.ssp.back.model.UserGroup">
+	    select
+	    <include refid="base_column" />
+	    from rv_accounts
+	    <where>
+	    	account_id = #{id}
+	    </where>
+	</select>
+</mapper>

+ 123 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/user.sql.xml

@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.userSqlMapper">
+	
+	<sql id="base_column">
+		user_id as id,
+		email_address as email,
+		username,
+		password,
+		default_account_id as userGroupId,
+		contact_name as contactName,
+		contact_phone as phone,
+		active as status,
+		date_created as createDate,
+		updated as modifyDate
+	</sql>
+	
+	<select id="selectByUsername"  parameterType="string" resultType="com.cloudcross.ssp.back.model.User">
+		select 
+		<include refid="base_column" />
+		from rv_users
+		<where>
+			username = #{username}
+		</where>
+		order by user_id  desc
+	</select>
+	
+	<select id="selectById" parameterType="int" resultType="com.cloudcross.ssp.back.model.User">
+		select 
+		<include refid="base_column" />
+		from rv_users
+		<where>
+			user_id = #{id} and
+			active != -1
+		</where>
+	</select>
+	
+	<select id="selectByUserGroupType" parameterType="string" resultType="com.cloudcross.ssp.back.model.User">
+		select
+		<include refid="base_column" />
+		from rv_users
+		<where>
+			exists(select account_id from rv_accounts where account_type=#{userGroupType} and
+			account_id=default_account_id) and
+			active != -1
+		</where>
+	</select>
+	
+	<select id="selectByParams"  parameterType="map" resultType="com.cloudcross.ssp.back.model.User">
+		select 
+		<include refid="base_column" />
+		from rv_users where active != -1
+		<if test="key!=null and value!=null">
+			<choose>
+				<when test="key=='username'">
+					and username like #{value}
+				</when>
+				<when test="key=='contactName'">
+					and contact_name like #{value}
+				</when>
+			</choose>	
+		</if>
+		<if test="userGroupType!=null">
+			and exists(
+				select account_id from rv_accounts 
+					where account_id=default_account_id and 
+					account_type=#{userGroupType})
+		</if>
+		order by  user_id   desc
+		limit #{pager.offset}, #{pager.limit}
+	</select>
+	
+	<select id="countByParams" parameterType="map" resultType="int">
+		select count(user_id)
+		from rv_users where active != -1
+		<if test="key!=null and value!=null">
+			<choose>
+				<when test="key=='username'">
+					and username like #{value}
+				</when>
+				<when test="key=='contactName'">
+					and contact_name like #{value}
+				</when>
+			</choose>	
+		</if>
+		<if test="userGroupType!=null">
+			and exists(
+				select account_id from rv_accounts 
+					where account_id=default_account_id and 
+					account_type=#{userGroupType})
+		</if>
+	</select>
+	
+	<insert id="addUser" parameterType="com.cloudcross.ssp.back.model.User">
+		insert into rv_users(username,password,contact_name,contact_phone,active,default_account_id,updated,date_created)
+		values(#{username},#{password},#{contactName},#{phone},#{status},#{userGroupId}, #{createDate},#{createDate})
+	</insert>
+	
+	<update id="editUser" parameterType="com.cloudcross.ssp.back.model.User">
+		update rv_users 
+		set username=#{username},
+		<if test="password !=null ">
+			password=#{password},
+		</if>
+			contact_name=IFNULL(#{contactName},default(contact_name)),
+			contact_phone=IFNULL(#{phone},default(contact_phone)),
+		  <if test="status !=null">
+			active=#{status},
+			</if>
+			updated=#{modifyDate} 
+		where user_id=#{id}
+	</update>
+	
+	<update id="updateUserStatus" parameterType="HashMap">
+		update rv_users 
+			set active = #{status},updated = #{modifyDate}
+			where user_id in
+			<foreach item="userId" collection="userIdList"
+		      open="(" separator="," close=")">
+		        #{userId}
+			</foreach>
+	</update>
+</mapper>

+ 46 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/userLogin.sql.xml

@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
+    "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="back.userLoginSqlMapper">
+
+<!--mybatis ehcache缓存配置  -->
+<!-- 以下两个<cache>标签二选一,第一个可以输出日志,第二个不输出日志 
+<cache type="org.mybatis.caches.ehcache.LoggingEhcache" />-->
+<!-- <cache type="org.mybatis.caches.ehcache.EhcacheCache"/> -->
+	<!-- 以下与实体类的中字段一致 -->
+	<sql id="selectId">
+		loginId,
+		userId,
+		userName,
+		loginTime,
+		loginIP
+	</sql>
+	
+	<!--resultType="Account" 每返回一条结果封装到Account里 -->
+	<select id="query" resultType="com.cloudcross.ssp.back.model.UserLogin" parameterType="java.util.HashMap">
+		select
+		<include refid="selectId" />
+		from t_userloginlist where 1=1
+		
+	</select>
+	
+	<select id="getById" resultType="com.cloudcross.ssp.back.model.UserLogin" parameterType="String">
+		select
+		loginId,
+		userId,
+		userName,
+		max(loginTime) as loginTime,
+		loginIP
+		from t_userloginlist where 1=1
+		and t_userloginlist.userId = #{id}
+	</select>
+	<!-- 增加用户 -->
+	<insert id="add" parameterType="com.cloudcross.ssp.back.model.UserLogin">
+		insert into t_userloginlist ( userId,userName,
+		loginIP)
+		values (#{userId},#{userName},
+		#{loginIP})
+	</insert>
+
+	
+</mapper>

+ 33 - 0
src/main/java/com/cloudcross/ssp/back/model/mapper/zone.sql.xml

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="back.zoneSqlMapper">
+	<sql id="base_column">
+		t_zone.id as id,
+		operator_id as operatorId,
+		t_zone.name as name,
+		width,
+		height,
+		device,
+		position,
+		default_path as defaultPath,
+		default_url as defaultUrl,
+		status,
+		updated,
+		supdated,
+		recheck as reCheck
+		
+	</sql>	
+ <select id="selectById"  parameterType="long" resultType="com.cloudcross.ssp.back.model.Zone">
+		select <include refid="base_column" />
+		from t_zone 
+		<where>
+			t_zone.id = #{id}
+		</where>
+		order by t_zone.id  desc
+	</select> 	
+	
+	<select id="findByOperatorId" resultType="com.cloudcross.ssp.back.model.Zone" parameterType="long">
+           select <include refid="base_column" /> from t_zone where operator_id = #{operatorId}
+      </select>
+	
+</mapper>

+ 36 - 0
src/main/java/com/cloudcross/ssp/back/service/IAccountService.java

@@ -0,0 +1,36 @@
+package com.cloudcross.ssp.back.service;
+
+
+
+import java.util.HashMap;
+import java.util.List;
+
+import com.cloudcross.ssp.back.model.Account;
+import com.cloudcross.ssp.base.service.BaseService;
+import com.cloudcross.ssp.pulgin.mybatis.plugin.PageView;
+
+
+
+public interface IAccountService extends BaseService<Account>{
+	public Account querySingleAccount(String accountName);
+	public Account isExist(String accountName);
+	/**
+	 * 验证用户登陆
+	 * @author lanyuan
+	 * Email:mmm333zzz520@163.com
+	 * date:2014-2-25
+	 * @param Account account
+	 * @return
+	 */
+	public boolean addAccount(Account account);
+	public Account countAccount(Account account);
+	/**
+	 * @param account
+	 * @param pageView
+	 * @return
+	 */
+	public PageView queryNoMatch(Account account,PageView pageView);
+	public boolean updateState(List<Long> idList, int status);
+	public boolean editAccount(Account t);
+	public List<Account> findExcelAccounts(HashMap<String, Object> paramMap);
+}

+ 13 - 0
src/main/java/com/cloudcross/ssp/back/service/IAclsService.java

@@ -0,0 +1,13 @@
+package com.cloudcross.ssp.back.service;
+
+import java.util.List;
+
+import com.cloudcross.ssp.back.model.Acls;
+import com.cloudcross.ssp.base.service.IGenericService;
+
+
+public interface IAclsService extends IGenericService<Acls> {
+	boolean deleteByBannerId(Long id);
+	
+ 	boolean deleteBatch (List<Long> lists,String type);
+}

+ 15 - 0
src/main/java/com/cloudcross/ssp/back/service/IAdGroupPlaceService.java

@@ -0,0 +1,15 @@
+package com.cloudcross.ssp.back.service;
+
+import java.util.List;
+
+import com.cloudcross.ssp.back.model.AdGroupPlace;
+import com.cloudcross.ssp.base.service.IGenericService;
+
+
+public interface IAdGroupPlaceService extends IGenericService<AdGroupPlace>{
+	public List<AdGroupPlace> findAll(Long id);
+	public boolean delete(Long adGroupId);
+	//根据投放id查找所有的场景id
+	List<AdGroupPlace> findAllByAdGroupId(Long adGroupId);
+	boolean updatedPlaceSupdated(Long adGroupId);
+}

+ 18 - 0
src/main/java/com/cloudcross/ssp/back/service/IAdGroupScheduleService.java

@@ -0,0 +1,18 @@
+package com.cloudcross.ssp.back.service;
+
+import java.util.List;
+
+import com.cloudcross.ssp.back.model.AdGroupSchedule;
+import com.cloudcross.ssp.base.service.IGenericService;
+
+
+
+/**
+ * 投放的排期表服务接口定义
+ * @author chenyou
+ *
+ */
+public interface IAdGroupScheduleService extends IGenericService<AdGroupSchedule> {
+	boolean batchAdd(List<AdGroupSchedule> scheduleList);
+	boolean deleteByAdGroupId(Long adGroupId);
+}

+ 40 - 0
src/main/java/com/cloudcross/ssp/back/service/IAdGroupService.java

@@ -0,0 +1,40 @@
+package com.cloudcross.ssp.back.service;
+
+
+import java.util.List;
+import java.util.Map;
+import com.cloudcross.ssp.back.model.AdGroup;
+import com.cloudcross.ssp.base.service.IGenericService;
+
+
+
+
+/**
+ * 投放服务接口定义
+ * @author chenyou
+ *
+ */
+public interface IAdGroupService extends IGenericService<AdGroup> {
+	//更具活动id得到它有几个投放
+	List<AdGroup> findByCampaignId(Long campaignId);
+	
+	/**
+	 * 新增投放信息
+	 * @param adGroup
+	 * @param targetParamsMap
+	 * @return 
+	 */
+	boolean save(AdGroup adGroup, Map<String, Object> targetParamsMap);
+	
+	/**
+	 * 编辑投放信息
+	 * @param adGroup
+	 * @param targetParamsMap
+	 * @return
+	 */
+	boolean edit(AdGroup adGroup,Map<String, Object> targetParamsMap);
+	public void front2dbplace(String str,AdGroup adGroup);
+	boolean updatedAdgroupSupdated(Long id);
+	public Map findAreas(Long adGroupId);
+	
+}

+ 72 - 0
src/main/java/com/cloudcross/ssp/back/service/IAdReportService.java

@@ -0,0 +1,72 @@
+package com.cloudcross.ssp.back.service;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.cloudcross.ssp.back.model.DeliverAnalysis;
+import com.cloudcross.ssp.base.service.IGenericService;
+import com.cloudcross.ssp.common.utils.Pager;
+
+
+/**
+ * 报表服务
+ * @author chenyou
+ *
+ */
+public interface IAdReportService extends IGenericService<DeliverAnalysis>{
+	
+    int findCountForDeliverEffectAnalysis(Map<String, Object> paramMap);
+    
+    int findCountForDeliverEffectAnalysis2(Map<String, Object> paramMap);
+	
+	int findCountForLocation(Map<String, Object> paramMap);
+	
+	int findCountForOs(Map<String, Object> paramMap);
+	
+	int findCountForScene(Map<String, Object> paramMap);
+	
+
+	
+	List<DeliverAnalysis> findByTotalReport(Map<String, Object> paramMap, Pager pager);
+	
+	
+	List<DeliverAnalysis> findByTotalReport2(Map<String, Object> paramMap, Pager pager);
+	
+	
+    List<DeliverAnalysis> findByPlaceName(Map<String, Object> paramMap, Pager pager);
+    List<DeliverAnalysis> findByLocation(Map<String, Object> paramMap, Pager pager);
+    
+    List<DeliverAnalysis> findByOs(Map<String, Object> paramMap, Pager pager);
+
+	
+	//首页顶部统计数据查询
+	Map<String,Object> findCompare(Map<String, Object> paramMap);
+	
+	//查询首页图表
+	List<HashMap<String, Object>> findChart(String startDate, String endDate, Long advertiserId);
+	
+	int findCountForChart(String startDate, String endDate, Long advertiserId);
+	
+	List<HashMap<String, Object>> findChart(String startDate, String endDate, Long advertiserId, Pager pager);
+	/**
+	 * 根据广告主id和时间查询它的总的曝光数和点击数
+	 */
+	HashMap<String, Object> findTotalImpressionAndClickByAdvertiserId(Map<String, Object> paramMap);
+	
+	/**
+	 * 根据代理商id查询该代理商下的所有广告主的曝光数和点击数的总和
+	 */
+	HashMap<String, Object> findTotalImpressionAndClickByAgentId(Map<String, Object> paramMap);
+	
+	/**
+	 * 导出excel报表
+	 */
+	List<DeliverAnalysis> findByTotalReport(Map<String, Object> paramMap);
+	
+    List<DeliverAnalysis> findByPlaceName(Map<String, Object> paramMap);
+    
+    List<DeliverAnalysis> findByLocation(Map<String, Object> paramMap);
+    
+    List<DeliverAnalysis> findByOs(Map<String, Object> paramMap);
+}

+ 9 - 0
src/main/java/com/cloudcross/ssp/back/service/IAdvAgentService.java

@@ -0,0 +1,9 @@
+package com.cloudcross.ssp.back.service;
+
+import com.cloudcross.ssp.back.model.AdvAgent;
+import com.cloudcross.ssp.base.service.IGenericService;
+
+
+public interface IAdvAgentService extends IGenericService<AdvAgent>{
+	public AdvAgent getNew(AdvAgent t);
+}

+ 35 - 0
src/main/java/com/cloudcross/ssp/back/service/IAdvBalanceService.java

@@ -0,0 +1,35 @@
+package com.cloudcross.ssp.back.service;
+import java.util.List;
+import java.util.Map;
+
+import com.cloudcross.ssp.back.model.AdvBalance;
+import com.cloudcross.ssp.base.service.IGenericService;
+
+
+/**
+ * 广告主充值服务接口
+ * @author chenyou
+ *
+ */
+public interface IAdvBalanceService extends IGenericService<AdvBalance> {
+	/**
+	 * 根据代理商id查找它的当前余额
+	 */
+	Float findBalanceByAgentId(Long agentId);
+	
+	/**
+	 * 根据代理商id更新它的当前余额
+	 * @param balance
+	 * @return
+	 */
+	boolean updateBalanceByAgentId(Long agentId, Float balance);
+	
+	/**
+	 * 删掉当前的广告主充值记录
+	 * @param id
+	 * @return
+	 */
+	boolean deleteAdvBalanceById(Long id);
+	
+	List<AdvBalance> findByParams(Map<String, Object>paramMap);
+}

+ 27 - 0
src/main/java/com/cloudcross/ssp/back/service/IAdvertiserService.java

@@ -0,0 +1,27 @@
+package com.cloudcross.ssp.back.service;
+
+import java.util.List;
+import java.util.Map;
+
+import com.cloudcross.ssp.back.model.Advertiser;
+import com.cloudcross.ssp.base.service.IGenericService;
+
+
+public interface IAdvertiserService extends IGenericService<Advertiser>{
+	
+	//用状态和搜索条件查找广告主
+	public int countByStatus(Map<String, Object> paramMap);
+	
+	public List<Advertiser> findByStatus(Map<String, Object> paramMap);
+
+	public long findByName(String name);
+	
+	double sumBalanceById(Map<String, Object> paramMap);
+	
+	public List<Advertiser> findByAgentId(Long id);
+	//向t_adgroup里面插入Supdated
+	public boolean updateSupdated(List<Long> advertiserIdList, int status);
+	
+	//导出Excel用
+	public List<Advertiser> findDeliverEffectAnalysis(Map<String, Object> paramMap);
+}

+ 25 - 0
src/main/java/com/cloudcross/ssp/back/service/IAuditBannerService.java

@@ -0,0 +1,25 @@
+package com.cloudcross.ssp.back.service;
+
+import java.util.List;
+import java.util.Map;
+
+import com.cloudcross.ssp.back.model.AuditBanner;
+import com.cloudcross.ssp.base.service.IGenericService;
+import com.cloudcross.ssp.common.utils.Pager;
+
+
+/**
+ * 投放活动对应创意表的服务接口
+ * @author wanfu
+ *
+ */
+public interface IAuditBannerService extends IGenericService<AuditBanner> {
+	//定义根据运营商id,搜索框的值,计算素材个数的方法
+	int countByOperatorIdandParams(Long operatorId,Map<String, Object> paramMap);
+	//定义根据运营商id,搜索框的值,和相应的页码 返回素材列表的方法
+	List<AuditBanner> findByOperatorIdandParams(Long operatorId,Map<String, Object> paramMap, Pager pager);
+	//审核不通过,状态备注更新
+	boolean UpcheckStatus(List<Long> auditBannerIdList, int checked,String memo);
+	
+	List<AuditBanner> findAudit(Map<String, Object> paramMap);
+}

+ 23 - 0
src/main/java/com/cloudcross/ssp/back/service/IAuditService.java

@@ -0,0 +1,23 @@
+package com.cloudcross.ssp.back.service;
+
+import java.util.List;
+import java.util.Map;
+
+import com.cloudcross.ssp.back.model.Audit;
+import com.cloudcross.ssp.base.service.IGenericService;
+
+
+public interface IAuditService extends IGenericService<Audit>{
+	
+	//用状态和搜索条件查找广告主
+	public int countByStatus(Map<String, Object> paramMap);
+	
+	public List<Audit> findByStatus(Map<String, Object> paramMap);
+
+	public long findByName(String name);
+	
+	public boolean updateCheckStatus(Map<String, Object> paramMap);
+	//导出Excel用
+	public List<Audit> findDeliverEffectAnalysis(Map<String, Object> paramMap);
+	
+}

+ 20 - 0
src/main/java/com/cloudcross/ssp/back/service/ICampaignService.java

@@ -0,0 +1,20 @@
+package com.cloudcross.ssp.back.service;
+
+import java.util.List;
+import java.util.Map;
+
+import com.cloudcross.ssp.back.model.Campaign;
+import com.cloudcross.ssp.base.service.IGenericService;
+
+
+
+public interface ICampaignService extends IGenericService<Campaign>{
+	public List<Campaign> findByOrderId(Long orderId);
+	public long findByName(String name);
+	public boolean deleteByID(long id);//通过活动id来查对应的活动
+	public List<Campaign> findByStatus(Map<String, Object> paramMap);
+	//向t_adgroup里面插入supdated
+	public boolean updateUpstatus(List<Long> idList, int status);
+	//导出Excel用
+	public List<Campaign> findDeliverEffectAnalysis(Map<String, Object> paramMap);
+}

+ 12 - 0
src/main/java/com/cloudcross/ssp/back/service/IClientAccountService.java

@@ -0,0 +1,12 @@
+package com.cloudcross.ssp.back.service;
+
+import java.util.HashMap;
+import java.util.List;
+
+import com.cloudcross.ssp.back.model.ClientAccount;
+import com.cloudcross.ssp.base.service.IGenericService;
+
+
+public interface IClientAccountService extends IGenericService<ClientAccount>{
+	 public List<ClientAccount> findExcelAccounts(HashMap<String, Object> paramMap);
+}

+ 21 - 0
src/main/java/com/cloudcross/ssp/back/service/IDimensionService.java

@@ -0,0 +1,21 @@
+package com.cloudcross.ssp.back.service;
+
+import java.util.HashMap;
+
+import com.cloudcross.ssp.back.model.Dimension;
+import com.cloudcross.ssp.base.service.IGenericService;
+
+
+
+
+/**
+ * 用户服务接口定义。
+ * 
+ * @author qaohao
+ */
+public interface IDimensionService extends IGenericService<Dimension> {
+	Dimension findByName(String name);
+	boolean deleteById(HashMap<String,Object> paraMap);
+	public boolean updateDimensionDefault(long dimensionId);
+	public HashMap<String,Object> selectDimensionIdBydefault();
+}

Some files were not shown because too many files changed in this diff