update .gitignore

This commit is contained in:
seagull 2017-11-15 17:31:56 +08:00
parent 1d87caf126
commit e8df269c7c
668 changed files with 82151 additions and 81512 deletions

View File

@ -1,33 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<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 kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<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="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v7.0">
<attributes>
<attribute name="owner.project.facets" value="jst.web"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<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 kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<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="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v7.0">
<attributes>
<attribute name="owner.project.facets" value="jst.web"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

1
.gitignore vendored
View File

@ -1 +1,2 @@
/target/
/src/main/resources/hibernate.cfg.xml

View File

@ -1,35 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>LuckyFrameWeb</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.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<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.common.modulecore.ModuleCoreNature</nature>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>LuckyFrameWeb</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.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<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.common.modulecore.ModuleCoreNature</nature>
</natures>
</projectDescription>

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="**/*.min.js|**/node_modules/*|**/bower_components/*" kind="src" path="src/main/webapp"/>
<classpathentry kind="src" path="target/m2e-wtp/web-resources"/>
<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>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="**/*.min.js|**/node_modules/*|**/bower_components/*" kind="src" path="src/main/webapp"/>
<classpathentry kind="src" path="target/m2e-wtp/web-resources"/>
<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>

View File

@ -1,9 +1,9 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/main/webapp/down.jsp=UTF-8
encoding//src/main/webapp/footer.jsp=UTF-8
encoding//src/main/webapp/head.jsp=UTF-8
encoding//src/main/webapp/index.jsp=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/main/webapp/down.jsp=UTF-8
encoding//src/main/webapp/footer.jsp=UTF-8
encoding//src/main/webapp/head.jsp=UTF-8
encoding//src/main/webapp/index.jsp=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8

View File

@ -1,13 +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.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
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.7
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.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
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.7

View File

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

View File

@ -1,2 +1,2 @@
eclipse.preferences.version=1
org.eclipse.m2e.wtp.enabledProjectSpecificPrefs=false
eclipse.preferences.version=1
org.eclipse.m2e.wtp.enabledProjectSpecificPrefs=false

View File

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

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<runtime name="Apache Tomcat v7.0"/>
<fixed facet="wst.jsdt.web"/>
<installed facet="jst.web" version="3.0"/>
<installed facet="wst.jsdt.web" version="1.0"/>
<installed facet="java" version="1.7"/>
</faceted-project>
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<runtime name="Apache Tomcat v7.0"/>
<fixed facet="wst.jsdt.web"/>
<installed facet="jst.web" version="3.0"/>
<installed facet="wst.jsdt.web" version="1.0"/>
<installed facet="java" version="1.7"/>
</faceted-project>

View File

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

146
README.md
View File

@ -1,74 +1,74 @@
<p align="center">
<a href="http://www.luckyframe.cn">
<img alt="luckyframe_Logo" src="http://git.oschina.net/seagull1985/LuckyFrameWeb/raw/master/src/main/webapp/pic/haiou-11.png">
</a>
</p>
<p align="center">
让你的自动化体系建设更简单
<a href="http://www.luckyframe.cn">
LuckyFrame官网
</a>
</p>
<p align="center">
<a href="#">
<img alt="maven" src="https://img.shields.io/maven-central/v/org.apache.maven/apache-maven.svg">
</a>
<a href="#">
<img alt="code style" src="https://img.shields.io/badge/%20LICENSE-GPL--2.0-blue.svg">
</a>
<a href="#">
<img alt="code style" src="https://img.shields.io/badge/BUILD-PASSING-green.svg">
</a>
<a href="http://git.oschina.net/seagull1985/LuckyFrameWeb/releases">
<img src="https://img.shields.io/badge/LuckyFrame-V2.3-green.svg" >
</a>
</p>
# 捐赠 | 感谢
> [【捐赠支持(微信)】](https://git.oschina.net/uploads/images/2017/0913/175706_f58b543b_1215415.jpeg) [【捐赠支持(支付宝)】](https://git.oschina.net/uploads/images/2017/0913/175750_e96add72_1215415.jpeg)
> 感谢你们的认可与支持 [【捐赠记录】](https://git.oschina.net/seagull1985/LuckyFrameWeb/wikis/pages?title=捐赠列表&parent=捐赠)
# 介绍
LuckyFrame 开源自动化测试平台 - 自动化测试 X 时代来了
> LuckyFrame QQ官方交流群 487954492
<a target="_blank" href="//shang.qq.com/wpa/qunwpa?idkey=32919cc1ee8595efa4c561920f3fdb606606ca8fdb6ff6b2430c5d97587551de"><img border="0" src="//pub.idqqimg.com/wpa/images/group.png" alt="LuckyFrame自动化测试" title="LuckyFrame自动化测试"></a>
# 我能做什么?
- **分布式测试**使用Web-Client的方式Web端负责基本信息管理展示Client负责用例执行任意无限扩展客户端。
- **多途径用例管理**您即可以使用Web端自带的用例管理模块也可以使用testlink来管理自动化用例。
- **质量管理**Web端不仅仅有用来管理自动化相关的模块更可以做一些简单的质量数据收集分析以及数据的多图表展示。
- **多线程执行用例**:客户端执行用例可以指定线程数量,用例运行更快速。
- **在线编辑用例**专属自动化用例设计结构使用bootstrap table x_edit插件更快捷、方便的编辑、调试自动化用例。
- **定时任务调度**支持自定义配置调度任务包括指定线程数指定执行客户端远程执行shell重启tomcat,对jenkins中的项目进行构建等。
- **测试过程监控**客户端运行用例采用命令行的方式在客户端可以实时查看过程。Web端可以通过任务查询查看测试进度。
- **日志定位**客户端LOG4J+数据库记录测试过程日志2种方式都可以通过Web端实时查看定位问题。
- **接口+Web UI双纬度自动化**:支持接口+Web UI自动化客户端OS必须为Windows系统UI自动化采用WebDriver3.0封装纯关键字驱动0编码。
- **HTTP+Socket接口免编码**完全封装HTTP以及Socket接口协议模板+纯关键字驱动,免编码,初级测试人员的福音,与其他类似开源工具相比优势明显
- **在线调试用例**:直接通过页面的步骤编辑界面调试用例,省心、省力、省脑子,但是不能不要脑子。
- **Bootstrap 小清新风格界面**整套Web系统基于Bootstrap风格以及多种其下的插件构建清爽界面。
- **更多...**:还有更多自动化的创意,期待你的体验发现... <a href="https://git.oschina.net/seagull1985/LuckyFrameWeb/wikis/pages?title=项目介绍&parent=项目信息">更多详细介绍</a>
# 瞅一眼吧
![首页](https://git.oschina.net/uploads/images/2017/0913/193800_d0189b51_1215415.jpeg "首页")
![用例管理](https://git.oschina.net/uploads/images/2017/0913/193821_2e58d1cc_1215415.jpeg "用例管理")
![步骤管理自动联想](https://gitee.com/uploads/images/2017/1110/150236_b5e0d674_1215415.png "步骤管理自动联想")
![测试计划管理](https://git.oschina.net/uploads/images/2017/0913/193847_c32f96ff_1215415.jpeg "测试计划管理")
![测试任务调度](https://git.oschina.net/uploads/images/2017/0913/193913_fdccc46f_1215415.png "测试任务调度")
![测试任务执行](https://git.oschina.net/uploads/images/2017/0913/193935_3b381747_1215415.png "测试任务执行")
![用例日志查询](https://git.oschina.net/uploads/images/2017/0913/194004_6414aa59_1215415.png "用例日志查询")
# 更新日志
> [【查看版本Releases日志】](https://git.oschina.net/seagull1985/LuckyFrameWeb/wikis/pages?title=更新日志&parent=项目信息)
# 大家安静下,我再说一句
此项目是LuckyFrame的Web端项目此外还有一个LuckyFrame的项目做为客户端如果您只需要先看看界面那么单独下载这个项目就够了如果您需要搭建整套环境那还要把LuckyFrame项目下载下来。
# 期待您更多的意见
<p align="center">
<a href="http://www.luckyframe.cn">
<img alt="luckyframe_Logo" src="http://git.oschina.net/seagull1985/LuckyFrameWeb/raw/master/src/main/webapp/pic/haiou-11.png">
</a>
</p>
<p align="center">
让你的自动化体系建设更简单
<a href="http://www.luckyframe.cn">
LuckyFrame官网
</a>
</p>
<p align="center">
<a href="#">
<img alt="maven" src="https://img.shields.io/maven-central/v/org.apache.maven/apache-maven.svg">
</a>
<a href="#">
<img alt="code style" src="https://img.shields.io/badge/%20LICENSE-GPL--2.0-blue.svg">
</a>
<a href="#">
<img alt="code style" src="https://img.shields.io/badge/BUILD-PASSING-green.svg">
</a>
<a href="http://git.oschina.net/seagull1985/LuckyFrameWeb/releases">
<img src="https://img.shields.io/badge/LuckyFrame-V2.3-green.svg" >
</a>
</p>
# 捐赠 | 感谢
> [【捐赠支持(微信)】](https://git.oschina.net/uploads/images/2017/0913/175706_f58b543b_1215415.jpeg) [【捐赠支持(支付宝)】](https://git.oschina.net/uploads/images/2017/0913/175750_e96add72_1215415.jpeg)
> 感谢你们的认可与支持 [【捐赠记录】](https://git.oschina.net/seagull1985/LuckyFrameWeb/wikis/pages?title=捐赠列表&parent=捐赠)
# 介绍
LuckyFrame 开源自动化测试平台 - 自动化测试 X 时代来了
> LuckyFrame QQ官方交流群 487954492
<a target="_blank" href="//shang.qq.com/wpa/qunwpa?idkey=32919cc1ee8595efa4c561920f3fdb606606ca8fdb6ff6b2430c5d97587551de"><img border="0" src="//pub.idqqimg.com/wpa/images/group.png" alt="LuckyFrame自动化测试" title="LuckyFrame自动化测试"></a>
# 我能做什么?
- **分布式测试**使用Web-Client的方式Web端负责基本信息管理展示Client负责用例执行任意无限扩展客户端。
- **多途径用例管理**您即可以使用Web端自带的用例管理模块也可以使用testlink来管理自动化用例。
- **质量管理**Web端不仅仅有用来管理自动化相关的模块更可以做一些简单的质量数据收集分析以及数据的多图表展示。
- **多线程执行用例**:客户端执行用例可以指定线程数量,用例运行更快速。
- **在线编辑用例**专属自动化用例设计结构使用bootstrap table x_edit插件更快捷、方便的编辑、调试自动化用例。
- **定时任务调度**支持自定义配置调度任务包括指定线程数指定执行客户端远程执行shell重启tomcat,对jenkins中的项目进行构建等。
- **测试过程监控**客户端运行用例采用命令行的方式在客户端可以实时查看过程。Web端可以通过任务查询查看测试进度。
- **日志定位**客户端LOG4J+数据库记录测试过程日志2种方式都可以通过Web端实时查看定位问题。
- **接口+Web UI双纬度自动化**:支持接口+Web UI自动化客户端OS必须为Windows系统UI自动化采用WebDriver3.0封装纯关键字驱动0编码。
- **HTTP+Socket接口免编码**完全封装HTTP以及Socket接口协议模板+纯关键字驱动,免编码,初级测试人员的福音,与其他类似开源工具相比优势明显
- **在线调试用例**:直接通过页面的步骤编辑界面调试用例,省心、省力、省脑子,但是不能不要脑子。
- **Bootstrap 小清新风格界面**整套Web系统基于Bootstrap风格以及多种其下的插件构建清爽界面。
- **更多...**:还有更多自动化的创意,期待你的体验发现... <a href="https://git.oschina.net/seagull1985/LuckyFrameWeb/wikis/pages?title=项目介绍&parent=项目信息">更多详细介绍</a>
# 瞅一眼吧
![首页](https://git.oschina.net/uploads/images/2017/0913/193800_d0189b51_1215415.jpeg "首页")
![用例管理](https://git.oschina.net/uploads/images/2017/0913/193821_2e58d1cc_1215415.jpeg "用例管理")
![步骤管理自动联想](https://gitee.com/uploads/images/2017/1110/150236_b5e0d674_1215415.png "步骤管理自动联想")
![测试计划管理](https://git.oschina.net/uploads/images/2017/0913/193847_c32f96ff_1215415.jpeg "测试计划管理")
![测试任务调度](https://git.oschina.net/uploads/images/2017/0913/193913_fdccc46f_1215415.png "测试任务调度")
![测试任务执行](https://git.oschina.net/uploads/images/2017/0913/193935_3b381747_1215415.png "测试任务执行")
![用例日志查询](https://git.oschina.net/uploads/images/2017/0913/194004_6414aa59_1215415.png "用例日志查询")
# 更新日志
> [【查看版本Releases日志】](https://git.oschina.net/seagull1985/LuckyFrameWeb/wikis/pages?title=更新日志&parent=项目信息)
# 大家安静下,我再说一句
此项目是LuckyFrame的Web端项目此外还有一个LuckyFrame的项目做为客户端如果您只需要先看看界面那么单独下载这个项目就够了如果您需要搭建整套环境那还要把LuckyFrame项目下载下来。
# 期待您更多的意见
> 如果你有任何的想法或是建议那就给我留个言吧

View File

@ -1,451 +1,451 @@
create table OPERATION_LOG
(
id int(9) not null AUTO_INCREMENT,
tablename VARCHAR(30) not null COMMENT '被记录日志表名',
tableid int(8) not null COMMENT '被记录日志ID',
operation_time VARCHAR(30) not null COMMENT '操作时间',
operationer VARCHAR(20) not null COMMENT '操作人员',
operation_description VARCHAR(200) not null COMMENT '描述',
projectid int(8) COMMENT '项目ID',
primary key (ID)
)default character set utf8;
create table QA_ACCIDENT
(
id int(8) not null AUTO_INCREMENT,
projectid int(8) not null COMMENT '项目ID',
accstatus VARCHAR(80) not null COMMENT '事故状态',
eventtime VARCHAR(30) COMMENT '事故发生时间',
reporter VARCHAR(20) not null COMMENT '报告人',
reporttime VARCHAR(30) not null COMMENT '事故报告时间',
accdescription VARCHAR(500) not null COMMENT '事故描述',
acclevel VARCHAR(60) not null COMMENT '事故等级',
causalanalysis VARCHAR(500) COMMENT '原因分析',
causaltype VARCHAR(100) COMMENT '原因类型',
consequenceanalysis VARCHAR(300) COMMENT '后果分析',
correctiveaction VARCHAR(300) COMMENT '纠正措施',
resolutiontime VARCHAR(30) COMMENT '解决时间',
resolutioner VARCHAR(20) COMMENT '解决处理人',
preventiveaction VARCHAR(300) COMMENT '预防措施',
preventiver VARCHAR(20) COMMENT '预防措施责任人',
preventiveplandate VARCHAR(30) COMMENT '预防措施计划完成时间',
preventiveaccdate VARCHAR(30) COMMENT '预防措施实际完成时间',
trouble_duration int(8) COMMENT '事故持续时间',
impact_time int(8),
filename VARCHAR(100) COMMENT '附件路径',
primary key (ID)
)default character set utf8;
create table QA_FLOWCHECK
(
id int(10) not null AUTO_INCREMENT,
checkid int(10) not null COMMENT '检查id',
projectid int(10) not null COMMENT '项目id',
projectphase VARCHAR(20) not null COMMENT '项目阶段',
phasenode VARCHAR(50) not null COMMENT '阶段节点',
checkentry VARCHAR(100) not null COMMENT '检查内容',
checkresult VARCHAR(20) COMMENT '检查结果',
checkdate VARCHAR(20) COMMENT '检查日期',
checkdescriptions VARCHAR(400) COMMENT '不符合项描述',
stateupdate VARCHAR(20) COMMENT '状态更新',
updatedate VARCHAR(20) COMMENT '更新日期',
remark VARCHAR(200) COMMENT '备注',
versionnum VARCHAR(30) COMMENT '版本号',
primary key (ID)
)default character set utf8;
create table QA_FLOWINFO
(
id int(10) not null AUTO_INCREMENT,
phaseid int(10) not null,
phasename VARCHAR(20) not null,
phasenodeid int(10) not null,
phasenodename VARCHAR(20) not null,
checkentryid int(10) not null,
checkentry VARCHAR(200) not null,
remark VARCHAR(100),
primary key (ID)
)default character set utf8;
create table QA_PLANFLOWCHECK
(
id int(8) not null AUTO_INCREMENT,
projectid int(8) not null COMMENT '项目ID',
versionnum VARCHAR(30) COMMENT '版本号',
checkentryid VARCHAR(20) not null COMMENT '检查ID',
plandate VARCHAR(20) not null COMMENT '计划检查日期',
status int(4) not null COMMENT '计划状态1 检查计划 2 已检查',
primary key (ID)
)default character set utf8;
create table QA_PROJECTVERSION
(
versionid int(10) not null AUTO_INCREMENT,
versionnumber VARCHAR(20) COMMENT '版本号',
plan_launchdate VARCHAR(20) COMMENT '计划上线日期',
actually_launchdate VARCHAR(20) COMMENT '实际上线日期',
plan_devstart VARCHAR(20) COMMENT '计划开发开始时间',
plan_devend VARCHAR(20) COMMENT '计划开发结束时间',
actually_devstart VARCHAR(20) COMMENT '实际开发开始时间',
actually_devend VARCHAR(20) COMMENT '实际开发结束时间',
plan_teststart VARCHAR(20) COMMENT '计划测试开始时间',
plan_testend VARCHAR(20) COMMENT '计划测试结束时间',
actually_teststart VARCHAR(20) COMMENT '实际测试开始时间',
actually_testend VARCHAR(20) COMMENT '实际测试结束时间',
plan_demand int(10) COMMENT '计划上线需求数',
actually_demand int(10) COMMENT '实际上线需求数',
codeline FLOAT(10) COMMENT '代码变动行数',
testcasenum int(10) COMMENT '测试用例数',
changetestingreturn int(10) COMMENT '版本转测试打回次数',
dev_member VARCHAR(50) COMMENT '开发投入人力',
test_member VARCHAR(50) COMMENT '测试投入人力',
human_cost VARCHAR(20) COMMENT '耗费人力 人/天',
per_dev VARCHAR(20) COMMENT '开发平均生产率 人/天/行',
per_test VARCHAR(20) COMMENT '用例编写/用例执行',
code_di VARCHAR(20) COMMENT '代码DI值',
qualityreview VARCHAR(500) COMMENT '质量回溯',
imprint VARCHAR(500) COMMENT '版本说明',
remark VARCHAR(500) COMMENT '备注',
projectid int(10) COMMENT '项目ID',
devtime_deviation VARCHAR(20) COMMENT '开发偏移率',
devdelay_days VARCHAR(20) COMMENT '开发延迟时间',
testtime_deviation VARCHAR(20) COMMENT '测试偏移率',
testdelay_days VARCHAR(20) COMMENT '测试延迟时间',
protime_deviation VARCHAR(20),
prodelay_days VARCHAR(20),
bug_zm int(10),
bug_yz int(10),
bug_yb int(10),
bug_ts int(10),
versiontype int(8) default 1 not null COMMENT '版本类型',
perdemand FLOAT(8) default 0.00,
codestandard_zd int(10) default 0 not null,
codestandard_yz int(10) default 0 not null,
codestandard_zy int(10) default 0 not null,
zt_versionlink VARCHAR(100) COMMENT '禅道链接',
human_costdev VARCHAR(20) default '0' COMMENT '开发人力成本',
human_costtest VARCHAR(20) default '0' COMMENT '测试人力成本',
primary key (versionid)
)default character set utf8;
create table QA_REVIEW
(
id int(8) not null AUTO_INCREMENT,
projectid int(8) not null COMMENT '项目ID',
version VARCHAR(20) not null COMMENT '版本号',
review_type VARCHAR(20) COMMENT '评审类型',
review_date VARCHAR(20) COMMENT '评审日期',
bug_num int(8) COMMENT '问题数',
repair_num int(8) COMMENT '已修复问题数',
confirm_date VARCHAR(20) COMMENT '最后确认日期',
review_object VARCHAR(100) COMMENT '评审对象',
review_result VARCHAR(50) COMMENT '评审结果',
result_confirmor VARCHAR(50) COMMENT '结果确认人',
remark VARCHAR(500) COMMENT '备注',
primary key (id)
)default character set utf8;
create table QA_REVIEWINFO
(
id int(8) not null AUTO_INCREMENT,
review_id int(8) not null COMMENT '评审ID',
bug_description VARCHAR(500) COMMENT '问题描述',
status VARCHAR(20) COMMENT '状态',
duty_officer VARCHAR(100) COMMENT '责任人',
confirm_date VARCHAR(20) COMMENT '最后确认日期',
corrective VARCHAR(500) COMMENT '纠正措施',
primary key (id)
)default character set utf8;
create table QA_SECONDARYSECTOR
(
sectorid int(10) not null AUTO_INCREMENT,
departmenthead VARCHAR(20),
departmentname VARCHAR(20),
primary key (sectorid)
)default character set utf8;
create table QA_SECTORPROJECTS
(
projectid int(10) not null AUTO_INCREMENT,
projectname VARCHAR(100) not null,
projectmanager VARCHAR(100) not null,
sectorid int(10) not null,
projecttype int(4) default 0 not null,
primary key (projectid)
)default character set utf8;
create table QA_ZTTASK
(
id int(8) not null AUTO_INCREMENT,
versionid int(8) COMMENT '版本ID',
versionname VARCHAR(100) COMMENT '版本名称',
taskname VARCHAR(300) COMMENT '任务名称',
assigneddate VARCHAR(50) COMMENT '完成时间',
estimate int(8) COMMENT '预期工时',
consumed int(8) COMMENT '实际工时',
finishedby VARCHAR(40) COMMENT '完成人账号',
finishedname VARCHAR(40) COMMENT '完成人姓名',
deadline VARCHAR(40) COMMENT '计划截止日期',
delaystatus int(4) COMMENT '延期状态',
primary key (id)
)default character set utf8;
create table TEST_JOBS
(
id int(10) not null AUTO_INCREMENT,
name VARCHAR(100) not null COMMENT '调度名称',
startdate VARCHAR(100) COMMENT '开始日期',
starttime VARCHAR(100) COMMENT '开始时间',
enddate VARCHAR(100) COMMENT '结束日期',
endtime VARCHAR(100) COMMENT '结束时间',
runtime datetime COMMENT '执行时间',
remark VARCHAR(800) COMMENT '备注',
planproj VARCHAR(100) COMMENT '项目名testlink',
state VARCHAR(4) not null COMMENT '状态',
tasktype VARCHAR(4) not null COMMENT '执行类型 O执行一次 D每天执行',
starttimestr VARCHAR(100) COMMENT '执行时间表达式',
endtimestr VARCHAR(100) COMMENT '结束时间',
createtime datetime not null,
noenddate VARCHAR(10) COMMENT '是否有结束日期',
time int default 0,
timetype VARCHAR(4),
issendmail VARCHAR(4) default "0" COMMENT '是否发送邮件通知',
emailer VARCHAR(250) COMMENT '邮件地址',
threadcount int default 1 COMMENT '客户端线程数(接口)',
testlinkname VARCHAR(200) COMMENT 'TESTLINK中的计划名称',
isbuilding VARCHAR(4) default '0' not null COMMENT '是否自动构建',
buildname VARCHAR(100) COMMENT '构建链接',
isrestart VARCHAR(4) default '0' not null COMMENT '是否自动重启',
restartcomm VARCHAR(200) COMMENT '重启脚本',
extype int(4) default 0 not null COMMENT '执行类型',
browsertype int(4) COMMENT 'UI自动化浏览器类型',
timeout int(8) default 60 not null COMMENT '任务超时中断时间(分钟)',
clientip VARCHAR(30) default '127.0.0.1' not null COMMENT '版本ID',
primary key (id)
)default character set utf8;
create table TEST_CASEDETAIL
(
id int(10) not null AUTO_INCREMENT,
taskid int(10) not null,
caseno VARCHAR(20) not null COMMENT '用例编号',
caseversion VARCHAR(20) not null COMMENT '用例版本',
casetime datetime not null COMMENT '执行时间',
casename VARCHAR(200) not null COMMENT '用例名称',
casestatus VARCHAR(2) default '4' not null COMMENT ' pass:0 fail:1 lock:2 unexcute:4',
primary key (id)
)default character set utf8;
create table TEST_LOGDETAIL
(
logid int(10) not null AUTO_INCREMENT,
logtime datetime not null COMMENT '日志时间',
detail VARCHAR(1000) not null COMMENT '日志',
loggrade VARCHAR(20) COMMENT '日志级别',
caseid int(10) not null COMMENT '用例编号',
taskid int(10),
step VARCHAR(20) COMMENT '用例步骤',
imgname VARCHAR(30) COMMENT 'UI自动化自动截图地址',
primary key (logid)
)default character set utf8;
create table TEST_TASKEXCUTE
(
id int(10) not null AUTO_INCREMENT,
taskid VARCHAR(150) not null,
casetotal_count int(10) COMMENT '总用例数',
casesucc_count int(10) COMMENT '成功数',
casefail_count int(10) COMMENT '失败数',
caselock_count int(10) COMMENT '锁定数',
createtime datetime COMMENT '时间',
jobid int(10) not null,
finishtime datetime COMMENT '完成时间',
taskstatus VARCHAR(2) default '' COMMENT '状态 0未执行 1执行中 2 成功 4失败 ',
casenoexec_count int default 0 COMMENT '未执行用例',
caseisexec VARCHAR(2) COMMENT '任务是否被成功吊起 0 成功吊起 3 吊起失败',
primary key (id)
)default character set utf8;
create table USERINFO
(
id int(8) not null AUTO_INCREMENT,
usercode VARCHAR(20) not null,
password VARCHAR(200) not null,
username VARCHAR(20),
role VARCHAR(100) COMMENT '角色',
sectorid int(8) default 0 not null COMMENT '所属部门',
primary key (id)
)default character set utf8;
create table USER_AUTHORITY
(
id int(9) not null AUTO_INCREMENT,
module VARCHAR(50) not null COMMENT '模块',
auth_type VARCHAR(50) not null COMMENT '权限类型',
alias VARCHAR(50) not null COMMENT '别名',
primary key (id)
)default character set utf8;
create table USER_ROLE
(
id int(9) not null AUTO_INCREMENT,
role VARCHAR(50) not null COMMENT '角色',
permission VARCHAR(1000) COMMENT '权限',
primary key (id)
)default character set utf8;
/*插入索引
CREATE INDEX index_caseid ON TEST_LOGDETAIL (caseid);
CREATE INDEX index_taskid ON TEST_CASEDETAIL (taskid);*/
/*插入权限默认定义*/
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (1, '质量-版本信息', '增加', 'pv_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (2, '质量-版本信息', '删除', 'pv_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (3, '质量-版本信息', '修改', 'pv_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (4, '质量-版本计划信息', '增加', 'pvp_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (5, '质量-流程检查信息', '增加', 'fc_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (6, '质量-流程检查信息', '删除', 'fc_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (7, '质量-流程检查信息', '修改', 'fc_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (8, '质量-生产故障信息', '增加', 'acc_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (9, '质量-生产故障信息', '删除', 'acc_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (10, '质量-生产故障信息', '修改', 'acc_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (21, '自动化-任务调度', '启动', 'tast_run');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (22, '自动化-任务调度', '移除', 'tast_remove');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (23, '自动化-任务调度', '执行', 'tast_ex');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (24, '自动化-任务调度', '增加', 'tast_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (25, '自动化-任务调度', '删除', 'tast_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (26, '自动化-任务调度', '修改', 'tast_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (27, '自动化-任务调度', '上传', 'tast_upload');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (11, '质量-流程检查计划', '增加', 'pfc_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (12, '质量-流程检查计划', '删除', 'pfc_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (13, '质量-流程检查计划', '修改', 'pfc_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (14, '质量-流程检查计划', '转计划', 'fc_tocheck');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (15, '质量-评审信息详情', '增加', 'revinfo_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (16, '质量-评审信息详情', '删除', 'revinfo_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (17, '质量-评审信息详情', '修改', 'revinfo_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (18, '质量-评审信息', '删除', 'rev_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (19, '质量-评审信息', '修改', 'rev_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (20, '质量-生产故障信息', '上传', 'acc_upload');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (41, '用户管理', '增加', 'ui_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (42, '用户管理', '删除', 'ui_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (43, '用户管理', '修改', 'ui_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (44, '用户管理', '查看', 'ui_4');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (45, '用户管理-权限角色', '查看修改', 'role_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (28, '自动化-任务列表', '删除', 'tastex_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (29, '自动化-用例列表', '执行', 'case_ex');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (46, '用户管理-权限角色', '增加', 'role_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (47, '用户管理-权限角色', '删除', 'role_2');
/*插入角色默认定义*/
insert into USER_ROLE (id, role, permission)
values (2, '测试工程师', 'acc_1,acc_2,acc_3,');
insert into USER_ROLE (id, role, permission)
values (3, '自动化工程师', 'acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,');
insert into USER_ROLE (id, role, permission)
values (4, '质量工程师', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,');
insert into USER_ROLE (id, role, permission)
values (1, '管理员', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,ui_1,ui_2,ui_3,ui_4,role_3,role_1,role_2,');
/*插入默认部门分级*/
insert into QA_SECONDARYSECTOR (sectorid, departmenthead, departmentname)
values (99, '系统管理员', '总部');
/*插入默认项目*/
insert into QA_SECTORPROJECTS (projectid, projectname, projectmanager, sectorid, projecttype)
values (99, '全部项目/未知项目', '系统管理员', 99, 0);
/*插入默认管理员*/
insert into USERINFO (id, usercode, password, username, role, sectorid)
values (1, 'admin', 'uJ45aIeS9N80kaSFDjvk%2FA%3D%3D', '系统管理员', '1', 99);
/*插入流程检查定义数据*/
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (36, 5, '总结阶段', 2, '计划变更', 1, '如与计划不合,是否提交计划变更邮件', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (37, 5, '总结阶段', 3, '代码质量', 1, 'sonar代码检查是否刷新构建', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (38, 5, '总结阶段', 3, '代码质量', 2, 'sonar代码问题数是否符合要求', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (35, 2, '开发阶段', 3, '开发与编码', 6, '是否每一条禅道开发任务都提交转测申请', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (34, 4, '验收与上线', 2, '上线部署', 3, 'SVN代码是否提交并标注', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (1, 1, '需求阶段', 1, '需求编制', 1, '《产品需求说明书》是否组织评审会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (2, 1, '需求阶段', 1, '需求编制', 2, '《产品需求说明书》评审是否通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (3, 1, '需求阶段', 1, '需求编制', 3, '《产品需求说明书》是否归档到SVN', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (4, 1, '需求阶段', 1, '需求编制', 4, '《产品需求说明书》评审记录表是否签字通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (5, 2, '开发阶段', 1, '需求分解', 1, '是否有需求分解/任务讨论会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (6, 2, '开发阶段', 1, '需求分解', 2, '《项目计划》邮件是否及时发出', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (7, 2, '开发阶段', 1, '需求分解', 3, '《项目计划》邮件内容是否完整', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (10, 2, '开发阶段', 2, '软件设计', 1, '《产品开发概要设计》是否组织评审会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (11, 2, '开发阶段', 2, '软件设计', 2, '《产品开发概要设计》评审是否通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (12, 2, '开发阶段', 2, '软件设计', 3, '《产品开发概要设计》是否归档到SVN', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (13, 2, '开发阶段', 2, '软件设计', 4, '《产品开发概要设计》评审记录表是否签字通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (14, 2, '开发阶段', 3, '开发与编码', 1, '是否进行每日晨会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (15, 2, '开发阶段', 3, '开发与编码', 2, '是否进行代码走读', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (16, 2, '开发阶段', 3, '开发与编码', 3, '是否每一条禅道开发任务都提交转测申请', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (17, 2, '开发阶段', 3, '开发与编码', 4, '转测邮件是否合格', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (18, 2, '开发阶段', 3, '开发与编码', 5, '转测邮件打回次数为0', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (19, 3, '测试阶段', 1, '软件测试', 1, '是否回复测试计划', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (20, 3, '测试阶段', 1, '软件测试', 2, '是否回复测试用例', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (21, 3, '测试阶段', 1, '软件测试', 3, '测试用例是否通过评审/确认', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (22, 3, '测试阶段', 1, '软件测试', 4, '《软件测试报告》是否组织评审会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (23, 3, '测试阶段', 1, '软件测试', 5, '《软件测试报告》是否评审通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (24, 3, '测试阶段', 1, '软件测试', 6, '《软件测试报告》/测试结果是否发出邮件', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (25, 3, '测试阶段', 1, '软件测试', 7, '《软件测试报告》评审记录表是否签字通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (26, 4, '验收与上线', 1, '产品验收', 1, '《产品验收报告》是否组织评审会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (27, 4, '验收与上线', 1, '产品验收', 2, '《产品验收报告》是否评审通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (28, 4, '验收与上线', 1, '产品验收', 3, '《产品验收报告》是否归档到SVN', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (29, 4, '验收与上线', 1, '产品验收', 4, '《产品验收报告》评审记录表是否签字通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (30, 4, '验收与上线', 2, '上线部署', 1, '产品/开发是否提交上线流程OA', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (31, 4, '验收与上线', 2, '上线部署', 2, '开发是否提交上线相关资料', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (32, 5, '总结阶段', 1, '项目总结', 1, '《项目总结》邮件是否及时发出', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
create table OPERATION_LOG
(
id int(9) not null AUTO_INCREMENT,
tablename VARCHAR(30) not null COMMENT '被记录日志表名',
tableid int(8) not null COMMENT '被记录日志ID',
operation_time VARCHAR(30) not null COMMENT '操作时间',
operationer VARCHAR(20) not null COMMENT '操作人员',
operation_description VARCHAR(200) not null COMMENT '描述',
projectid int(8) COMMENT '项目ID',
primary key (ID)
)default character set utf8;
create table QA_ACCIDENT
(
id int(8) not null AUTO_INCREMENT,
projectid int(8) not null COMMENT '项目ID',
accstatus VARCHAR(80) not null COMMENT '事故状态',
eventtime VARCHAR(30) COMMENT '事故发生时间',
reporter VARCHAR(20) not null COMMENT '报告人',
reporttime VARCHAR(30) not null COMMENT '事故报告时间',
accdescription VARCHAR(500) not null COMMENT '事故描述',
acclevel VARCHAR(60) not null COMMENT '事故等级',
causalanalysis VARCHAR(500) COMMENT '原因分析',
causaltype VARCHAR(100) COMMENT '原因类型',
consequenceanalysis VARCHAR(300) COMMENT '后果分析',
correctiveaction VARCHAR(300) COMMENT '纠正措施',
resolutiontime VARCHAR(30) COMMENT '解决时间',
resolutioner VARCHAR(20) COMMENT '解决处理人',
preventiveaction VARCHAR(300) COMMENT '预防措施',
preventiver VARCHAR(20) COMMENT '预防措施责任人',
preventiveplandate VARCHAR(30) COMMENT '预防措施计划完成时间',
preventiveaccdate VARCHAR(30) COMMENT '预防措施实际完成时间',
trouble_duration int(8) COMMENT '事故持续时间',
impact_time int(8),
filename VARCHAR(100) COMMENT '附件路径',
primary key (ID)
)default character set utf8;
create table QA_FLOWCHECK
(
id int(10) not null AUTO_INCREMENT,
checkid int(10) not null COMMENT '检查id',
projectid int(10) not null COMMENT '项目id',
projectphase VARCHAR(20) not null COMMENT '项目阶段',
phasenode VARCHAR(50) not null COMMENT '阶段节点',
checkentry VARCHAR(100) not null COMMENT '检查内容',
checkresult VARCHAR(20) COMMENT '检查结果',
checkdate VARCHAR(20) COMMENT '检查日期',
checkdescriptions VARCHAR(400) COMMENT '不符合项描述',
stateupdate VARCHAR(20) COMMENT '状态更新',
updatedate VARCHAR(20) COMMENT '更新日期',
remark VARCHAR(200) COMMENT '备注',
versionnum VARCHAR(30) COMMENT '版本号',
primary key (ID)
)default character set utf8;
create table QA_FLOWINFO
(
id int(10) not null AUTO_INCREMENT,
phaseid int(10) not null,
phasename VARCHAR(20) not null,
phasenodeid int(10) not null,
phasenodename VARCHAR(20) not null,
checkentryid int(10) not null,
checkentry VARCHAR(200) not null,
remark VARCHAR(100),
primary key (ID)
)default character set utf8;
create table QA_PLANFLOWCHECK
(
id int(8) not null AUTO_INCREMENT,
projectid int(8) not null COMMENT '项目ID',
versionnum VARCHAR(30) COMMENT '版本号',
checkentryid VARCHAR(20) not null COMMENT '检查ID',
plandate VARCHAR(20) not null COMMENT '计划检查日期',
status int(4) not null COMMENT '计划状态1 检查计划 2 已检查',
primary key (ID)
)default character set utf8;
create table QA_PROJECTVERSION
(
versionid int(10) not null AUTO_INCREMENT,
versionnumber VARCHAR(20) COMMENT '版本号',
plan_launchdate VARCHAR(20) COMMENT '计划上线日期',
actually_launchdate VARCHAR(20) COMMENT '实际上线日期',
plan_devstart VARCHAR(20) COMMENT '计划开发开始时间',
plan_devend VARCHAR(20) COMMENT '计划开发结束时间',
actually_devstart VARCHAR(20) COMMENT '实际开发开始时间',
actually_devend VARCHAR(20) COMMENT '实际开发结束时间',
plan_teststart VARCHAR(20) COMMENT '计划测试开始时间',
plan_testend VARCHAR(20) COMMENT '计划测试结束时间',
actually_teststart VARCHAR(20) COMMENT '实际测试开始时间',
actually_testend VARCHAR(20) COMMENT '实际测试结束时间',
plan_demand int(10) COMMENT '计划上线需求数',
actually_demand int(10) COMMENT '实际上线需求数',
codeline FLOAT(10) COMMENT '代码变动行数',
testcasenum int(10) COMMENT '测试用例数',
changetestingreturn int(10) COMMENT '版本转测试打回次数',
dev_member VARCHAR(50) COMMENT '开发投入人力',
test_member VARCHAR(50) COMMENT '测试投入人力',
human_cost VARCHAR(20) COMMENT '耗费人力 人/天',
per_dev VARCHAR(20) COMMENT '开发平均生产率 人/天/行',
per_test VARCHAR(20) COMMENT '用例编写/用例执行',
code_di VARCHAR(20) COMMENT '代码DI值',
qualityreview VARCHAR(500) COMMENT '质量回溯',
imprint VARCHAR(500) COMMENT '版本说明',
remark VARCHAR(500) COMMENT '备注',
projectid int(10) COMMENT '项目ID',
devtime_deviation VARCHAR(20) COMMENT '开发偏移率',
devdelay_days VARCHAR(20) COMMENT '开发延迟时间',
testtime_deviation VARCHAR(20) COMMENT '测试偏移率',
testdelay_days VARCHAR(20) COMMENT '测试延迟时间',
protime_deviation VARCHAR(20),
prodelay_days VARCHAR(20),
bug_zm int(10),
bug_yz int(10),
bug_yb int(10),
bug_ts int(10),
versiontype int(8) default 1 not null COMMENT '版本类型',
perdemand FLOAT(8) default 0.00,
codestandard_zd int(10) default 0 not null,
codestandard_yz int(10) default 0 not null,
codestandard_zy int(10) default 0 not null,
zt_versionlink VARCHAR(100) COMMENT '禅道链接',
human_costdev VARCHAR(20) default '0' COMMENT '开发人力成本',
human_costtest VARCHAR(20) default '0' COMMENT '测试人力成本',
primary key (versionid)
)default character set utf8;
create table QA_REVIEW
(
id int(8) not null AUTO_INCREMENT,
projectid int(8) not null COMMENT '项目ID',
version VARCHAR(20) not null COMMENT '版本号',
review_type VARCHAR(20) COMMENT '评审类型',
review_date VARCHAR(20) COMMENT '评审日期',
bug_num int(8) COMMENT '问题数',
repair_num int(8) COMMENT '已修复问题数',
confirm_date VARCHAR(20) COMMENT '最后确认日期',
review_object VARCHAR(100) COMMENT '评审对象',
review_result VARCHAR(50) COMMENT '评审结果',
result_confirmor VARCHAR(50) COMMENT '结果确认人',
remark VARCHAR(500) COMMENT '备注',
primary key (id)
)default character set utf8;
create table QA_REVIEWINFO
(
id int(8) not null AUTO_INCREMENT,
review_id int(8) not null COMMENT '评审ID',
bug_description VARCHAR(500) COMMENT '问题描述',
status VARCHAR(20) COMMENT '状态',
duty_officer VARCHAR(100) COMMENT '责任人',
confirm_date VARCHAR(20) COMMENT '最后确认日期',
corrective VARCHAR(500) COMMENT '纠正措施',
primary key (id)
)default character set utf8;
create table QA_SECONDARYSECTOR
(
sectorid int(10) not null AUTO_INCREMENT,
departmenthead VARCHAR(20),
departmentname VARCHAR(20),
primary key (sectorid)
)default character set utf8;
create table QA_SECTORPROJECTS
(
projectid int(10) not null AUTO_INCREMENT,
projectname VARCHAR(100) not null,
projectmanager VARCHAR(100) not null,
sectorid int(10) not null,
projecttype int(4) default 0 not null,
primary key (projectid)
)default character set utf8;
create table QA_ZTTASK
(
id int(8) not null AUTO_INCREMENT,
versionid int(8) COMMENT '版本ID',
versionname VARCHAR(100) COMMENT '版本名称',
taskname VARCHAR(300) COMMENT '任务名称',
assigneddate VARCHAR(50) COMMENT '完成时间',
estimate int(8) COMMENT '预期工时',
consumed int(8) COMMENT '实际工时',
finishedby VARCHAR(40) COMMENT '完成人账号',
finishedname VARCHAR(40) COMMENT '完成人姓名',
deadline VARCHAR(40) COMMENT '计划截止日期',
delaystatus int(4) COMMENT '延期状态',
primary key (id)
)default character set utf8;
create table TEST_JOBS
(
id int(10) not null AUTO_INCREMENT,
name VARCHAR(100) not null COMMENT '调度名称',
startdate VARCHAR(100) COMMENT '开始日期',
starttime VARCHAR(100) COMMENT '开始时间',
enddate VARCHAR(100) COMMENT '结束日期',
endtime VARCHAR(100) COMMENT '结束时间',
runtime datetime COMMENT '执行时间',
remark VARCHAR(800) COMMENT '备注',
planproj VARCHAR(100) COMMENT '项目名testlink',
state VARCHAR(4) not null COMMENT '状态',
tasktype VARCHAR(4) not null COMMENT '执行类型 O执行一次 D每天执行',
starttimestr VARCHAR(100) COMMENT '执行时间表达式',
endtimestr VARCHAR(100) COMMENT '结束时间',
createtime datetime not null,
noenddate VARCHAR(10) COMMENT '是否有结束日期',
time int default 0,
timetype VARCHAR(4),
issendmail VARCHAR(4) default "0" COMMENT '是否发送邮件通知',
emailer VARCHAR(250) COMMENT '邮件地址',
threadcount int default 1 COMMENT '客户端线程数(接口)',
testlinkname VARCHAR(200) COMMENT 'TESTLINK中的计划名称',
isbuilding VARCHAR(4) default '0' not null COMMENT '是否自动构建',
buildname VARCHAR(100) COMMENT '构建链接',
isrestart VARCHAR(4) default '0' not null COMMENT '是否自动重启',
restartcomm VARCHAR(200) COMMENT '重启脚本',
extype int(4) default 0 not null COMMENT '执行类型',
browsertype int(4) COMMENT 'UI自动化浏览器类型',
timeout int(8) default 60 not null COMMENT '任务超时中断时间(分钟)',
clientip VARCHAR(30) default '127.0.0.1' not null COMMENT '版本ID',
primary key (id)
)default character set utf8;
create table TEST_CASEDETAIL
(
id int(10) not null AUTO_INCREMENT,
taskid int(10) not null,
caseno VARCHAR(20) not null COMMENT '用例编号',
caseversion VARCHAR(20) not null COMMENT '用例版本',
casetime datetime not null COMMENT '执行时间',
casename VARCHAR(200) not null COMMENT '用例名称',
casestatus VARCHAR(2) default '4' not null COMMENT ' pass:0 fail:1 lock:2 unexcute:4',
primary key (id)
)default character set utf8;
create table TEST_LOGDETAIL
(
logid int(10) not null AUTO_INCREMENT,
logtime datetime not null COMMENT '日志时间',
detail VARCHAR(1000) not null COMMENT '日志',
loggrade VARCHAR(20) COMMENT '日志级别',
caseid int(10) not null COMMENT '用例编号',
taskid int(10),
step VARCHAR(20) COMMENT '用例步骤',
imgname VARCHAR(30) COMMENT 'UI自动化自动截图地址',
primary key (logid)
)default character set utf8;
create table TEST_TASKEXCUTE
(
id int(10) not null AUTO_INCREMENT,
taskid VARCHAR(150) not null,
casetotal_count int(10) COMMENT '总用例数',
casesucc_count int(10) COMMENT '成功数',
casefail_count int(10) COMMENT '失败数',
caselock_count int(10) COMMENT '锁定数',
createtime datetime COMMENT '时间',
jobid int(10) not null,
finishtime datetime COMMENT '完成时间',
taskstatus VARCHAR(2) default '' COMMENT '状态 0未执行 1执行中 2 成功 4失败 ',
casenoexec_count int default 0 COMMENT '未执行用例',
caseisexec VARCHAR(2) COMMENT '任务是否被成功吊起 0 成功吊起 3 吊起失败',
primary key (id)
)default character set utf8;
create table USERINFO
(
id int(8) not null AUTO_INCREMENT,
usercode VARCHAR(20) not null,
password VARCHAR(200) not null,
username VARCHAR(20),
role VARCHAR(100) COMMENT '角色',
sectorid int(8) default 0 not null COMMENT '所属部门',
primary key (id)
)default character set utf8;
create table USER_AUTHORITY
(
id int(9) not null AUTO_INCREMENT,
module VARCHAR(50) not null COMMENT '模块',
auth_type VARCHAR(50) not null COMMENT '权限类型',
alias VARCHAR(50) not null COMMENT '别名',
primary key (id)
)default character set utf8;
create table USER_ROLE
(
id int(9) not null AUTO_INCREMENT,
role VARCHAR(50) not null COMMENT '角色',
permission VARCHAR(1000) COMMENT '权限',
primary key (id)
)default character set utf8;
/*插入索引
CREATE INDEX index_caseid ON TEST_LOGDETAIL (caseid);
CREATE INDEX index_taskid ON TEST_CASEDETAIL (taskid);*/
/*插入权限默认定义*/
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (1, '质量-版本信息', '增加', 'pv_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (2, '质量-版本信息', '删除', 'pv_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (3, '质量-版本信息', '修改', 'pv_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (4, '质量-版本计划信息', '增加', 'pvp_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (5, '质量-流程检查信息', '增加', 'fc_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (6, '质量-流程检查信息', '删除', 'fc_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (7, '质量-流程检查信息', '修改', 'fc_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (8, '质量-生产故障信息', '增加', 'acc_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (9, '质量-生产故障信息', '删除', 'acc_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (10, '质量-生产故障信息', '修改', 'acc_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (21, '自动化-任务调度', '启动', 'tast_run');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (22, '自动化-任务调度', '移除', 'tast_remove');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (23, '自动化-任务调度', '执行', 'tast_ex');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (24, '自动化-任务调度', '增加', 'tast_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (25, '自动化-任务调度', '删除', 'tast_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (26, '自动化-任务调度', '修改', 'tast_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (27, '自动化-任务调度', '上传', 'tast_upload');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (11, '质量-流程检查计划', '增加', 'pfc_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (12, '质量-流程检查计划', '删除', 'pfc_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (13, '质量-流程检查计划', '修改', 'pfc_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (14, '质量-流程检查计划', '转计划', 'fc_tocheck');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (15, '质量-评审信息详情', '增加', 'revinfo_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (16, '质量-评审信息详情', '删除', 'revinfo_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (17, '质量-评审信息详情', '修改', 'revinfo_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (18, '质量-评审信息', '删除', 'rev_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (19, '质量-评审信息', '修改', 'rev_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (20, '质量-生产故障信息', '上传', 'acc_upload');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (41, '用户管理', '增加', 'ui_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (42, '用户管理', '删除', 'ui_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (43, '用户管理', '修改', 'ui_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (44, '用户管理', '查看', 'ui_4');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (45, '用户管理-权限角色', '查看修改', 'role_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (28, '自动化-任务列表', '删除', 'tastex_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (29, '自动化-用例列表', '执行', 'case_ex');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (46, '用户管理-权限角色', '增加', 'role_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (47, '用户管理-权限角色', '删除', 'role_2');
/*插入角色默认定义*/
insert into USER_ROLE (id, role, permission)
values (2, '测试工程师', 'acc_1,acc_2,acc_3,');
insert into USER_ROLE (id, role, permission)
values (3, '自动化工程师', 'acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,');
insert into USER_ROLE (id, role, permission)
values (4, '质量工程师', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,');
insert into USER_ROLE (id, role, permission)
values (1, '管理员', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,ui_1,ui_2,ui_3,ui_4,role_3,role_1,role_2,');
/*插入默认部门分级*/
insert into QA_SECONDARYSECTOR (sectorid, departmenthead, departmentname)
values (99, '系统管理员', '总部');
/*插入默认项目*/
insert into QA_SECTORPROJECTS (projectid, projectname, projectmanager, sectorid, projecttype)
values (99, '全部项目/未知项目', '系统管理员', 99, 0);
/*插入默认管理员*/
insert into USERINFO (id, usercode, password, username, role, sectorid)
values (1, 'admin', 'uJ45aIeS9N80kaSFDjvk%2FA%3D%3D', '系统管理员', '1', 99);
/*插入流程检查定义数据*/
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (36, 5, '总结阶段', 2, '计划变更', 1, '如与计划不合,是否提交计划变更邮件', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (37, 5, '总结阶段', 3, '代码质量', 1, 'sonar代码检查是否刷新构建', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (38, 5, '总结阶段', 3, '代码质量', 2, 'sonar代码问题数是否符合要求', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (35, 2, '开发阶段', 3, '开发与编码', 6, '是否每一条禅道开发任务都提交转测申请', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (34, 4, '验收与上线', 2, '上线部署', 3, 'SVN代码是否提交并标注', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (1, 1, '需求阶段', 1, '需求编制', 1, '《产品需求说明书》是否组织评审会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (2, 1, '需求阶段', 1, '需求编制', 2, '《产品需求说明书》评审是否通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (3, 1, '需求阶段', 1, '需求编制', 3, '《产品需求说明书》是否归档到SVN', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (4, 1, '需求阶段', 1, '需求编制', 4, '《产品需求说明书》评审记录表是否签字通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (5, 2, '开发阶段', 1, '需求分解', 1, '是否有需求分解/任务讨论会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (6, 2, '开发阶段', 1, '需求分解', 2, '《项目计划》邮件是否及时发出', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (7, 2, '开发阶段', 1, '需求分解', 3, '《项目计划》邮件内容是否完整', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (10, 2, '开发阶段', 2, '软件设计', 1, '《产品开发概要设计》是否组织评审会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (11, 2, '开发阶段', 2, '软件设计', 2, '《产品开发概要设计》评审是否通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (12, 2, '开发阶段', 2, '软件设计', 3, '《产品开发概要设计》是否归档到SVN', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (13, 2, '开发阶段', 2, '软件设计', 4, '《产品开发概要设计》评审记录表是否签字通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (14, 2, '开发阶段', 3, '开发与编码', 1, '是否进行每日晨会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (15, 2, '开发阶段', 3, '开发与编码', 2, '是否进行代码走读', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (16, 2, '开发阶段', 3, '开发与编码', 3, '是否每一条禅道开发任务都提交转测申请', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (17, 2, '开发阶段', 3, '开发与编码', 4, '转测邮件是否合格', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (18, 2, '开发阶段', 3, '开发与编码', 5, '转测邮件打回次数为0', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (19, 3, '测试阶段', 1, '软件测试', 1, '是否回复测试计划', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (20, 3, '测试阶段', 1, '软件测试', 2, '是否回复测试用例', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (21, 3, '测试阶段', 1, '软件测试', 3, '测试用例是否通过评审/确认', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (22, 3, '测试阶段', 1, '软件测试', 4, '《软件测试报告》是否组织评审会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (23, 3, '测试阶段', 1, '软件测试', 5, '《软件测试报告》是否评审通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (24, 3, '测试阶段', 1, '软件测试', 6, '《软件测试报告》/测试结果是否发出邮件', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (25, 3, '测试阶段', 1, '软件测试', 7, '《软件测试报告》评审记录表是否签字通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (26, 4, '验收与上线', 1, '产品验收', 1, '《产品验收报告》是否组织评审会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (27, 4, '验收与上线', 1, '产品验收', 2, '《产品验收报告》是否评审通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (28, 4, '验收与上线', 1, '产品验收', 3, '《产品验收报告》是否归档到SVN', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (29, 4, '验收与上线', 1, '产品验收', 4, '《产品验收报告》评审记录表是否签字通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (30, 4, '验收与上线', 2, '上线部署', 1, '产品/开发是否提交上线流程OA', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (31, 4, '验收与上线', 2, '上线部署', 2, '开发是否提交上线相关资料', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (32, 5, '总结阶段', 1, '项目总结', 1, '《项目总结》邮件是否及时发出', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (33, 5, '总结阶段', 1, '项目总结', 2, '《项目总结》邮件内容是否完整', null);

View File

@ -1,457 +1,457 @@
create table OPERATION_LOG
(
id int(9) not null AUTO_INCREMENT,
tablename VARCHAR(30) not null COMMENT '被记录日志表名',
tableid int(8) not null COMMENT '被记录日志ID',
operation_time VARCHAR(30) not null COMMENT '操作时间',
operationer VARCHAR(20) not null COMMENT '操作人员',
operation_description VARCHAR(200) not null COMMENT '描述',
projectid int(8) COMMENT '项目ID',
primary key (ID)
)default character set utf8;
create table QA_ACCIDENT
(
id int(8) not null AUTO_INCREMENT,
projectid int(8) not null COMMENT '项目ID',
accstatus VARCHAR(80) not null COMMENT '事故状态',
eventtime VARCHAR(30) COMMENT '事故发生时间',
reporter VARCHAR(20) not null COMMENT '报告人',
reporttime VARCHAR(30) not null COMMENT '事故报告时间',
accdescription VARCHAR(500) not null COMMENT '事故描述',
acclevel VARCHAR(60) not null COMMENT '事故等级',
causalanalysis VARCHAR(500) COMMENT '原因分析',
causaltype VARCHAR(100) COMMENT '原因类型',
consequenceanalysis VARCHAR(300) COMMENT '后果分析',
correctiveaction VARCHAR(300) COMMENT '纠正措施',
resolutiontime VARCHAR(30) COMMENT '解决时间',
resolutioner VARCHAR(20) COMMENT '解决处理人',
preventiveaction VARCHAR(300) COMMENT '预防措施',
preventiver VARCHAR(20) COMMENT '预防措施责任人',
preventiveplandate VARCHAR(30) COMMENT '预防措施计划完成时间',
preventiveaccdate VARCHAR(30) COMMENT '预防措施实际完成时间',
trouble_duration int(8) COMMENT '事故持续时间',
impact_time int(8),
filename VARCHAR(100) COMMENT '附件路径',
primary key (ID)
)default character set utf8;
create table QA_FLOWCHECK
(
id int(10) not null AUTO_INCREMENT,
checkid int(10) not null COMMENT '检查id',
projectid int(10) not null COMMENT '项目id',
projectphase VARCHAR(20) not null COMMENT '项目阶段',
phasenode VARCHAR(50) not null COMMENT '阶段节点',
checkentry VARCHAR(100) not null COMMENT '检查内容',
checkresult VARCHAR(20) COMMENT '检查结果',
checkdate VARCHAR(20) COMMENT '检查日期',
checkdescriptions VARCHAR(400) COMMENT '不符合项描述',
stateupdate VARCHAR(20) COMMENT '状态更新',
updatedate VARCHAR(20) COMMENT '更新日期',
remark VARCHAR(200) COMMENT '备注',
versionnum VARCHAR(30) COMMENT '版本号',
primary key (ID)
)default character set utf8;
create table QA_FLOWINFO
(
id int(10) not null AUTO_INCREMENT,
phaseid int(10) not null,
phasename VARCHAR(20) not null,
phasenodeid int(10) not null,
phasenodename VARCHAR(20) not null,
checkentryid int(10) not null,
checkentry VARCHAR(200) not null,
remark VARCHAR(100),
primary key (ID)
)default character set utf8;
create table QA_PLANFLOWCHECK
(
id int(8) not null AUTO_INCREMENT,
projectid int(8) not null COMMENT '项目ID',
versionnum VARCHAR(30) COMMENT '版本号',
checkentryid VARCHAR(20) not null COMMENT '检查ID',
plandate VARCHAR(20) not null COMMENT '计划检查日期',
status int(4) not null COMMENT '计划状态1 检查计划 2 已检查',
primary key (ID)
)default character set utf8;
create table QA_PROJECTVERSION
(
versionid int(10) not null AUTO_INCREMENT,
versionnumber VARCHAR(20) COMMENT '版本号',
plan_launchdate VARCHAR(20) COMMENT '计划上线日期',
actually_launchdate VARCHAR(20) COMMENT '实际上线日期',
plan_devstart VARCHAR(20) COMMENT '计划开发开始时间',
plan_devend VARCHAR(20) COMMENT '计划开发结束时间',
actually_devstart VARCHAR(20) COMMENT '实际开发开始时间',
actually_devend VARCHAR(20) COMMENT '实际开发结束时间',
plan_teststart VARCHAR(20) COMMENT '计划测试开始时间',
plan_testend VARCHAR(20) COMMENT '计划测试结束时间',
actually_teststart VARCHAR(20) COMMENT '实际测试开始时间',
actually_testend VARCHAR(20) COMMENT '实际测试结束时间',
plan_demand int(10) COMMENT '计划上线需求数',
actually_demand int(10) COMMENT '实际上线需求数',
codeline FLOAT(10) COMMENT '代码变动行数',
testcasenum int(10) COMMENT '测试用例数',
changetestingreturn int(10) COMMENT '版本转测试打回次数',
dev_member VARCHAR(50) COMMENT '开发投入人力',
test_member VARCHAR(50) COMMENT '测试投入人力',
human_cost VARCHAR(20) COMMENT '耗费人力 人/天',
per_dev VARCHAR(20) COMMENT '开发平均生产率 人/天/行',
per_test VARCHAR(20) COMMENT '用例编写/用例执行',
code_di VARCHAR(20) COMMENT '代码DI值',
qualityreview VARCHAR(500) COMMENT '质量回溯',
imprint VARCHAR(500) COMMENT '版本说明',
remark VARCHAR(500) COMMENT '备注',
projectid int(10) COMMENT '项目ID',
devtime_deviation VARCHAR(20) COMMENT '开发偏移率',
devdelay_days VARCHAR(20) COMMENT '开发延迟时间',
testtime_deviation VARCHAR(20) COMMENT '测试偏移率',
testdelay_days VARCHAR(20) COMMENT '测试延迟时间',
protime_deviation VARCHAR(20),
prodelay_days VARCHAR(20),
bug_zm int(10),
bug_yz int(10),
bug_yb int(10),
bug_ts int(10),
versiontype int(8) default 1 not null COMMENT '版本类型',
perdemand FLOAT(8) default 0.00,
codestandard_zd int(10) default 0 not null,
codestandard_yz int(10) default 0 not null,
codestandard_zy int(10) default 0 not null,
zt_versionlink VARCHAR(100) COMMENT '禅道链接',
human_costdev VARCHAR(20) default '0' COMMENT '开发人力成本',
human_costtest VARCHAR(20) default '0' COMMENT '测试人力成本',
primary key (versionid)
)default character set utf8;
create table QA_REVIEW
(
id int(8) not null AUTO_INCREMENT,
projectid int(8) not null COMMENT '项目ID',
version VARCHAR(20) not null COMMENT '版本号',
review_type VARCHAR(20) COMMENT '评审类型',
review_date VARCHAR(20) COMMENT '评审日期',
bug_num int(8) COMMENT '问题数',
repair_num int(8) COMMENT '已修复问题数',
confirm_date VARCHAR(20) COMMENT '最后确认日期',
review_object VARCHAR(100) COMMENT '评审对象',
review_result VARCHAR(50) COMMENT '评审结果',
result_confirmor VARCHAR(50) COMMENT '结果确认人',
remark VARCHAR(500) COMMENT '备注',
primary key (id)
)default character set utf8;
create table QA_REVIEWINFO
(
id int(8) not null AUTO_INCREMENT,
review_id int(8) not null COMMENT '评审ID',
bug_description VARCHAR(500) COMMENT '问题描述',
status VARCHAR(20) COMMENT '状态',
duty_officer VARCHAR(100) COMMENT '责任人',
confirm_date VARCHAR(20) COMMENT '最后确认日期',
corrective VARCHAR(500) COMMENT '纠正措施',
primary key (id)
)default character set utf8;
create table QA_SECONDARYSECTOR
(
sectorid int(10) not null AUTO_INCREMENT,
departmenthead VARCHAR(20),
departmentname VARCHAR(20),
primary key (sectorid)
)default character set utf8;
create table QA_SECTORPROJECTS
(
projectid int(10) not null AUTO_INCREMENT,
projectname VARCHAR(100) not null,
projectmanager VARCHAR(100) not null,
sectorid int(10) not null,
projecttype int(4) default 0 not null,
primary key (projectid)
)default character set utf8;
create table QA_ZTTASK
(
id int(8) not null AUTO_INCREMENT,
versionid int(8) COMMENT '版本ID',
versionname VARCHAR(100) COMMENT '版本名称',
taskname VARCHAR(300) COMMENT '任务名称',
assigneddate VARCHAR(50) COMMENT '完成时间',
estimate int(8) COMMENT '预期工时',
consumed int(8) COMMENT '实际工时',
finishedby VARCHAR(40) COMMENT '完成人账号',
finishedname VARCHAR(40) COMMENT '完成人姓名',
deadline VARCHAR(40) COMMENT '计划截止日期',
delaystatus int(4) COMMENT '延期状态',
primary key (id)
)default character set utf8;
create table TEST_JOBS
(
id int(10) not null AUTO_INCREMENT,
name VARCHAR(100) not null COMMENT '调度名称',
startdate VARCHAR(100) COMMENT '开始日期',
starttime VARCHAR(100) COMMENT '开始时间',
enddate VARCHAR(100) COMMENT '结束日期',
endtime VARCHAR(100) COMMENT '结束时间',
runtime datetime COMMENT '执行时间',
remark VARCHAR(800) COMMENT '备注',
planproj VARCHAR(100) COMMENT '项目名testlink',
state VARCHAR(4) not null COMMENT '状态',
tasktype VARCHAR(4) not null COMMENT '执行类型 O执行一次 D每天执行',
starttimestr VARCHAR(100) COMMENT '执行时间表达式',
endtimestr VARCHAR(100) COMMENT '结束时间',
createtime datetime not null,
noenddate VARCHAR(10) COMMENT '是否有结束日期',
time int default 0,
timetype VARCHAR(4),
issendmail VARCHAR(4) default "0" COMMENT '是否发送邮件通知',
emailer VARCHAR(250) COMMENT '邮件地址',
threadcount int default 1 COMMENT '客户端线程数(接口)',
testlinkname VARCHAR(200) COMMENT 'TESTLINK中的计划名称',
isbuilding VARCHAR(4) default '0' not null COMMENT '是否自动构建',
buildname VARCHAR(100) COMMENT '构建链接',
isrestart VARCHAR(4) default '0' not null COMMENT '是否自动重启',
restartcomm VARCHAR(200) COMMENT '重启脚本',
extype int(4) default 0 not null COMMENT '执行类型',
browsertype int(4) COMMENT 'UI自动化浏览器类型',
timeout int(8) default 60 not null COMMENT '任务超时中断时间(分钟)',
clientip VARCHAR(30) default '127.0.0.1' not null COMMENT '版本ID',
primary key (id)
)default character set utf8;
create table TEST_CASEDETAIL
(
id int(10) not null AUTO_INCREMENT,
taskid int(10) not null,
caseno VARCHAR(20) not null COMMENT '用例编号',
caseversion VARCHAR(20) not null COMMENT '用例版本',
casetime datetime not null COMMENT '执行时间',
casename VARCHAR(200) not null COMMENT '用例名称',
casestatus VARCHAR(2) default '4' not null COMMENT ' pass:0 fail:1 lock:2 unexcute:4',
primary key (id)
)default character set utf8;
create table TEST_LOGDETAIL
(
logid int(10) not null AUTO_INCREMENT,
logtime datetime not null COMMENT '日志时间',
detail VARCHAR(5000) not null COMMENT '日志', /*V1.1 扩展日志明细字段到2000*/
loggrade VARCHAR(20) COMMENT '日志级别',
caseid int(10) not null COMMENT '用例编号',
taskid int(10),
step VARCHAR(20) COMMENT '用例步骤',
imgname VARCHAR(30) COMMENT 'UI自动化自动截图地址',
primary key (logid)
)default character set utf8;
create table TEST_TASKEXCUTE
(
id int(10) not null AUTO_INCREMENT,
taskid VARCHAR(150) not null,
casetotal_count int(10) COMMENT '总用例数',
casesucc_count int(10) COMMENT '成功数',
casefail_count int(10) COMMENT '失败数',
caselock_count int(10) COMMENT '锁定数',
createtime datetime COMMENT '时间',
jobid int(10) not null,
finishtime datetime COMMENT '完成时间',
taskstatus VARCHAR(2) default '' COMMENT '状态 0未执行 1执行中 2 成功 4失败 ',
casenoexec_count int default 0 COMMENT '未执行用例',
caseisexec VARCHAR(2) COMMENT '任务是否被成功吊起 0 成功吊起 3 吊起失败',
primary key (id)
)default character set utf8;
create table USERINFO
(
id int(8) not null AUTO_INCREMENT,
usercode VARCHAR(20) not null,
password VARCHAR(200) not null,
username VARCHAR(20),
role VARCHAR(100) COMMENT '角色',
sectorid int(8) default 0 not null COMMENT '所属部门',
primary key (id)
)default character set utf8;
create table USER_AUTHORITY
(
id int(9) not null AUTO_INCREMENT,
module VARCHAR(50) not null COMMENT '模块',
auth_type VARCHAR(50) not null COMMENT '权限类型',
alias VARCHAR(50) not null COMMENT '别名',
primary key (id)
)default character set utf8;
create table USER_ROLE
(
id int(9) not null AUTO_INCREMENT,
role VARCHAR(50) not null COMMENT '角色',
permission VARCHAR(1000) COMMENT '权限',
primary key (id)
)default character set utf8;
/*插入索引
CREATE INDEX index_caseid ON TEST_LOGDETAIL (caseid);
CREATE INDEX index_taskid ON TEST_CASEDETAIL (taskid);*/
/*插入权限默认定义*/
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (1, '质量-版本信息', '增加', 'pv_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (2, '质量-版本信息', '删除', 'pv_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (3, '质量-版本信息', '修改', 'pv_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (4, '质量-版本计划信息', '增加', 'pvp_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (5, '质量-流程检查信息', '增加', 'fc_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (6, '质量-流程检查信息', '删除', 'fc_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (7, '质量-流程检查信息', '修改', 'fc_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (8, '质量-生产故障信息', '增加', 'acc_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (9, '质量-生产故障信息', '删除', 'acc_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (10, '质量-生产故障信息', '修改', 'acc_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (21, '自动化-任务调度', '启动', 'tast_run');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (22, '自动化-任务调度', '移除', 'tast_remove');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (23, '自动化-任务调度', '执行', 'tast_ex');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (24, '自动化-任务调度', '增加', 'tast_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (25, '自动化-任务调度', '删除', 'tast_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (26, '自动化-任务调度', '修改', 'tast_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (27, '自动化-任务调度', '上传', 'tast_upload');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (11, '质量-流程检查计划', '增加', 'pfc_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (12, '质量-流程检查计划', '删除', 'pfc_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (13, '质量-流程检查计划', '修改', 'pfc_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (14, '质量-流程检查计划', '转计划', 'fc_tocheck');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (15, '质量-评审信息详情', '增加', 'revinfo_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (16, '质量-评审信息详情', '删除', 'revinfo_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (17, '质量-评审信息详情', '修改', 'revinfo_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (18, '质量-评审信息', '删除', 'rev_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (19, '质量-评审信息', '修改', 'rev_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (20, '质量-生产故障信息', '上传', 'acc_upload');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (41, '用户管理', '增加', 'ui_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (42, '用户管理', '删除', 'ui_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (43, '用户管理', '修改', 'ui_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (44, '用户管理', '查看', 'ui_4');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (45, '用户管理-权限角色', '查看修改', 'role_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (28, '自动化-任务列表', '删除', 'tastex_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (29, '自动化-用例列表', '执行', 'case_ex');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (46, '用户管理-权限角色', '增加', 'role_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (47, '用户管理-权限角色', '删除', 'role_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (48, '项目管理', '增加', 'pro_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (49, '项目管理', '删除', 'pro_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (50, '项目管理', '修改', 'pro_3');
/*插入角色默认定义*/
insert into USER_ROLE (id, role, permission)
values (2, '测试工程师', 'acc_1,acc_2,acc_3,');
insert into USER_ROLE (id, role, permission)
values (3, '自动化工程师', 'acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,');
insert into USER_ROLE (id, role, permission)
values (4, '质量工程师', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,');
insert into USER_ROLE (id, role, permission)
values (1, '管理员', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,ui_1,ui_2,ui_3,ui_4,role_3,role_1,role_2,');
/*插入默认部门分级*/
insert into QA_SECONDARYSECTOR (sectorid, departmenthead, departmentname)
values (99, '系统管理员', '总部');
/*插入默认项目*/
insert into QA_SECTORPROJECTS (projectid, projectname, projectmanager, sectorid, projecttype)
values (99, '全部项目/未知项目', '系统管理员', 99, 0);
/*插入默认管理员*/
insert into USERINFO (id, usercode, password, username, role, sectorid)
values (1, 'admin', 'uJ45aIeS9N80kaSFDjvk%2FA%3D%3D', '系统管理员', '1', 99);
/*插入流程检查定义数据*/
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (36, 5, '总结阶段', 2, '计划变更', 1, '如与计划不合,是否提交计划变更邮件', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (37, 5, '总结阶段', 3, '代码质量', 1, 'sonar代码检查是否刷新构建', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (38, 5, '总结阶段', 3, '代码质量', 2, 'sonar代码问题数是否符合要求', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (35, 2, '开发阶段', 3, '开发与编码', 6, '是否每一条禅道开发任务都提交转测申请', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (34, 4, '验收与上线', 2, '上线部署', 3, 'SVN代码是否提交并标注', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (1, 1, '需求阶段', 1, '需求编制', 1, '《产品需求说明书》是否组织评审会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (2, 1, '需求阶段', 1, '需求编制', 2, '《产品需求说明书》评审是否通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (3, 1, '需求阶段', 1, '需求编制', 3, '《产品需求说明书》是否归档到SVN', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (4, 1, '需求阶段', 1, '需求编制', 4, '《产品需求说明书》评审记录表是否签字通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (5, 2, '开发阶段', 1, '需求分解', 1, '是否有需求分解/任务讨论会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (6, 2, '开发阶段', 1, '需求分解', 2, '《项目计划》邮件是否及时发出', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (7, 2, '开发阶段', 1, '需求分解', 3, '《项目计划》邮件内容是否完整', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (10, 2, '开发阶段', 2, '软件设计', 1, '《产品开发概要设计》是否组织评审会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (11, 2, '开发阶段', 2, '软件设计', 2, '《产品开发概要设计》评审是否通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (12, 2, '开发阶段', 2, '软件设计', 3, '《产品开发概要设计》是否归档到SVN', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (13, 2, '开发阶段', 2, '软件设计', 4, '《产品开发概要设计》评审记录表是否签字通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (14, 2, '开发阶段', 3, '开发与编码', 1, '是否进行每日晨会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (15, 2, '开发阶段', 3, '开发与编码', 2, '是否进行代码走读', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (16, 2, '开发阶段', 3, '开发与编码', 3, '是否每一条禅道开发任务都提交转测申请', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (17, 2, '开发阶段', 3, '开发与编码', 4, '转测邮件是否合格', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (18, 2, '开发阶段', 3, '开发与编码', 5, '转测邮件打回次数为0', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (19, 3, '测试阶段', 1, '软件测试', 1, '是否回复测试计划', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (20, 3, '测试阶段', 1, '软件测试', 2, '是否回复测试用例', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (21, 3, '测试阶段', 1, '软件测试', 3, '测试用例是否通过评审/确认', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (22, 3, '测试阶段', 1, '软件测试', 4, '《软件测试报告》是否组织评审会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (23, 3, '测试阶段', 1, '软件测试', 5, '《软件测试报告》是否评审通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (24, 3, '测试阶段', 1, '软件测试', 6, '《软件测试报告》/测试结果是否发出邮件', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (25, 3, '测试阶段', 1, '软件测试', 7, '《软件测试报告》评审记录表是否签字通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (26, 4, '验收与上线', 1, '产品验收', 1, '《产品验收报告》是否组织评审会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (27, 4, '验收与上线', 1, '产品验收', 2, '《产品验收报告》是否评审通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (28, 4, '验收与上线', 1, '产品验收', 3, '《产品验收报告》是否归档到SVN', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (29, 4, '验收与上线', 1, '产品验收', 4, '《产品验收报告》评审记录表是否签字通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (30, 4, '验收与上线', 2, '上线部署', 1, '产品/开发是否提交上线流程OA', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (31, 4, '验收与上线', 2, '上线部署', 2, '开发是否提交上线相关资料', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (32, 5, '总结阶段', 1, '项目总结', 1, '《项目总结》邮件是否及时发出', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
create table OPERATION_LOG
(
id int(9) not null AUTO_INCREMENT,
tablename VARCHAR(30) not null COMMENT '被记录日志表名',
tableid int(8) not null COMMENT '被记录日志ID',
operation_time VARCHAR(30) not null COMMENT '操作时间',
operationer VARCHAR(20) not null COMMENT '操作人员',
operation_description VARCHAR(200) not null COMMENT '描述',
projectid int(8) COMMENT '项目ID',
primary key (ID)
)default character set utf8;
create table QA_ACCIDENT
(
id int(8) not null AUTO_INCREMENT,
projectid int(8) not null COMMENT '项目ID',
accstatus VARCHAR(80) not null COMMENT '事故状态',
eventtime VARCHAR(30) COMMENT '事故发生时间',
reporter VARCHAR(20) not null COMMENT '报告人',
reporttime VARCHAR(30) not null COMMENT '事故报告时间',
accdescription VARCHAR(500) not null COMMENT '事故描述',
acclevel VARCHAR(60) not null COMMENT '事故等级',
causalanalysis VARCHAR(500) COMMENT '原因分析',
causaltype VARCHAR(100) COMMENT '原因类型',
consequenceanalysis VARCHAR(300) COMMENT '后果分析',
correctiveaction VARCHAR(300) COMMENT '纠正措施',
resolutiontime VARCHAR(30) COMMENT '解决时间',
resolutioner VARCHAR(20) COMMENT '解决处理人',
preventiveaction VARCHAR(300) COMMENT '预防措施',
preventiver VARCHAR(20) COMMENT '预防措施责任人',
preventiveplandate VARCHAR(30) COMMENT '预防措施计划完成时间',
preventiveaccdate VARCHAR(30) COMMENT '预防措施实际完成时间',
trouble_duration int(8) COMMENT '事故持续时间',
impact_time int(8),
filename VARCHAR(100) COMMENT '附件路径',
primary key (ID)
)default character set utf8;
create table QA_FLOWCHECK
(
id int(10) not null AUTO_INCREMENT,
checkid int(10) not null COMMENT '检查id',
projectid int(10) not null COMMENT '项目id',
projectphase VARCHAR(20) not null COMMENT '项目阶段',
phasenode VARCHAR(50) not null COMMENT '阶段节点',
checkentry VARCHAR(100) not null COMMENT '检查内容',
checkresult VARCHAR(20) COMMENT '检查结果',
checkdate VARCHAR(20) COMMENT '检查日期',
checkdescriptions VARCHAR(400) COMMENT '不符合项描述',
stateupdate VARCHAR(20) COMMENT '状态更新',
updatedate VARCHAR(20) COMMENT '更新日期',
remark VARCHAR(200) COMMENT '备注',
versionnum VARCHAR(30) COMMENT '版本号',
primary key (ID)
)default character set utf8;
create table QA_FLOWINFO
(
id int(10) not null AUTO_INCREMENT,
phaseid int(10) not null,
phasename VARCHAR(20) not null,
phasenodeid int(10) not null,
phasenodename VARCHAR(20) not null,
checkentryid int(10) not null,
checkentry VARCHAR(200) not null,
remark VARCHAR(100),
primary key (ID)
)default character set utf8;
create table QA_PLANFLOWCHECK
(
id int(8) not null AUTO_INCREMENT,
projectid int(8) not null COMMENT '项目ID',
versionnum VARCHAR(30) COMMENT '版本号',
checkentryid VARCHAR(20) not null COMMENT '检查ID',
plandate VARCHAR(20) not null COMMENT '计划检查日期',
status int(4) not null COMMENT '计划状态1 检查计划 2 已检查',
primary key (ID)
)default character set utf8;
create table QA_PROJECTVERSION
(
versionid int(10) not null AUTO_INCREMENT,
versionnumber VARCHAR(20) COMMENT '版本号',
plan_launchdate VARCHAR(20) COMMENT '计划上线日期',
actually_launchdate VARCHAR(20) COMMENT '实际上线日期',
plan_devstart VARCHAR(20) COMMENT '计划开发开始时间',
plan_devend VARCHAR(20) COMMENT '计划开发结束时间',
actually_devstart VARCHAR(20) COMMENT '实际开发开始时间',
actually_devend VARCHAR(20) COMMENT '实际开发结束时间',
plan_teststart VARCHAR(20) COMMENT '计划测试开始时间',
plan_testend VARCHAR(20) COMMENT '计划测试结束时间',
actually_teststart VARCHAR(20) COMMENT '实际测试开始时间',
actually_testend VARCHAR(20) COMMENT '实际测试结束时间',
plan_demand int(10) COMMENT '计划上线需求数',
actually_demand int(10) COMMENT '实际上线需求数',
codeline FLOAT(10) COMMENT '代码变动行数',
testcasenum int(10) COMMENT '测试用例数',
changetestingreturn int(10) COMMENT '版本转测试打回次数',
dev_member VARCHAR(50) COMMENT '开发投入人力',
test_member VARCHAR(50) COMMENT '测试投入人力',
human_cost VARCHAR(20) COMMENT '耗费人力 人/天',
per_dev VARCHAR(20) COMMENT '开发平均生产率 人/天/行',
per_test VARCHAR(20) COMMENT '用例编写/用例执行',
code_di VARCHAR(20) COMMENT '代码DI值',
qualityreview VARCHAR(500) COMMENT '质量回溯',
imprint VARCHAR(500) COMMENT '版本说明',
remark VARCHAR(500) COMMENT '备注',
projectid int(10) COMMENT '项目ID',
devtime_deviation VARCHAR(20) COMMENT '开发偏移率',
devdelay_days VARCHAR(20) COMMENT '开发延迟时间',
testtime_deviation VARCHAR(20) COMMENT '测试偏移率',
testdelay_days VARCHAR(20) COMMENT '测试延迟时间',
protime_deviation VARCHAR(20),
prodelay_days VARCHAR(20),
bug_zm int(10),
bug_yz int(10),
bug_yb int(10),
bug_ts int(10),
versiontype int(8) default 1 not null COMMENT '版本类型',
perdemand FLOAT(8) default 0.00,
codestandard_zd int(10) default 0 not null,
codestandard_yz int(10) default 0 not null,
codestandard_zy int(10) default 0 not null,
zt_versionlink VARCHAR(100) COMMENT '禅道链接',
human_costdev VARCHAR(20) default '0' COMMENT '开发人力成本',
human_costtest VARCHAR(20) default '0' COMMENT '测试人力成本',
primary key (versionid)
)default character set utf8;
create table QA_REVIEW
(
id int(8) not null AUTO_INCREMENT,
projectid int(8) not null COMMENT '项目ID',
version VARCHAR(20) not null COMMENT '版本号',
review_type VARCHAR(20) COMMENT '评审类型',
review_date VARCHAR(20) COMMENT '评审日期',
bug_num int(8) COMMENT '问题数',
repair_num int(8) COMMENT '已修复问题数',
confirm_date VARCHAR(20) COMMENT '最后确认日期',
review_object VARCHAR(100) COMMENT '评审对象',
review_result VARCHAR(50) COMMENT '评审结果',
result_confirmor VARCHAR(50) COMMENT '结果确认人',
remark VARCHAR(500) COMMENT '备注',
primary key (id)
)default character set utf8;
create table QA_REVIEWINFO
(
id int(8) not null AUTO_INCREMENT,
review_id int(8) not null COMMENT '评审ID',
bug_description VARCHAR(500) COMMENT '问题描述',
status VARCHAR(20) COMMENT '状态',
duty_officer VARCHAR(100) COMMENT '责任人',
confirm_date VARCHAR(20) COMMENT '最后确认日期',
corrective VARCHAR(500) COMMENT '纠正措施',
primary key (id)
)default character set utf8;
create table QA_SECONDARYSECTOR
(
sectorid int(10) not null AUTO_INCREMENT,
departmenthead VARCHAR(20),
departmentname VARCHAR(20),
primary key (sectorid)
)default character set utf8;
create table QA_SECTORPROJECTS
(
projectid int(10) not null AUTO_INCREMENT,
projectname VARCHAR(100) not null,
projectmanager VARCHAR(100) not null,
sectorid int(10) not null,
projecttype int(4) default 0 not null,
primary key (projectid)
)default character set utf8;
create table QA_ZTTASK
(
id int(8) not null AUTO_INCREMENT,
versionid int(8) COMMENT '版本ID',
versionname VARCHAR(100) COMMENT '版本名称',
taskname VARCHAR(300) COMMENT '任务名称',
assigneddate VARCHAR(50) COMMENT '完成时间',
estimate int(8) COMMENT '预期工时',
consumed int(8) COMMENT '实际工时',
finishedby VARCHAR(40) COMMENT '完成人账号',
finishedname VARCHAR(40) COMMENT '完成人姓名',
deadline VARCHAR(40) COMMENT '计划截止日期',
delaystatus int(4) COMMENT '延期状态',
primary key (id)
)default character set utf8;
create table TEST_JOBS
(
id int(10) not null AUTO_INCREMENT,
name VARCHAR(100) not null COMMENT '调度名称',
startdate VARCHAR(100) COMMENT '开始日期',
starttime VARCHAR(100) COMMENT '开始时间',
enddate VARCHAR(100) COMMENT '结束日期',
endtime VARCHAR(100) COMMENT '结束时间',
runtime datetime COMMENT '执行时间',
remark VARCHAR(800) COMMENT '备注',
planproj VARCHAR(100) COMMENT '项目名testlink',
state VARCHAR(4) not null COMMENT '状态',
tasktype VARCHAR(4) not null COMMENT '执行类型 O执行一次 D每天执行',
starttimestr VARCHAR(100) COMMENT '执行时间表达式',
endtimestr VARCHAR(100) COMMENT '结束时间',
createtime datetime not null,
noenddate VARCHAR(10) COMMENT '是否有结束日期',
time int default 0,
timetype VARCHAR(4),
issendmail VARCHAR(4) default "0" COMMENT '是否发送邮件通知',
emailer VARCHAR(250) COMMENT '邮件地址',
threadcount int default 1 COMMENT '客户端线程数(接口)',
testlinkname VARCHAR(200) COMMENT 'TESTLINK中的计划名称',
isbuilding VARCHAR(4) default '0' not null COMMENT '是否自动构建',
buildname VARCHAR(100) COMMENT '构建链接',
isrestart VARCHAR(4) default '0' not null COMMENT '是否自动重启',
restartcomm VARCHAR(200) COMMENT '重启脚本',
extype int(4) default 0 not null COMMENT '执行类型',
browsertype int(4) COMMENT 'UI自动化浏览器类型',
timeout int(8) default 60 not null COMMENT '任务超时中断时间(分钟)',
clientip VARCHAR(30) default '127.0.0.1' not null COMMENT '版本ID',
primary key (id)
)default character set utf8;
create table TEST_CASEDETAIL
(
id int(10) not null AUTO_INCREMENT,
taskid int(10) not null,
caseno VARCHAR(20) not null COMMENT '用例编号',
caseversion VARCHAR(20) not null COMMENT '用例版本',
casetime datetime not null COMMENT '执行时间',
casename VARCHAR(200) not null COMMENT '用例名称',
casestatus VARCHAR(2) default '4' not null COMMENT ' pass:0 fail:1 lock:2 unexcute:4',
primary key (id)
)default character set utf8;
create table TEST_LOGDETAIL
(
logid int(10) not null AUTO_INCREMENT,
logtime datetime not null COMMENT '日志时间',
detail VARCHAR(5000) not null COMMENT '日志', /*V1.1 扩展日志明细字段到2000*/
loggrade VARCHAR(20) COMMENT '日志级别',
caseid int(10) not null COMMENT '用例编号',
taskid int(10),
step VARCHAR(20) COMMENT '用例步骤',
imgname VARCHAR(30) COMMENT 'UI自动化自动截图地址',
primary key (logid)
)default character set utf8;
create table TEST_TASKEXCUTE
(
id int(10) not null AUTO_INCREMENT,
taskid VARCHAR(150) not null,
casetotal_count int(10) COMMENT '总用例数',
casesucc_count int(10) COMMENT '成功数',
casefail_count int(10) COMMENT '失败数',
caselock_count int(10) COMMENT '锁定数',
createtime datetime COMMENT '时间',
jobid int(10) not null,
finishtime datetime COMMENT '完成时间',
taskstatus VARCHAR(2) default '' COMMENT '状态 0未执行 1执行中 2 成功 4失败 ',
casenoexec_count int default 0 COMMENT '未执行用例',
caseisexec VARCHAR(2) COMMENT '任务是否被成功吊起 0 成功吊起 3 吊起失败',
primary key (id)
)default character set utf8;
create table USERINFO
(
id int(8) not null AUTO_INCREMENT,
usercode VARCHAR(20) not null,
password VARCHAR(200) not null,
username VARCHAR(20),
role VARCHAR(100) COMMENT '角色',
sectorid int(8) default 0 not null COMMENT '所属部门',
primary key (id)
)default character set utf8;
create table USER_AUTHORITY
(
id int(9) not null AUTO_INCREMENT,
module VARCHAR(50) not null COMMENT '模块',
auth_type VARCHAR(50) not null COMMENT '权限类型',
alias VARCHAR(50) not null COMMENT '别名',
primary key (id)
)default character set utf8;
create table USER_ROLE
(
id int(9) not null AUTO_INCREMENT,
role VARCHAR(50) not null COMMENT '角色',
permission VARCHAR(1000) COMMENT '权限',
primary key (id)
)default character set utf8;
/*插入索引
CREATE INDEX index_caseid ON TEST_LOGDETAIL (caseid);
CREATE INDEX index_taskid ON TEST_CASEDETAIL (taskid);*/
/*插入权限默认定义*/
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (1, '质量-版本信息', '增加', 'pv_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (2, '质量-版本信息', '删除', 'pv_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (3, '质量-版本信息', '修改', 'pv_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (4, '质量-版本计划信息', '增加', 'pvp_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (5, '质量-流程检查信息', '增加', 'fc_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (6, '质量-流程检查信息', '删除', 'fc_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (7, '质量-流程检查信息', '修改', 'fc_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (8, '质量-生产故障信息', '增加', 'acc_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (9, '质量-生产故障信息', '删除', 'acc_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (10, '质量-生产故障信息', '修改', 'acc_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (21, '自动化-任务调度', '启动', 'tast_run');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (22, '自动化-任务调度', '移除', 'tast_remove');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (23, '自动化-任务调度', '执行', 'tast_ex');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (24, '自动化-任务调度', '增加', 'tast_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (25, '自动化-任务调度', '删除', 'tast_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (26, '自动化-任务调度', '修改', 'tast_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (27, '自动化-任务调度', '上传', 'tast_upload');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (11, '质量-流程检查计划', '增加', 'pfc_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (12, '质量-流程检查计划', '删除', 'pfc_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (13, '质量-流程检查计划', '修改', 'pfc_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (14, '质量-流程检查计划', '转计划', 'fc_tocheck');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (15, '质量-评审信息详情', '增加', 'revinfo_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (16, '质量-评审信息详情', '删除', 'revinfo_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (17, '质量-评审信息详情', '修改', 'revinfo_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (18, '质量-评审信息', '删除', 'rev_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (19, '质量-评审信息', '修改', 'rev_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (20, '质量-生产故障信息', '上传', 'acc_upload');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (41, '用户管理', '增加', 'ui_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (42, '用户管理', '删除', 'ui_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (43, '用户管理', '修改', 'ui_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (44, '用户管理', '查看', 'ui_4');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (45, '用户管理-权限角色', '查看修改', 'role_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (28, '自动化-任务列表', '删除', 'tastex_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (29, '自动化-用例列表', '执行', 'case_ex');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (46, '用户管理-权限角色', '增加', 'role_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (47, '用户管理-权限角色', '删除', 'role_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (48, '项目管理', '增加', 'pro_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (49, '项目管理', '删除', 'pro_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (50, '项目管理', '修改', 'pro_3');
/*插入角色默认定义*/
insert into USER_ROLE (id, role, permission)
values (2, '测试工程师', 'acc_1,acc_2,acc_3,');
insert into USER_ROLE (id, role, permission)
values (3, '自动化工程师', 'acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,');
insert into USER_ROLE (id, role, permission)
values (4, '质量工程师', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,');
insert into USER_ROLE (id, role, permission)
values (1, '管理员', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,ui_1,ui_2,ui_3,ui_4,role_3,role_1,role_2,');
/*插入默认部门分级*/
insert into QA_SECONDARYSECTOR (sectorid, departmenthead, departmentname)
values (99, '系统管理员', '总部');
/*插入默认项目*/
insert into QA_SECTORPROJECTS (projectid, projectname, projectmanager, sectorid, projecttype)
values (99, '全部项目/未知项目', '系统管理员', 99, 0);
/*插入默认管理员*/
insert into USERINFO (id, usercode, password, username, role, sectorid)
values (1, 'admin', 'uJ45aIeS9N80kaSFDjvk%2FA%3D%3D', '系统管理员', '1', 99);
/*插入流程检查定义数据*/
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (36, 5, '总结阶段', 2, '计划变更', 1, '如与计划不合,是否提交计划变更邮件', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (37, 5, '总结阶段', 3, '代码质量', 1, 'sonar代码检查是否刷新构建', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (38, 5, '总结阶段', 3, '代码质量', 2, 'sonar代码问题数是否符合要求', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (35, 2, '开发阶段', 3, '开发与编码', 6, '是否每一条禅道开发任务都提交转测申请', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (34, 4, '验收与上线', 2, '上线部署', 3, 'SVN代码是否提交并标注', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (1, 1, '需求阶段', 1, '需求编制', 1, '《产品需求说明书》是否组织评审会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (2, 1, '需求阶段', 1, '需求编制', 2, '《产品需求说明书》评审是否通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (3, 1, '需求阶段', 1, '需求编制', 3, '《产品需求说明书》是否归档到SVN', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (4, 1, '需求阶段', 1, '需求编制', 4, '《产品需求说明书》评审记录表是否签字通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (5, 2, '开发阶段', 1, '需求分解', 1, '是否有需求分解/任务讨论会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (6, 2, '开发阶段', 1, '需求分解', 2, '《项目计划》邮件是否及时发出', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (7, 2, '开发阶段', 1, '需求分解', 3, '《项目计划》邮件内容是否完整', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (10, 2, '开发阶段', 2, '软件设计', 1, '《产品开发概要设计》是否组织评审会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (11, 2, '开发阶段', 2, '软件设计', 2, '《产品开发概要设计》评审是否通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (12, 2, '开发阶段', 2, '软件设计', 3, '《产品开发概要设计》是否归档到SVN', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (13, 2, '开发阶段', 2, '软件设计', 4, '《产品开发概要设计》评审记录表是否签字通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (14, 2, '开发阶段', 3, '开发与编码', 1, '是否进行每日晨会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (15, 2, '开发阶段', 3, '开发与编码', 2, '是否进行代码走读', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (16, 2, '开发阶段', 3, '开发与编码', 3, '是否每一条禅道开发任务都提交转测申请', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (17, 2, '开发阶段', 3, '开发与编码', 4, '转测邮件是否合格', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (18, 2, '开发阶段', 3, '开发与编码', 5, '转测邮件打回次数为0', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (19, 3, '测试阶段', 1, '软件测试', 1, '是否回复测试计划', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (20, 3, '测试阶段', 1, '软件测试', 2, '是否回复测试用例', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (21, 3, '测试阶段', 1, '软件测试', 3, '测试用例是否通过评审/确认', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (22, 3, '测试阶段', 1, '软件测试', 4, '《软件测试报告》是否组织评审会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (23, 3, '测试阶段', 1, '软件测试', 5, '《软件测试报告》是否评审通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (24, 3, '测试阶段', 1, '软件测试', 6, '《软件测试报告》/测试结果是否发出邮件', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (25, 3, '测试阶段', 1, '软件测试', 7, '《软件测试报告》评审记录表是否签字通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (26, 4, '验收与上线', 1, '产品验收', 1, '《产品验收报告》是否组织评审会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (27, 4, '验收与上线', 1, '产品验收', 2, '《产品验收报告》是否评审通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (28, 4, '验收与上线', 1, '产品验收', 3, '《产品验收报告》是否归档到SVN', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (29, 4, '验收与上线', 1, '产品验收', 4, '《产品验收报告》评审记录表是否签字通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (30, 4, '验收与上线', 2, '上线部署', 1, '产品/开发是否提交上线流程OA', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (31, 4, '验收与上线', 2, '上线部署', 2, '开发是否提交上线相关资料', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (32, 5, '总结阶段', 1, '项目总结', 1, '《项目总结》邮件是否及时发出', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (33, 5, '总结阶段', 1, '项目总结', 2, '《项目总结》邮件内容是否完整', null);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,708 @@
create table OPERATION_LOG
(
id int(9) not null AUTO_INCREMENT,
tablename VARCHAR(30) not null COMMENT '被记录日志表名',
tableid int(8) not null COMMENT '被记录日志ID',
operation_time VARCHAR(30) not null COMMENT '操作时间',
operationer VARCHAR(20) not null COMMENT '操作人员',
operation_description VARCHAR(200) not null COMMENT '描述',
projectid int(8) COMMENT '项目ID',
primary key (ID)
)default character set utf8;
create table QA_ACCIDENT
(
id int(8) not null AUTO_INCREMENT,
projectid int(8) not null COMMENT '项目ID',
accstatus VARCHAR(80) not null COMMENT '事故状态',
eventtime VARCHAR(30) COMMENT '事故发生时间',
reporter VARCHAR(20) not null COMMENT '报告人',
reporttime VARCHAR(30) not null COMMENT '事故报告时间',
accdescription VARCHAR(500) not null COMMENT '事故描述',
acclevel VARCHAR(60) not null COMMENT '事故等级',
causalanalysis VARCHAR(500) COMMENT '原因分析',
causaltype VARCHAR(100) COMMENT '原因类型',
consequenceanalysis VARCHAR(300) COMMENT '后果分析',
correctiveaction VARCHAR(300) COMMENT '纠正措施',
resolutiontime VARCHAR(30) COMMENT '解决时间',
resolutioner VARCHAR(20) COMMENT '解决处理人',
preventiveaction VARCHAR(300) COMMENT '预防措施',
preventiver VARCHAR(20) COMMENT '预防措施责任人',
preventiveplandate VARCHAR(30) COMMENT '预防措施计划完成时间',
preventiveaccdate VARCHAR(30) COMMENT '预防措施实际完成时间',
trouble_duration int(8) COMMENT '事故持续时间',
impact_time int(8),
filename VARCHAR(100) COMMENT '附件路径',
primary key (ID)
)default character set utf8;
create table QA_FLOWCHECK
(
id int(10) not null AUTO_INCREMENT,
checkid int(10) not null COMMENT '检查id',
projectid int(10) not null COMMENT '项目id',
projectphase VARCHAR(20) not null COMMENT '项目阶段',
phasenode VARCHAR(50) not null COMMENT '阶段节点',
checkentry VARCHAR(100) not null COMMENT '检查内容',
checkresult VARCHAR(20) COMMENT '检查结果',
checkdate VARCHAR(20) COMMENT '检查日期',
checkdescriptions VARCHAR(400) COMMENT '不符合项描述',
stateupdate VARCHAR(20) COMMENT '状态更新',
updatedate VARCHAR(20) COMMENT '更新日期',
remark VARCHAR(200) COMMENT '备注',
versionnum VARCHAR(30) COMMENT '版本号',
primary key (ID)
)default character set utf8;
create table QA_FLOWINFO
(
id int(10) not null AUTO_INCREMENT,
phaseid int(10) not null,
phasename VARCHAR(20) not null,
phasenodeid int(10) not null,
phasenodename VARCHAR(20) not null,
checkentryid int(10) not null,
checkentry VARCHAR(200) not null,
remark VARCHAR(100),
primary key (ID)
)default character set utf8;
create table QA_PLANFLOWCHECK
(
id int(8) not null AUTO_INCREMENT,
projectid int(8) not null COMMENT '项目ID',
versionnum VARCHAR(30) COMMENT '版本号',
checkentryid VARCHAR(20) not null COMMENT '检查ID',
plandate VARCHAR(20) not null COMMENT '计划检查日期',
status int(4) not null COMMENT '计划状态1 检查计划 2 已检查',
primary key (ID)
)default character set utf8;
create table QA_PROJECTVERSION
(
versionid int(10) not null AUTO_INCREMENT,
versionnumber VARCHAR(20) COMMENT '版本号',
plan_launchdate VARCHAR(20) COMMENT '计划上线日期',
actually_launchdate VARCHAR(20) COMMENT '实际上线日期',
plan_devstart VARCHAR(20) COMMENT '计划开发开始时间',
plan_devend VARCHAR(20) COMMENT '计划开发结束时间',
actually_devstart VARCHAR(20) COMMENT '实际开发开始时间',
actually_devend VARCHAR(20) COMMENT '实际开发结束时间',
plan_teststart VARCHAR(20) COMMENT '计划测试开始时间',
plan_testend VARCHAR(20) COMMENT '计划测试结束时间',
actually_teststart VARCHAR(20) COMMENT '实际测试开始时间',
actually_testend VARCHAR(20) COMMENT '实际测试结束时间',
plan_demand int(10) COMMENT '计划上线需求数',
actually_demand int(10) COMMENT '实际上线需求数',
codeline FLOAT(10) COMMENT '代码变动行数',
testcasenum int(10) COMMENT '测试用例数',
changetestingreturn int(10) COMMENT '版本转测试打回次数',
dev_member VARCHAR(50) COMMENT '开发投入人力',
test_member VARCHAR(50) COMMENT '测试投入人力',
human_cost VARCHAR(20) COMMENT '耗费人力 人/天',
per_dev VARCHAR(20) COMMENT '开发平均生产率 人/天/行',
per_test VARCHAR(20) COMMENT '用例编写/用例执行',
code_di VARCHAR(20) COMMENT '代码DI值',
qualityreview VARCHAR(500) COMMENT '质量回溯',
imprint VARCHAR(500) COMMENT '版本说明',
remark VARCHAR(500) COMMENT '备注',
projectid int(10) COMMENT '项目ID',
devtime_deviation VARCHAR(20) COMMENT '开发偏移率',
devdelay_days VARCHAR(20) COMMENT '开发延迟时间',
testtime_deviation VARCHAR(20) COMMENT '测试偏移率',
testdelay_days VARCHAR(20) COMMENT '测试延迟时间',
protime_deviation VARCHAR(20),
prodelay_days VARCHAR(20),
bug_zm int(10),
bug_yz int(10),
bug_yb int(10),
bug_ts int(10),
versiontype int(8) default 1 not null COMMENT '版本类型',
perdemand FLOAT(8) default 0.00,
codestandard_zd int(10) default 0 not null,
codestandard_yz int(10) default 0 not null,
codestandard_zy int(10) default 0 not null,
zt_versionlink VARCHAR(100) COMMENT '禅道链接',
human_costdev VARCHAR(20) default '0' COMMENT '开发人力成本',
human_costtest VARCHAR(20) default '0' COMMENT '测试人力成本',
primary key (versionid)
)default character set utf8;
create table QA_REVIEW
(
id int(8) not null AUTO_INCREMENT,
projectid int(8) not null COMMENT '项目ID',
version VARCHAR(20) not null COMMENT '版本号',
review_type VARCHAR(20) COMMENT '评审类型',
review_date VARCHAR(20) COMMENT '评审日期',
bug_num int(8) COMMENT '问题数',
repair_num int(8) COMMENT '已修复问题数',
confirm_date VARCHAR(20) COMMENT '最后确认日期',
review_object VARCHAR(100) COMMENT '评审对象',
review_result VARCHAR(50) COMMENT '评审结果',
result_confirmor VARCHAR(50) COMMENT '结果确认人',
remark VARCHAR(500) COMMENT '备注',
primary key (id)
)default character set utf8;
create table QA_REVIEWINFO
(
id int(8) not null AUTO_INCREMENT,
review_id int(8) not null COMMENT '评审ID',
bug_description VARCHAR(500) COMMENT '问题描述',
status VARCHAR(20) COMMENT '状态',
duty_officer VARCHAR(100) COMMENT '责任人',
confirm_date VARCHAR(20) COMMENT '最后确认日期',
corrective VARCHAR(500) COMMENT '纠正措施',
primary key (id)
)default character set utf8;
create table QA_SECONDARYSECTOR
(
sectorid int(10) not null AUTO_INCREMENT,
departmenthead VARCHAR(20),
departmentname VARCHAR(20),
primary key (sectorid)
)default character set utf8;
create table QA_SECTORPROJECTS
(
projectid int(10) not null AUTO_INCREMENT,
projectname VARCHAR(100) not null,
projectmanager VARCHAR(100) not null,
sectorid int(10) not null,
projecttype int(4) default 0 not null,
projectsign VARCHAR(20) default 'sign' not null,
primary key (projectid)
)default character set utf8;
create table QA_ZTTASK
(
id int(8) not null AUTO_INCREMENT,
versionid int(8) COMMENT '版本ID',
versionname VARCHAR(100) COMMENT '版本名称',
taskname VARCHAR(300) COMMENT '任务名称',
assigneddate VARCHAR(50) COMMENT '完成时间',
estimate int(8) COMMENT '预期工时',
consumed int(8) COMMENT '实际工时',
finishedby VARCHAR(40) COMMENT '完成人账号',
finishedname VARCHAR(40) COMMENT '完成人姓名',
deadline VARCHAR(40) COMMENT '计划截止日期',
delaystatus int(4) COMMENT '延期状态',
primary key (id)
)default character set utf8;
create table TEST_JOBS
(
id int(10) not null AUTO_INCREMENT,
name VARCHAR(100) not null COMMENT '调度名称',
startdate VARCHAR(100) COMMENT '开始日期',
starttime VARCHAR(100) COMMENT '开始时间',
enddate VARCHAR(100) COMMENT '结束日期',
endtime VARCHAR(100) COMMENT '结束时间',
runtime datetime COMMENT '执行时间',
remark VARCHAR(800) COMMENT '备注',
planproj VARCHAR(100) COMMENT '项目名testlink',
state VARCHAR(4) not null COMMENT '状态',
tasktype VARCHAR(4) not null COMMENT '执行类型 O执行一次 D每天执行',
starttimestr VARCHAR(100) COMMENT '执行时间表达式',
endtimestr VARCHAR(100) COMMENT '结束时间',
createtime datetime not null,
noenddate VARCHAR(10) COMMENT '是否有结束日期',
time int default 0,
timetype VARCHAR(4),
issendmail VARCHAR(4) default "0" COMMENT '是否发送邮件通知',
emailer VARCHAR(250) COMMENT '邮件地址',
threadcount int default 1 COMMENT '客户端线程数(接口)',
testlinkname VARCHAR(200) COMMENT 'TESTLINK中的计划名称',
isbuilding VARCHAR(4) default '0' not null COMMENT '是否自动构建',
buildname VARCHAR(100) COMMENT '构建链接',
isrestart VARCHAR(4) default '0' not null COMMENT '是否自动重启',
restartcomm VARCHAR(200) COMMENT '重启脚本',
extype int(4) default 0 not null COMMENT '执行类型',
browsertype int(4) COMMENT 'UI自动化浏览器类型',
timeout int(8) default 60 not null COMMENT '任务超时中断时间(分钟)',
clientip VARCHAR(30) default '127.0.0.1' not null COMMENT '版本ID',
clientpath VARCHAR(100) COMMENT '客户端测试驱动桩路径',
projecttype int(4) default "0" COMMENT '项目类型 系统内项目 0 testlink 1',
projectid int(8) COMMENT '系统内项目ID',
planid int(8) COMMENT '系统内项目关联测试计划ID',
primary key (id)
)default character set utf8;
create table TEST_CASEDETAIL
(
id int(10) not null AUTO_INCREMENT,
taskid int(10) not null,
caseno VARCHAR(20) not null COMMENT '用例编号',
caseversion VARCHAR(20) not null COMMENT '用例版本',
casetime datetime not null COMMENT '执行时间',
casename VARCHAR(200) not null COMMENT '用例名称',
casestatus VARCHAR(2) default '4' not null COMMENT ' pass:0 fail:1 lock:2 unexcute:4',
primary key (id)
)default character set utf8;
create table TEST_LOGDETAIL
(
logid int(10) not null AUTO_INCREMENT,
logtime datetime not null COMMENT '日志时间',
detail VARCHAR(5000) not null COMMENT '日志', /*V1.1 扩展日志明细字段到2000*/
loggrade VARCHAR(20) COMMENT '日志级别',
caseid int(10) not null COMMENT '用例编号',
taskid int(10),
step VARCHAR(20) COMMENT '用例步骤',
imgname VARCHAR(30) COMMENT 'UI自动化自动截图地址',
primary key (logid)
)default character set utf8;
create table TEST_TASKEXCUTE
(
id int(10) not null AUTO_INCREMENT,
taskid VARCHAR(150) not null,
casetotal_count int(10) COMMENT '总用例数',
casesucc_count int(10) COMMENT '成功数',
casefail_count int(10) COMMENT '失败数',
caselock_count int(10) COMMENT '锁定数',
createtime datetime COMMENT '时间',
jobid int(10) not null,
finishtime datetime COMMENT '完成时间',
taskstatus VARCHAR(2) default '' COMMENT '状态 0未执行 1执行中 2 成功 4失败 ',
casenoexec_count int default 0 COMMENT '未执行用例',
caseisexec VARCHAR(2) COMMENT '任务是否被成功吊起 0 成功吊起 3 吊起失败',
primary key (id)
)default character set utf8;
create table USERINFO
(
id int(8) not null AUTO_INCREMENT,
usercode VARCHAR(20) not null,
password VARCHAR(200) not null,
username VARCHAR(20),
role VARCHAR(100) COMMENT '角色',
sectorid int(8) default 0 not null COMMENT '所属部门',
projectid int(4) default 0 not null COMMENT '默认选择项目',
primary key (id)
)default character set utf8;
create table USER_AUTHORITY
(
id int(9) not null AUTO_INCREMENT,
module VARCHAR(50) not null COMMENT '模块',
auth_type VARCHAR(50) not null COMMENT '权限类型',
alias VARCHAR(50) not null COMMENT '别名',
primary key (id)
)default character set utf8;
create table USER_ROLE
(
id int(9) not null AUTO_INCREMENT,
role VARCHAR(50) not null COMMENT '角色',
permission VARCHAR(1000) COMMENT '权限',
opprojectid VARCHAR(200) COMMENT '可操作的项目',
primary key (id)
)default character set utf8;
create table TEST_CLIENT
(
id int(8) not null AUTO_INCREMENT,
clientip VARCHAR(30) not null COMMENT '客户端IP',
name VARCHAR(30) not null COMMENT '客户端名称',
projectper VARCHAR(200) COMMENT '使用项目',
status int(2) COMMENT '客户端超时 0 正常 1 链接失败 2 状态未知',
checkinterval int(6) not null COMMENT '检查客户端状态心跳间隔时间 单位:秒',
clientpath VARCHAR(100) COMMENT '客户端测试驱动桩路径 多个;做分隔';
remark VARCHAR(100) COMMENT '备注',
primary key (id)
)default character set utf8;
/*用例管理模块*/
create table PROJECT_CASE
(
id int(8) not null AUTO_INCREMENT,
sign VARCHAR(20) not null COMMENT '用例标识',
name VARCHAR(200) not null COMMENT '用例名称',
projectid int(8) not null COMMENT '关联项目ID',
moduleid int(8) not null COMMENT '关联项目模块ID',
projectindex int(8) not null COMMENT '项目用例编号',
time VARCHAR(30) COMMENT '最后更新时间',
operationer VARCHAR(20) COMMENT '最后更新人员',
casetype int(2) not null COMMENT '0 接口 1 UI',
remark VARCHAR(200) COMMENT '备注',
primary key (ID)
)default character set utf8;
create table PROJECT_CASESTEPS
(
id int(8) not null AUTO_INCREMENT,
path VARCHAR(100) COMMENT '包路径|定位路径',
operation VARCHAR(100) COMMENT '方法名|操作',
parameters VARCHAR(500) COMMENT '参数',
action VARCHAR(50) COMMENT '步骤动作',
caseid int(8) not null COMMENT '用例ID',
stepnum int(2) not null COMMENT '步骤编号',
expectedresult VARCHAR(2000) COMMENT '预期结果',
projectid int(8) not null COMMENT '项目ID',
steptype int(2) not null COMMENT '0 接口 1 UI',
time VARCHAR(30) COMMENT '最后更新时间',
operationer VARCHAR(20) COMMENT '最后更新人员',
remark VARCHAR(200) COMMENT '备注',
primary key (ID)
)default character set utf8;
create table PROJECT_PLAN
(
id int(9) not null AUTO_INCREMENT,
name VARCHAR(50) not null COMMENT '测试计划名称',
casecount int(8) COMMENT '计划中用例总数',
remark VARCHAR(200) COMMENT '备注',
projectid int(8) not null COMMENT '项目ID',
time VARCHAR(30) COMMENT '最后更新时间',
operationer VARCHAR(20) COMMENT '最后更新人员',
primary key (ID)
)default character set utf8;
create table PROJECT_PLANCASE
(
id int(9) not null AUTO_INCREMENT,
caseid int(8) not null COMMENT '用例ID',
planid int(8) not null COMMENT '项目计划ID',
priority int(8) not null COMMENT '用例优先级',
primary key (ID),
index (caseid),
index (planid)
)default character set utf8;
create table PROJECT_MODULE
(
id int(9) not null AUTO_INCREMENT,
projectid int(8) not null COMMENT '项目ID',
modulename VARCHAR(50) COMMENT '模块名字',
pid int(4) COMMENT '层级关系',
primary key (ID)
)default character set utf8;
create table PROJECT_PROTOCOLTEMPLATE
(
id int(8) not null AUTO_INCREMENT,
projectid int(8) not null COMMENT '项目ID',
name VARCHAR(50) not null COMMENT '模板名称',
protocoltype VARCHAR(20) not null COMMENT '协议类型',
contentencoding VARCHAR(20) not null COMMENT '编码格式',
time VARCHAR(30) COMMENT '最后更新时间',
operationer VARCHAR(20) COMMENT '最后更新人员',
remark VARCHAR(200) COMMENT '备注',
primary key (ID)
)default character set utf8;
create table PROJECT_TEMPLATEPARAMS
(
id int(9) not null AUTO_INCREMENT,
templateid int(8) not null COMMENT '模块ID',
paramname VARCHAR(50) not null COMMENT '参数名',
param VARCHAR(2000) COMMENT '参数默认值',
primary key (ID)
)default character set utf8;
create table PROJECT_CASESTEPSPARAMS
(
id int(8) not null AUTO_INCREMENT,
steptype int(2) not null COMMENT '步骤类型',
parentid int(8) not null COMMENT '父节点ID',
fieldname VARCHAR(50) COMMENT '所属字段名',
paramvalue VARCHAR(200) COMMENT '参数值',
description VARCHAR(50) COMMENT '描述',
primary key (ID)
)default character set utf8;
create table TEMP_CASESTEPDEBUG
(
id int(8) not null AUTO_INCREMENT,
sign VARCHAR(20) not null COMMENT '用例标识',
executor VARCHAR(20) not null COMMENT '执行人',
loglevel VARCHAR(10) not null COMMENT '日志级别',
detail VARCHAR(5000) not null COMMENT '日志', /*V1.1 扩展日志明细字段到2000*/
primary key (ID)
)default character set utf8;
/*插入索引
CREATE INDEX index_caseid ON TEST_LOGDETAIL (caseid);
CREATE INDEX index_taskid ON TEST_CASEDETAIL (taskid);*/
/*插入权限默认定义*/
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (1, '质量-版本信息', '增加', 'pv_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (2, '质量-版本信息', '删除', 'pv_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (3, '质量-版本信息', '修改', 'pv_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (4, '质量-版本计划信息', '增加', 'pvp_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (5, '质量-流程检查信息', '增加', 'fc_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (6, '质量-流程检查信息', '删除', 'fc_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (7, '质量-流程检查信息', '修改', 'fc_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (8, '质量-生产故障信息', '增加', 'acc_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (9, '质量-生产故障信息', '删除', 'acc_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (10, '质量-生产故障信息', '修改', 'acc_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (21, '自动化-任务调度', '启动', 'tast_run');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (22, '自动化-任务调度', '移除', 'tast_remove');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (23, '自动化-任务调度', '执行', 'tast_ex');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (24, '自动化-任务调度', '增加', 'tast_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (25, '自动化-任务调度', '删除', 'tast_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (26, '自动化-任务调度', '修改', 'tast_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (27, '自动化-任务调度', '上传', 'tast_upload');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (11, '质量-流程检查计划', '增加', 'pfc_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (12, '质量-流程检查计划', '删除', 'pfc_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (13, '质量-流程检查计划', '修改', 'pfc_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (14, '质量-流程检查计划', '转计划', 'fc_tocheck');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (15, '质量-评审信息详情', '增加', 'revinfo_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (16, '质量-评审信息详情', '删除', 'revinfo_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (17, '质量-评审信息详情', '修改', 'revinfo_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (18, '质量-评审信息', '删除', 'rev_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (19, '质量-评审信息', '修改', 'rev_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (20, '质量-生产故障信息', '上传', 'acc_upload');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (41, '用户管理', '增加', 'ui_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (42, '用户管理', '删除', 'ui_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (43, '用户管理', '修改', 'ui_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (44, '用户管理', '查看', 'ui_4');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (45, '用户管理-权限角色', '查看修改', 'role_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (28, '自动化-任务列表', '删除', 'tastex_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (29, '自动化-用例列表', '执行', 'case_ex');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (46, '用户管理-权限角色', '增加', 'role_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (47, '用户管理-权限角色', '删除', 'role_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (48, '项目管理', '增加', 'pro_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (49, '项目管理', '删除', 'pro_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (50, '项目管理', '修改', 'pro_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (51, '用例管理', '增加', 'case_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (52, '用例管理', '删除', 'case_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (53, '用例管理', '修改', 'case_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (54, '步骤管理', '增删改查', 'case_step');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (55, '测试计划管理', '增加', 'proplan_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (56, '测试计划管理', '删除', 'proplan_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (57, '测试计划管理', '修改', 'proplan_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (58, '部门管理', '增加', 'dpmt_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (59, '部门管理', '删除', 'dpmt_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (60, '部门管理', '修改', 'dpmt_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (61, '协议模板', '增加', 'ptct_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (62, '协议模板', '删除', 'ptct_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (63, '协议模板', '修改', 'ptct_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (64, '客户端管理', '增加', 'client_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (65, '客户端管理', '删除', 'client_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (66, '客户端管理', '修改', 'client_3');
/*插入步骤界面定义各个字段的默认值*/
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (1, 2, 0, 'operation','HttpURLPost','使用HttpURLConnection发送post请求');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (2, 2, 0, 'operation','URLPost','使用URLConnection发送post');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (3, 2, 0, 'operation','GetAndSaveFile','发送get请求保存下载文件到客户端');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (4, 2, 0, 'operation','HttpURLGet','使用HttpURLConnection发送get请求');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (5, 2, 0, 'operation','URLGet','使用URLConnection发送get请求');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (6, 2, 0, 'operation','HttpClientPost','使用HttpClient发送post请求');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (7, 2, 0, 'operation','HttpClientGet','使用HttpClient发送get请求');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (8, 3, 0, 'operation','SocketPost','使用socket发送post请求');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (9, 3, 0, 'operation','SocketGet','使用socket发送get请求');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (10, 1, 0, 'operation','click','点击对象');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (11, 1, 0, 'operation','sendkeys','输入');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (12, 1, 0, 'operation','clear','清除输入框');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (13, 1, 0, 'operation','gotoframe','跳转框架iframe');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (14, 1, 0, 'operation','isenabled','判断对象是否可用');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (15, 1, 0, 'operation','isdisplayed','判断对象是否可见');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (16, 1, 0, 'operation','exjsob','针对对象执行JS脚本');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (17, 1, 0, 'operation','gettext','获取对象文本属性');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (18, 1, 0, 'operation','gettagname','获取对象标签类型');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (19, 1, 0, 'operation','getcaptcha','获取对象中的验证码(识别率较低)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (20, 1, 0, 'operation','selectbyvisibletext','通过下拉框的文本进行选择');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (21, 1, 0, 'operation','selectbyvalue','通过下拉框的VALUE属性进行选择');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (22, 1, 0, 'operation','selectbyindex','通过下拉框的index属性进行选择(从0开始)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (23, 1, 0, 'operation','isselect','判断是否已经被选择,同用于单选\复选框');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (24, 1, 0, 'operation','open','打开URL');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (25, 1, 0, 'operation','exjs','执行js脚本');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (26, 1, 0, 'operation','gotodefaultcontent','跳转回到默认iframe');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (27, 1, 0, 'operation','gettitle','获取窗口标题');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (28, 1, 0, 'operation','getwindowhandle','获取窗口句柄');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (29, 1, 0, 'operation','gotowindow','跳转窗口句柄');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (30, 1, 0, 'operation','wait','等待时间(S)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (31, 1, 0, 'operation','alertaccept','弹出框点击OK');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (32, 1, 0, 'operation','alertdismiss','弹出框点击取消');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (33, 1, 0, 'operation','alertgettext','获取弹出框TEXT');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (34, 1, 0, 'operation','mouselkclick','模拟鼠标左键单击(可带页面对象)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (35, 1, 0, 'operation','mouserkclick','模拟鼠标右键单击(可带页面对象)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (36, 1, 0, 'operation','mousedclick','模拟鼠标双击(可带页面对象)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (37, 1, 0, 'operation','mouseclickhold','模拟鼠标左键单击后不释放(可带页面对象)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (38, 1, 0, 'operation','mousedrag','模拟鼠标拖拽(可带页面对象)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (39, 1, 0, 'operation','mouseto','模拟鼠标移动到指定坐标(可带页面对象)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (40, 1, 0, 'operation','mouserelease','模拟鼠标释放(可带页面对象)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (41, 1, 0, 'operation','mousekey(tab)','模拟键盘Tab键');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (42, 1, 0, 'operation','mousekey(space)','模拟键盘Space键');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (43, 1, 0, 'operation','mousekey(ctrl)','模拟键盘Ctrl键');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (44, 1, 0, 'operation','mousekey(shift)','模拟键盘Shift键');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (45, 1, 0, 'operation','mousekey(enter)','模拟键盘Enter键');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (46, 1, 0, 'operation','runcase','调用指定接口用例');
/*插入角色默认定义*/
insert into USER_ROLE (id, role, permission)
values (2, '测试工程师', 'acc_1,acc_2,acc_3,');
insert into USER_ROLE (id, role, permission)
values (3, '自动化工程师', 'acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,');
insert into USER_ROLE (id, role, permission)
values (4, '质量工程师', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,');
insert into USER_ROLE (id, role, permission)
values (1, '管理员', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,ui_1,ui_2,ui_3,ui_4,role_3,role_1,role_2,pro_1,pro_2,pro_3,case_1,case_2,case_3,case_step,proplan_1,proplan_2,proplan_3,dpmt_1,dpmt_2,dpmt_3,ptct_1,ptct_2,ptct_3,client_1,client_2,client_3,');
/*插入默认部门分级*/
insert into QA_SECONDARYSECTOR (sectorid, departmenthead, departmentname)
values (99, '系统管理员', '总部');
/*插入默认项目*/
insert into QA_SECTORPROJECTS (projectid, projectname, projectmanager, sectorid, projecttype)
values (99, '全部项目/未知项目', '系统管理员', 99, 0);
/*插入默认管理员*/
insert into USERINFO (id, usercode, password, username, role, sectorid)
values (1, 'admin', 'uJ45aIeS9N80kaSFDjvk%2FA%3D%3D', '系统管理员', '1', 99);
/*插入流程检查定义数据*/
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (36, 5, '总结阶段', 2, '计划变更', 1, '如与计划不合,是否提交计划变更邮件', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (37, 5, '总结阶段', 3, '代码质量', 1, 'sonar代码检查是否刷新构建', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (38, 5, '总结阶段', 3, '代码质量', 2, 'sonar代码问题数是否符合要求', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (35, 2, '开发阶段', 3, '开发与编码', 6, '是否每一条禅道开发任务都提交转测申请', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (34, 4, '验收与上线', 2, '上线部署', 3, 'SVN代码是否提交并标注', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (1, 1, '需求阶段', 1, '需求编制', 1, '《产品需求说明书》是否组织评审会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (2, 1, '需求阶段', 1, '需求编制', 2, '《产品需求说明书》评审是否通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (3, 1, '需求阶段', 1, '需求编制', 3, '《产品需求说明书》是否归档到SVN', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (4, 1, '需求阶段', 1, '需求编制', 4, '《产品需求说明书》评审记录表是否签字通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (5, 2, '开发阶段', 1, '需求分解', 1, '是否有需求分解/任务讨论会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (6, 2, '开发阶段', 1, '需求分解', 2, '《项目计划》邮件是否及时发出', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (7, 2, '开发阶段', 1, '需求分解', 3, '《项目计划》邮件内容是否完整', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (10, 2, '开发阶段', 2, '软件设计', 1, '《产品开发概要设计》是否组织评审会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (11, 2, '开发阶段', 2, '软件设计', 2, '《产品开发概要设计》评审是否通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (12, 2, '开发阶段', 2, '软件设计', 3, '《产品开发概要设计》是否归档到SVN', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (13, 2, '开发阶段', 2, '软件设计', 4, '《产品开发概要设计》评审记录表是否签字通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (14, 2, '开发阶段', 3, '开发与编码', 1, '是否进行每日晨会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (15, 2, '开发阶段', 3, '开发与编码', 2, '是否进行代码走读', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (16, 2, '开发阶段', 3, '开发与编码', 3, '是否每一条禅道开发任务都提交转测申请', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (17, 2, '开发阶段', 3, '开发与编码', 4, '转测邮件是否合格', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (18, 2, '开发阶段', 3, '开发与编码', 5, '转测邮件打回次数为0', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (19, 3, '测试阶段', 1, '软件测试', 1, '是否回复测试计划', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (20, 3, '测试阶段', 1, '软件测试', 2, '是否回复测试用例', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (21, 3, '测试阶段', 1, '软件测试', 3, '测试用例是否通过评审/确认', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (22, 3, '测试阶段', 1, '软件测试', 4, '《软件测试报告》是否组织评审会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (23, 3, '测试阶段', 1, '软件测试', 5, '《软件测试报告》是否评审通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (24, 3, '测试阶段', 1, '软件测试', 6, '《软件测试报告》/测试结果是否发出邮件', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (25, 3, '测试阶段', 1, '软件测试', 7, '《软件测试报告》评审记录表是否签字通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (26, 4, '验收与上线', 1, '产品验收', 1, '《产品验收报告》是否组织评审会', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (27, 4, '验收与上线', 1, '产品验收', 2, '《产品验收报告》是否评审通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (28, 4, '验收与上线', 1, '产品验收', 3, '《产品验收报告》是否归档到SVN', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (29, 4, '验收与上线', 1, '产品验收', 4, '《产品验收报告》评审记录表是否签字通过', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (30, 4, '验收与上线', 2, '上线部署', 1, '产品/开发是否提交上线流程OA', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (31, 4, '验收与上线', 2, '上线部署', 2, '开发是否提交上线相关资料', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (32, 5, '总结阶段', 1, '项目总结', 1, '《项目总结》邮件是否及时发出', null);
insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark)
values (33, 5, '总结阶段', 1, '项目总结', 2, '《项目总结》邮件内容是否完整', null);

View File

@ -1,9 +1,9 @@
/*扩展日志明细字段到5000*/
alter table test_logdetail modify column detail varchar(5000);
/*添加项目管理的权限控制*/
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (48, '项目管理', '增加', 'pro_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (49, '项目管理', '删除', 'pro_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
/*扩展日志明细字段到5000*/
alter table test_logdetail modify column detail varchar(5000);
/*添加项目管理的权限控制*/
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (48, '项目管理', '增加', 'pro_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (49, '项目管理', '删除', 'pro_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (50, '项目管理', '修改', 'pro_3');

View File

@ -1,88 +1,88 @@
create table PROJECT_CASE
(
id int(8) not null AUTO_INCREMENT,
sign VARCHAR(20) not null COMMENT '用例标识',
name VARCHAR(200) not null COMMENT '用例名称',
projectid int(8) not null COMMENT '关联项目ID',
moduleid int(8) not null COMMENT '关联项目模块ID',
projectindex int(8) not null COMMENT '项目用例编号',
time VARCHAR(30) COMMENT '最后更新时间',
operationer VARCHAR(20) COMMENT '最后更新人员',
casetype int(2) not null COMMENT '0 接口 1 UI',
remark VARCHAR(200) COMMENT '备注',
primary key (ID)
)default character set utf8;
create table PROJECT_CASESTEPS
(
id int(8) not null AUTO_INCREMENT,
path VARCHAR(100) COMMENT '包路径|定位路径',
operation VARCHAR(100) COMMENT '方法名|操作',
parameters VARCHAR(500) COMMENT '参数',
action VARCHAR(50) COMMENT '步骤动作',
caseid int(8) not null COMMENT '用例ID',
stepnum int(2) not null COMMENT '步骤编号',
expectedresult VARCHAR(2000) COMMENT '预期结果',
projectid int(8) not null COMMENT '项目ID',
steptype int(2) not null COMMENT '0 接口 1 UI',
time VARCHAR(30) COMMENT '最后更新时间',
operationer VARCHAR(20) COMMENT '最后更新人员',
remark VARCHAR(200) COMMENT '备注',
primary key (ID)
)default character set utf8;
create table PROJECT_PLAN
(
id int(9) not null AUTO_INCREMENT,
name VARCHAR(50) not null COMMENT '测试计划名称',
casecount int(8) COMMENT '计划中用例总数',
remark VARCHAR(200) COMMENT '备注',
projectid int(8) not null COMMENT '项目ID',
time VARCHAR(30) COMMENT '最后更新时间',
operationer VARCHAR(20) COMMENT '最后更新人员',
primary key (ID)
)default character set utf8;
create table PROJECT_PLANCASE
(
id int(9) not null AUTO_INCREMENT,
caseid int(8) not null COMMENT '用例ID',
planid int(8) not null COMMENT '项目计划ID',
priority int(8) not null COMMENT '用例优先级',
primary key (ID),
index (caseid),
index (planid)
)default character set utf8;
create table PROJECT_MODULE
(
id int(9) not null AUTO_INCREMENT,
projectid int(8) not null COMMENT '项目ID',
modulename VARCHAR(50) COMMENT '模块名字',
pid int(4) COMMENT '层级关系',
primary key (ID)
)default character set utf8;
/*用户增加默认选择字段*/
alter table userinfo add projectid int(4) default '0';
/*项目管理表增加项目标识字段*/
alter table QA_SECTORPROJECTS add projectsign VARCHAR(20) default 'sign' not null;
/*调度任务配置增加三个支持内部项目字段*/
alter table TEST_JOBS add projecttype int(8) default '0' COMMENT '项目类型 0 testlink 1 系统内项目';
alter table TEST_JOBS add projectid int(8) COMMENT '系统内项目ID';
alter table TEST_JOBS add planid int(8) COMMENT '系统内项目关联测试计划ID';
/*增加权限标识*/
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (51, '用例管理', '增加', 'case_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (52, '用例管理', '删除', 'case_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (53, '用例管理', '修改', 'case_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (54, '步骤管理', '增删改查', 'case_step');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (55, '测试计划管理', '增加', 'proplan_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (56, '测试计划管理', '删除', 'proplan_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
create table PROJECT_CASE
(
id int(8) not null AUTO_INCREMENT,
sign VARCHAR(20) not null COMMENT '用例标识',
name VARCHAR(200) not null COMMENT '用例名称',
projectid int(8) not null COMMENT '关联项目ID',
moduleid int(8) not null COMMENT '关联项目模块ID',
projectindex int(8) not null COMMENT '项目用例编号',
time VARCHAR(30) COMMENT '最后更新时间',
operationer VARCHAR(20) COMMENT '最后更新人员',
casetype int(2) not null COMMENT '0 接口 1 UI',
remark VARCHAR(200) COMMENT '备注',
primary key (ID)
)default character set utf8;
create table PROJECT_CASESTEPS
(
id int(8) not null AUTO_INCREMENT,
path VARCHAR(100) COMMENT '包路径|定位路径',
operation VARCHAR(100) COMMENT '方法名|操作',
parameters VARCHAR(500) COMMENT '参数',
action VARCHAR(50) COMMENT '步骤动作',
caseid int(8) not null COMMENT '用例ID',
stepnum int(2) not null COMMENT '步骤编号',
expectedresult VARCHAR(2000) COMMENT '预期结果',
projectid int(8) not null COMMENT '项目ID',
steptype int(2) not null COMMENT '0 接口 1 UI',
time VARCHAR(30) COMMENT '最后更新时间',
operationer VARCHAR(20) COMMENT '最后更新人员',
remark VARCHAR(200) COMMENT '备注',
primary key (ID)
)default character set utf8;
create table PROJECT_PLAN
(
id int(9) not null AUTO_INCREMENT,
name VARCHAR(50) not null COMMENT '测试计划名称',
casecount int(8) COMMENT '计划中用例总数',
remark VARCHAR(200) COMMENT '备注',
projectid int(8) not null COMMENT '项目ID',
time VARCHAR(30) COMMENT '最后更新时间',
operationer VARCHAR(20) COMMENT '最后更新人员',
primary key (ID)
)default character set utf8;
create table PROJECT_PLANCASE
(
id int(9) not null AUTO_INCREMENT,
caseid int(8) not null COMMENT '用例ID',
planid int(8) not null COMMENT '项目计划ID',
priority int(8) not null COMMENT '用例优先级',
primary key (ID),
index (caseid),
index (planid)
)default character set utf8;
create table PROJECT_MODULE
(
id int(9) not null AUTO_INCREMENT,
projectid int(8) not null COMMENT '项目ID',
modulename VARCHAR(50) COMMENT '模块名字',
pid int(4) COMMENT '层级关系',
primary key (ID)
)default character set utf8;
/*用户增加默认选择字段*/
alter table userinfo add projectid int(4) default '0';
/*项目管理表增加项目标识字段*/
alter table QA_SECTORPROJECTS add projectsign VARCHAR(20) default 'sign' not null;
/*调度任务配置增加三个支持内部项目字段*/
alter table TEST_JOBS add projecttype int(8) default '0' COMMENT '项目类型 0 testlink 1 系统内项目';
alter table TEST_JOBS add projectid int(8) COMMENT '系统内项目ID';
alter table TEST_JOBS add planid int(8) COMMENT '系统内项目关联测试计划ID';
/*增加权限标识*/
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (51, '用例管理', '增加', 'case_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (52, '用例管理', '删除', 'case_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (53, '用例管理', '修改', 'case_3');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (54, '步骤管理', '增删改查', 'case_step');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (55, '测试计划管理', '增加', 'proplan_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (56, '测试计划管理', '删除', 'proplan_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (57, '测试计划管理', '修改', 'proplan_3');

View File

@ -1,7 +1,7 @@
/*插入部门管理权限*/
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (58, '部门管理', '增加', 'dpmt_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (59, '部门管理', '删除', 'dpmt_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
/*插入部门管理权限*/
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (58, '部门管理', '增加', 'dpmt_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (59, '部门管理', '删除', 'dpmt_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (60, '部门管理', '修改', 'dpmt_3');

View File

@ -1,146 +1,146 @@
/*增加支持协议模板表*/
create table PROJECT_PROTOCOLTEMPLATE
(
id int(8) not null AUTO_INCREMENT,
projectid int(8) not null COMMENT '项目ID',
name VARCHAR(50) not null COMMENT '模板名称',
protocoltype VARCHAR(20) not null COMMENT '协议类型',
contentencoding VARCHAR(20) not null COMMENT '编码格式',
connecttimeout int(8) not null COMMENT '超时时间',
time VARCHAR(30) COMMENT '最后更新时间',
operationer VARCHAR(20) COMMENT '最后更新人员',
remark VARCHAR(200) COMMENT '备注',
primary key (ID)
)default character set utf8;
create table PROJECT_TEMPLATEPARAMS
(
id int(9) not null AUTO_INCREMENT,
templateid int(8) not null COMMENT '模块ID',
paramname VARCHAR(50) not null COMMENT '参数名',
param VARCHAR(2000) COMMENT '参数默认值',
primary key (ID)
)default character set utf8;
create table PROJECT_CASESTEPSPARAMS
(
id int(8) not null AUTO_INCREMENT,
steptype int(2) not null COMMENT '步骤类型',
parentid int(8) not null COMMENT '父节点ID',
fieldname VARCHAR(50) COMMENT '所属字段名',
paramvalue VARCHAR(200) COMMENT '参数值',
description VARCHAR(50) COMMENT '描述',
primary key (ID)
)default character set utf8;
create table TEMP_CASESTEPDEBUG
(
id int(8) not null AUTO_INCREMENT,
sign VARCHAR(20) not null COMMENT '用例标识',
executor VARCHAR(20) not null COMMENT '执行人',
loglevel VARCHAR(10) not null COMMENT '日志级别',
detail VARCHAR(5000) not null COMMENT '日志',
primary key (ID)
)default character set utf8;
/*插入部门管理权限*/
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (61, '协议模板', '增加', 'ptct_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (62, '协议模板', '删除', 'ptct_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (63, '协议模板', '修改', 'ptct_3');
/*插入步骤界面定义各个字段的默认值*/
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (1, 2, 0, 'operation','HttpURLPost','使用HttpURLConnection发送post请求');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (2, 2, 0, 'operation','URLPost','使用URLConnection发送post');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (3, 2, 0, 'operation','GetAndSaveFile','发送get请求保存下载文件到客户端');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (4, 2, 0, 'operation','HttpURLGet','使用HttpURLConnection发送get请求');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (5, 2, 0, 'operation','URLGet','使用URLConnection发送get请求');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (6, 2, 0, 'operation','HttpClientPost','使用HttpClient发送post请求');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (7, 2, 0, 'operation','HttpClientGet','使用HttpClient发送get请求');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (8, 3, 0, 'operation','SocketPost','使用socket发送post请求');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (9, 3, 0, 'operation','SocketGet','使用socket发送get请求');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (10, 1, 0, 'operation','click','点击对象');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (11, 1, 0, 'operation','sendkeys','输入');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (12, 1, 0, 'operation','clear','清除输入框');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (13, 1, 0, 'operation','gotoframe','跳转框架iframe');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (14, 1, 0, 'operation','isenabled','判断对象是否可用');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (15, 1, 0, 'operation','isdisplayed','判断对象是否可见');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (16, 1, 0, 'operation','exjsob','针对对象执行JS脚本');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (17, 1, 0, 'operation','gettext','获取对象文本属性');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (18, 1, 0, 'operation','gettagname','获取对象标签类型');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (19, 1, 0, 'operation','getcaptcha','获取对象中的验证码(识别率较低)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (20, 1, 0, 'operation','selectbyvisibletext','通过下拉框的文本进行选择');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (21, 1, 0, 'operation','selectbyvalue','通过下拉框的VALUE属性进行选择');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (22, 1, 0, 'operation','selectbyindex','通过下拉框的index属性进行选择(从0开始)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (23, 1, 0, 'operation','isselect','判断是否已经被选择,同用于单选\复选框');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (24, 1, 0, 'operation','open','打开URL');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (25, 1, 0, 'operation','exjs','执行js脚本');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (26, 1, 0, 'operation','gotodefaultcontent','跳转回到默认iframe');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (27, 1, 0, 'operation','gettitle','获取窗口标题');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (28, 1, 0, 'operation','getwindowhandle','获取窗口句柄');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (29, 1, 0, 'operation','gotowindow','跳转窗口句柄');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (30, 1, 0, 'operation','wait','等待时间(S)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (31, 1, 0, 'operation','alertaccept','弹出框点击OK');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (32, 1, 0, 'operation','alertdismiss','弹出框点击取消');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (33, 1, 0, 'operation','alertgettext','获取弹出框TEXT');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (34, 1, 0, 'operation','mouselkclick','模拟鼠标左键单击(可带页面对象)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (35, 1, 0, 'operation','mouserkclick','模拟鼠标右键单击(可带页面对象)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (36, 1, 0, 'operation','mousedclick','模拟鼠标双击(可带页面对象)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (37, 1, 0, 'operation','mouseclickhold','模拟鼠标左键单击后不释放(可带页面对象)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (38, 1, 0, 'operation','mousedrag','模拟鼠标拖拽(可带页面对象)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (39, 1, 0, 'operation','mouseto','模拟鼠标移动到指定坐标(可带页面对象)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (40, 1, 0, 'operation','mouserelease','模拟鼠标释放(可带页面对象)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (41, 1, 0, 'operation','mousekey(tab)','模拟键盘Tab键');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (42, 1, 0, 'operation','mousekey(space)','模拟键盘Space键');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (43, 1, 0, 'operation','mousekey(ctrl)','模拟键盘Ctrl键');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (44, 1, 0, 'operation','mousekey(shift)','模拟键盘Shift键');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (45, 1, 0, 'operation','mousekey(enter)','模拟键盘Enter键');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
/*增加支持协议模板表*/
create table PROJECT_PROTOCOLTEMPLATE
(
id int(8) not null AUTO_INCREMENT,
projectid int(8) not null COMMENT '项目ID',
name VARCHAR(50) not null COMMENT '模板名称',
protocoltype VARCHAR(20) not null COMMENT '协议类型',
contentencoding VARCHAR(20) not null COMMENT '编码格式',
connecttimeout int(8) not null COMMENT '超时时间',
time VARCHAR(30) COMMENT '最后更新时间',
operationer VARCHAR(20) COMMENT '最后更新人员',
remark VARCHAR(200) COMMENT '备注',
primary key (ID)
)default character set utf8;
create table PROJECT_TEMPLATEPARAMS
(
id int(9) not null AUTO_INCREMENT,
templateid int(8) not null COMMENT '模块ID',
paramname VARCHAR(50) not null COMMENT '参数名',
param VARCHAR(2000) COMMENT '参数默认值',
primary key (ID)
)default character set utf8;
create table PROJECT_CASESTEPSPARAMS
(
id int(8) not null AUTO_INCREMENT,
steptype int(2) not null COMMENT '步骤类型',
parentid int(8) not null COMMENT '父节点ID',
fieldname VARCHAR(50) COMMENT '所属字段名',
paramvalue VARCHAR(200) COMMENT '参数值',
description VARCHAR(50) COMMENT '描述',
primary key (ID)
)default character set utf8;
create table TEMP_CASESTEPDEBUG
(
id int(8) not null AUTO_INCREMENT,
sign VARCHAR(20) not null COMMENT '用例标识',
executor VARCHAR(20) not null COMMENT '执行人',
loglevel VARCHAR(10) not null COMMENT '日志级别',
detail VARCHAR(5000) not null COMMENT '日志',
primary key (ID)
)default character set utf8;
/*插入部门管理权限*/
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (61, '协议模板', '增加', 'ptct_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (62, '协议模板', '删除', 'ptct_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (63, '协议模板', '修改', 'ptct_3');
/*插入步骤界面定义各个字段的默认值*/
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (1, 2, 0, 'operation','HttpURLPost','使用HttpURLConnection发送post请求');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (2, 2, 0, 'operation','URLPost','使用URLConnection发送post');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (3, 2, 0, 'operation','GetAndSaveFile','发送get请求保存下载文件到客户端');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (4, 2, 0, 'operation','HttpURLGet','使用HttpURLConnection发送get请求');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (5, 2, 0, 'operation','URLGet','使用URLConnection发送get请求');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (6, 2, 0, 'operation','HttpClientPost','使用HttpClient发送post请求');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (7, 2, 0, 'operation','HttpClientGet','使用HttpClient发送get请求');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (8, 3, 0, 'operation','SocketPost','使用socket发送post请求');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (9, 3, 0, 'operation','SocketGet','使用socket发送get请求');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (10, 1, 0, 'operation','click','点击对象');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (11, 1, 0, 'operation','sendkeys','输入');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (12, 1, 0, 'operation','clear','清除输入框');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (13, 1, 0, 'operation','gotoframe','跳转框架iframe');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (14, 1, 0, 'operation','isenabled','判断对象是否可用');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (15, 1, 0, 'operation','isdisplayed','判断对象是否可见');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (16, 1, 0, 'operation','exjsob','针对对象执行JS脚本');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (17, 1, 0, 'operation','gettext','获取对象文本属性');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (18, 1, 0, 'operation','gettagname','获取对象标签类型');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (19, 1, 0, 'operation','getcaptcha','获取对象中的验证码(识别率较低)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (20, 1, 0, 'operation','selectbyvisibletext','通过下拉框的文本进行选择');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (21, 1, 0, 'operation','selectbyvalue','通过下拉框的VALUE属性进行选择');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (22, 1, 0, 'operation','selectbyindex','通过下拉框的index属性进行选择(从0开始)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (23, 1, 0, 'operation','isselect','判断是否已经被选择,同用于单选\复选框');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (24, 1, 0, 'operation','open','打开URL');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (25, 1, 0, 'operation','exjs','执行js脚本');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (26, 1, 0, 'operation','gotodefaultcontent','跳转回到默认iframe');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (27, 1, 0, 'operation','gettitle','获取窗口标题');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (28, 1, 0, 'operation','getwindowhandle','获取窗口句柄');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (29, 1, 0, 'operation','gotowindow','跳转窗口句柄');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (30, 1, 0, 'operation','wait','等待时间(S)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (31, 1, 0, 'operation','alertaccept','弹出框点击OK');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (32, 1, 0, 'operation','alertdismiss','弹出框点击取消');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (33, 1, 0, 'operation','alertgettext','获取弹出框TEXT');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (34, 1, 0, 'operation','mouselkclick','模拟鼠标左键单击(可带页面对象)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (35, 1, 0, 'operation','mouserkclick','模拟鼠标右键单击(可带页面对象)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (36, 1, 0, 'operation','mousedclick','模拟鼠标双击(可带页面对象)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (37, 1, 0, 'operation','mouseclickhold','模拟鼠标左键单击后不释放(可带页面对象)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (38, 1, 0, 'operation','mousedrag','模拟鼠标拖拽(可带页面对象)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (39, 1, 0, 'operation','mouseto','模拟鼠标移动到指定坐标(可带页面对象)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (40, 1, 0, 'operation','mouserelease','模拟鼠标释放(可带页面对象)');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (41, 1, 0, 'operation','mousekey(tab)','模拟键盘Tab键');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (42, 1, 0, 'operation','mousekey(space)','模拟键盘Space键');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (43, 1, 0, 'operation','mousekey(ctrl)','模拟键盘Ctrl键');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (44, 1, 0, 'operation','mousekey(shift)','模拟键盘Shift键');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (45, 1, 0, 'operation','mousekey(enter)','模拟键盘Enter键');
insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description)
values (46, 1, 0, 'operation','runcase','调用指定接口用例');

View File

@ -1,21 +1,21 @@
/*创建客户端IP管理表*/
create table TEST_CLIENT
(
id int(8) not null AUTO_INCREMENT,
clientip VARCHAR(30) not null COMMENT '客户端IP',
name VARCHAR(30) not null COMMENT '客户端名称',
projectper VARCHAR(200) COMMENT '使用项目',
status int(2) COMMENT '客户端超时 0 正常 1 链接失败 2 状态未知',
checkinterval int(6) not null COMMENT '检查客户端状态心跳间隔时间 单位:秒',
remark VARCHAR(100) COMMENT '备注',
primary key (id)
)default character set utf8;
/*角色权限表增加操作项目权限字段*/
alter table USER_ROLE add opprojectid VARCHAR(200);
/*增加客户端操作相关权限*/
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (64, '客户端管理', '增加', 'client_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (65, '客户端管理', '删除', 'client_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
/*创建客户端IP管理表*/
create table TEST_CLIENT
(
id int(8) not null AUTO_INCREMENT,
clientip VARCHAR(30) not null COMMENT '客户端IP',
name VARCHAR(30) not null COMMENT '客户端名称',
projectper VARCHAR(200) COMMENT '使用项目',
status int(2) COMMENT '客户端超时 0 正常 1 链接失败 2 状态未知',
checkinterval int(6) not null COMMENT '检查客户端状态心跳间隔时间 单位:秒',
remark VARCHAR(100) COMMENT '备注',
primary key (id)
)default character set utf8;
/*角色权限表增加操作项目权限字段*/
alter table USER_ROLE add opprojectid VARCHAR(200);
/*增加客户端操作相关权限*/
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (64, '客户端管理', '增加', 'client_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (65, '客户端管理', '删除', 'client_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (66, '客户端管理', '修改', 'client_3');

View File

@ -0,0 +1,4 @@
/*调度表增加客户端load驱动桩路径字段*/
alter table TEST_JOBS add clientpath VARCHAR(100) COMMENT '客户端测试驱动桩路径';
/*调度表增加客户端load驱动桩路径字段*/
alter table TEST_CLIENT add clientpath VARCHAR(100) COMMENT '客户端测试驱动桩路径 多个;做分隔';

728
pom.xml
View File

@ -1,364 +1,364 @@
<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.seagull</groupId>
<artifactId>LuckyFrameServer</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>LuckyFrameServer Maven Webapp</name>
<url>http://maven.apache.org</url>
<build>
<finalName>LuckyFrameServer</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</build>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<version>2.7.7</version>
</dependency>
<dependency>
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.8.10</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.4.0.Final</version>
</dependency>
<dependency>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.1.2</version>
</dependency>
<!-- <dependency>
<groupId>commons-attributes</groupId>
<artifactId>commons-attributes-api</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>commons-attributes</groupId>
<artifactId>commons-attributes-compiler</artifactId>
<version>2.2</version>
</dependency> -->
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.3</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>commons-digester</groupId>
<artifactId>commons-digester</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>commons-discovery</groupId>
<artifactId>commons-discovery</artifactId>
<version>0.5</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>ejb3-persistence</artifactId>
<version>3.3.2.Beta1</version>
</dependency>
<dependency>
<groupId>net.sf.ezmorph</groupId>
<artifactId>ezmorph</artifactId>
<version>1.0.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-hibernate3</artifactId>
<version>2.0.8</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.5.6-Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator-annotation-processor</artifactId>
<version>5.3.4.Final</version>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.21.0-GA</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.5</version>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>1.8.6</version>
</dependency>
<dependency>
<groupId>opensymphony</groupId>
<artifactId>quartz-all</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz-commonj</artifactId>
<version>1.8.6</version>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz-oracle</artifactId>
<version>1.8.6</version>
</dependency>
<dependency>
<groupId>org.w3c.css</groupId>
<artifactId>sac</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.22</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.22</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-instrument</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-instrument-tomcat</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-struts</artifactId>
<version>3.2.18.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.1.0.Final</version>
</dependency>
</dependencies>
</project>
<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.seagull</groupId>
<artifactId>LuckyFrameServer</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>LuckyFrameServer Maven Webapp</name>
<url>http://maven.apache.org</url>
<build>
<finalName>LuckyFrameServer</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</build>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<version>2.7.7</version>
</dependency>
<dependency>
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.8.10</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.4.0.Final</version>
</dependency>
<dependency>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.1.2</version>
</dependency>
<!-- <dependency>
<groupId>commons-attributes</groupId>
<artifactId>commons-attributes-api</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>commons-attributes</groupId>
<artifactId>commons-attributes-compiler</artifactId>
<version>2.2</version>
</dependency> -->
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.3</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>commons-digester</groupId>
<artifactId>commons-digester</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>commons-discovery</groupId>
<artifactId>commons-discovery</artifactId>
<version>0.5</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>ejb3-persistence</artifactId>
<version>3.3.2.Beta1</version>
</dependency>
<dependency>
<groupId>net.sf.ezmorph</groupId>
<artifactId>ezmorph</artifactId>
<version>1.0.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-hibernate3</artifactId>
<version>2.0.8</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.5.6-Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator-annotation-processor</artifactId>
<version>5.3.4.Final</version>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.21.0-GA</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.5</version>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>1.8.6</version>
</dependency>
<dependency>
<groupId>opensymphony</groupId>
<artifactId>quartz-all</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz-commonj</artifactId>
<version>1.8.6</version>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz-oracle</artifactId>
<version>1.8.6</version>
</dependency>
<dependency>
<groupId>org.w3c.css</groupId>
<artifactId>sac</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.22</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.22</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-instrument</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-instrument-tomcat</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-struts</artifactId>
<version>3.2.18.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.1.0.Final</version>
</dependency>
</dependencies>
</project>

View File

@ -1,82 +1,82 @@
package luckyweb.seagull.comm;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import org.apache.log4j.Logger;
import org.hibernate.Session;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.SchedulerFactory;
import org.springframework.web.context.ContextLoaderListener;
import luckyweb.seagull.spring.dao.TestJobsDaoImpl;
import luckyweb.seagull.spring.entity.SectorProjects;
import luckyweb.seagull.spring.entity.TestClient;
import luckyweb.seagull.spring.entity.TestJobs;
import luckyweb.seagull.util.HibernateSessionFactoryUtil;
public class QueueListener extends ContextLoaderListener implements
ServletContextListener {
private static final Logger log = Logger.getLogger(QueueListener.class);
public static List<TestJobs> list = new ArrayList<TestJobs>();
public static List<SectorProjects> projlist = new ArrayList<SectorProjects>();
public static List<SectorProjects> qa_projlist = new ArrayList<SectorProjects>();
public static List<TestClient> listen_Clientlist = new ArrayList<TestClient>();
public static Session session = HibernateSessionFactoryUtil.getCurrentSession();
public static SchedulerFactory gSchedulerFactory = null;
public static Scheduler sched = null;
public static String JOB_GROUP_NAME = "EXTJWEB_JOBGROUP_NAME";
public static String TRIGGER_GROUP_NAME = "EXTJWEB_TRIGGERGROUP_NAME";
@Override
public void contextInitialized(ServletContextEvent arg0) {
// Session session=HibernateSessionFactoryUtil.getCurrentSession();
// 加载定时任务tomcat启动时则启动
try {
TestJobsDaoImpl.init(session);
log.info("服务器启动时则启动,加载定时任务");
} catch (Exception e) {
log.error(" 服务启动异常 " + e);
try {
HibernateSessionFactoryUtil.closeSession();
} catch (Exception e1) {
log.error(" 关闭sessionFactory 异常 " + e);
}
}
}
@Override
public void contextDestroyed(ServletContextEvent arg0) {
// 服务关闭时定时任务关闭
try {
if (QueueListener.sched.isStarted()) {
QueueListener.sched.shutdown();
Thread.sleep(1000);
}
} catch (SchedulerException | InterruptedException e2) {
e2.printStackTrace();
}
try {
TestJobsDaoImpl.stop(session);
log.info(" 服务关闭时,定时任务关闭");
} catch (Exception e) {
log.error(" 服务关闭异常 " + e);
}
}
}
package luckyweb.seagull.comm;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import org.apache.log4j.Logger;
import org.hibernate.Session;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.SchedulerFactory;
import org.springframework.web.context.ContextLoaderListener;
import luckyweb.seagull.spring.dao.TestJobsDaoImpl;
import luckyweb.seagull.spring.entity.SectorProjects;
import luckyweb.seagull.spring.entity.TestClient;
import luckyweb.seagull.spring.entity.TestJobs;
import luckyweb.seagull.util.HibernateSessionFactoryUtil;
public class QueueListener extends ContextLoaderListener implements
ServletContextListener {
private static final Logger log = Logger.getLogger(QueueListener.class);
public static List<TestJobs> list = new ArrayList<TestJobs>();
public static List<SectorProjects> projlist = new ArrayList<SectorProjects>();
public static List<SectorProjects> qa_projlist = new ArrayList<SectorProjects>();
public static List<TestClient> listen_Clientlist = new ArrayList<TestClient>();
public static Session session = HibernateSessionFactoryUtil.getCurrentSession();
public static SchedulerFactory gSchedulerFactory = null;
public static Scheduler sched = null;
public static String JOB_GROUP_NAME = "EXTJWEB_JOBGROUP_NAME";
public static String TRIGGER_GROUP_NAME = "EXTJWEB_TRIGGERGROUP_NAME";
@Override
public void contextInitialized(ServletContextEvent arg0) {
// Session session=HibernateSessionFactoryUtil.getCurrentSession();
// 加载定时任务tomcat启动时则启动
try {
TestJobsDaoImpl.init(session);
log.info("服务器启动时则启动,加载定时任务");
} catch (Exception e) {
log.error(" 服务启动异常 " + e);
try {
HibernateSessionFactoryUtil.closeSession();
} catch (Exception e1) {
log.error(" 关闭sessionFactory 异常 " + e);
}
}
}
@Override
public void contextDestroyed(ServletContextEvent arg0) {
// 服务关闭时定时任务关闭
try {
if (QueueListener.sched.isStarted()) {
QueueListener.sched.shutdown();
Thread.sleep(1000);
}
} catch (SchedulerException | InterruptedException e2) {
e2.printStackTrace();
}
try {
TestJobsDaoImpl.stop(session);
log.info(" 服务关闭时,定时任务关闭");
} catch (Exception e) {
log.error(" 服务关闭异常 " + e);
}
}
}

View File

@ -1,242 +1,242 @@
package luckyweb.seagull.quartz;
import java.io.IOException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.text.SimpleDateFormat;
import javax.annotation.Resource;
import org.apache.log4j.Logger;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import luckyweb.seagull.comm.QueueListener;
import luckyweb.seagull.spring.entity.TestClient;
import luckyweb.seagull.spring.entity.TestJobs;
import luckyweb.seagull.spring.entity.TestTaskexcute;
import luckyweb.seagull.spring.service.TestJobsService;
import luckyweb.seagull.spring.service.TestTastExcuteService;
import luckyweb.seagull.util.DateUtil;
import luckyweb.seagull.util.HibernateSessionFactoryUtil;
import luckyweb.seagull.util.StrLib;
import rmi.model.RunBatchCaseEntity;
import rmi.model.RunCaseEntity;
import rmi.model.RunTaskEntity;
import rmi.service.RunService;
public class QuartzJob implements Job {
private static final Logger log = Logger.getLogger(QuartzJob.class);
@Resource(name = "tastExcuteService")
private TestTastExcuteService tastExcuteService;
@Resource(name = "testJobsService")
private TestJobsService testJobsService;
public static Session session = HibernateSessionFactoryUtil.getCurrentSession();
@Override
public void execute(JobExecutionContext context)
throws JobExecutionException {
try {
String name = context.getJobDetail().getName();
if(name.indexOf("*JOB")>-1){
TestJobs job = new TestJobs();
String id=name.substring(0,name.indexOf("*JOB"));
System.out.println("执行命令中。。。");
for (int i = 0; i < QueueListener.list.size(); i++) {
job = QueueListener.list.get(i);
if (id.equals("" + job.getId())) {
break;
}else{
job=null;
}
}
if(null!=job){
toRunTask(job.getPlanproj(), job.getId(),job.getTaskName(),job.getClientip(),job.getClientpath());
System.out.println("调用程序结束。。。");
}else{
System.out.println("没有定时任务需要启动。。。");
}
}else if(name.indexOf("*CLIENT")>-1){
TestClient tc = new TestClient();
String id=name.substring(0,name.indexOf("*CLIENT"));
for (int i = 0; i < QueueListener.listen_Clientlist.size(); i++) {
tc = QueueListener.listen_Clientlist.get(i);
if (id.equals("" + tc.getId())) {
if(null!=tc){
String clientip=tc.getClientip();
try{
//调用远程对象注意RMI路径与接口必须与服务器配置一致
RunService service=(RunService)Naming.lookup("rmi://"+clientip+":6633/RunService");
String result=service.getClientStatus();
if("success".equals(result)){
if(tc.getStatus()!=0){
tc.setStatus(0);
QueueListener.listen_Clientlist.set(i, tc);
Query query = session.createQuery("update TestClient t set t.status =0 where id="+tc.getId());
query.executeUpdate();
}
}else{
if(tc.getStatus()!=1){
tc.setStatus(1);
QueueListener.listen_Clientlist.set(i, tc);
Query query = session.createQuery("update TestClient t set t.status =1 where id="+tc.getId());
query.executeUpdate();
}
}
}catch (RemoteException e) {
if(tc.getStatus()!=1){
tc.setStatus(1);
QueueListener.listen_Clientlist.set(i, tc);
Query query = session.createQuery("update TestClient t set t.status =1 where id="+tc.getId());
query.executeUpdate();
}
break;
}
}
break;
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
public String toRunTask(String projname,int jobId,String jobname,String clientip,String loadpath){
Session s = null;
Transaction tx = null;
//System.out.println(tastId);
String tastName = "";
String time = new SimpleDateFormat("yyyyMMddHHmmss").format(new java.util.Date().getTime());
tastName =""+jobname+ "】_"+time;
TestTaskexcute task=add(tastName, jobId, s, tx);
projname = projname.replaceAll(" ","\" \""); //防止计划名称或是项目名称带了空格符号,在run.exec中会执行出错
String result="启动失败!";
try{
//调用远程对象注意RMI路径与接口必须与服务器配置一致
RunService service=(RunService)Naming.lookup("rmi://"+clientip+":6633/RunService");
RunTaskEntity tasken = new RunTaskEntity();
tasken.setProjectname(projname);
tasken.setTaskid(String.valueOf(task.getId()));
if(StrLib.isEmpty(loadpath)){
loadpath="/TestDriven";
}
result=service.runtask(tasken,loadpath);
System.out.println(result);
return result;
}catch (Exception e) {
execFail(s, tx,task.getId(),jobId,tastName);
e.printStackTrace();
return result;
}
}
public String toRunCase(String projname,int tastId,String caseName,String casVersion,String clientip,String loadpath) {
String result="启动失败!";
try{
//调用远程对象注意RMI路径与接口必须与服务器配置一致
RunService service=(RunService)Naming.lookup("rmi://"+clientip+":6633/RunService");
RunCaseEntity onecase = new RunCaseEntity();
onecase.setProjectname(projname);
onecase.setTaskid(String.valueOf(tastId));
onecase.setTestCaseExternalId(caseName);
onecase.setVersion(casVersion);
if(StrLib.isEmpty(loadpath)){
loadpath="/TestDriven";
}
result=service.runcase(onecase,loadpath);
System.out.println(result);
return result;
} catch (Exception e) {
e.printStackTrace();
return result;
}
}
public String toRunCaseBatch(String projname,int taskid,String caseInfo,String clientip,String loadpath) {
String result="启动失败!";
try{
//调用远程对象注意RMI路径与接口必须与服务器配置一致
RunService service=(RunService)Naming.lookup("rmi://"+clientip+":6633/RunService");
RunBatchCaseEntity batchcase = new RunBatchCaseEntity();
batchcase.setProjectname(projname);
batchcase.setTaskid(String.valueOf(taskid));
batchcase.setBatchcase(caseInfo);
if(StrLib.isEmpty(loadpath)){
loadpath="/TestDriven";
}
result=service.runbatchcase(batchcase,loadpath);
System.out.println(result);
return result;
} catch (Exception e) {
e.printStackTrace();
return result;
}
}
/**
* 加入 testJobs表
* @param tastId
* @param name
* @param jobId
* @param s
* @param tx
*/
private TestTaskexcute add(String tastName,int jobId,Session s,Transaction tx){
TestTaskexcute tast = new TestTaskexcute();
try {
tast.getTestJob().setId(jobId);
tast.setTaskId(tastName);
tast.setCaseIsExec("0");
tast.setTaskStatus("0");
tast.setCreateTime(DateUtil.now());
s = HibernateSessionFactoryUtil.openSession();
tx = s.beginTransaction();
s.save(tast);
System.out.println("tastId:"+tast.getId());
tx.commit();
} catch (Exception e) {
tx.rollback();
e.printStackTrace();
} finally {
s.close();
}
return tast;
}
private void execFail(Session s,Transaction tx,int id,int jobId,String tastId){
//执行失败时,写入任务表记录为执行失败
TestTaskexcute tast = new TestTaskexcute();
s = HibernateSessionFactoryUtil.openSession();
tx = s.beginTransaction();
tast=(TestTaskexcute) s.load(TestTaskexcute.class, id);
tast.setTaskStatus("3");
tast.setJobid(jobId);
tast.setTaskId(tastId);
tast.setCaseIsExec("1");
tast.setTaskStatus("3");
s.update(tast);
tx.commit();
s.close();
}
public static void main(String[] args) throws IOException {
}
}
package luckyweb.seagull.quartz;
import java.io.IOException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.text.SimpleDateFormat;
import javax.annotation.Resource;
import org.apache.log4j.Logger;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import luckyweb.seagull.comm.QueueListener;
import luckyweb.seagull.spring.entity.TestClient;
import luckyweb.seagull.spring.entity.TestJobs;
import luckyweb.seagull.spring.entity.TestTaskexcute;
import luckyweb.seagull.spring.service.TestJobsService;
import luckyweb.seagull.spring.service.TestTastExcuteService;
import luckyweb.seagull.util.DateUtil;
import luckyweb.seagull.util.HibernateSessionFactoryUtil;
import luckyweb.seagull.util.StrLib;
import rmi.model.RunBatchCaseEntity;
import rmi.model.RunCaseEntity;
import rmi.model.RunTaskEntity;
import rmi.service.RunService;
public class QuartzJob implements Job {
private static final Logger log = Logger.getLogger(QuartzJob.class);
@Resource(name = "tastExcuteService")
private TestTastExcuteService tastExcuteService;
@Resource(name = "testJobsService")
private TestJobsService testJobsService;
public static Session session = HibernateSessionFactoryUtil.getCurrentSession();
@Override
public void execute(JobExecutionContext context)
throws JobExecutionException {
try {
String name = context.getJobDetail().getName();
if(name.indexOf("*JOB")>-1){
TestJobs job = new TestJobs();
String id=name.substring(0,name.indexOf("*JOB"));
System.out.println("执行命令中。。。");
for (int i = 0; i < QueueListener.list.size(); i++) {
job = QueueListener.list.get(i);
if (id.equals("" + job.getId())) {
break;
}else{
job=null;
}
}
if(null!=job){
toRunTask(job.getPlanproj(), job.getId(),job.getTaskName(),job.getClientip(),job.getClientpath());
System.out.println("调用程序结束。。。");
}else{
System.out.println("没有定时任务需要启动。。。");
}
}else if(name.indexOf("*CLIENT")>-1){
TestClient tc = new TestClient();
String id=name.substring(0,name.indexOf("*CLIENT"));
for (int i = 0; i < QueueListener.listen_Clientlist.size(); i++) {
tc = QueueListener.listen_Clientlist.get(i);
if (id.equals("" + tc.getId())) {
if(null!=tc){
String clientip=tc.getClientip();
try{
//调用远程对象注意RMI路径与接口必须与服务器配置一致
RunService service=(RunService)Naming.lookup("rmi://"+clientip+":6633/RunService");
String result=service.getClientStatus();
if("success".equals(result)){
if(tc.getStatus()!=0){
tc.setStatus(0);
QueueListener.listen_Clientlist.set(i, tc);
Query query = session.createQuery("update TestClient t set t.status =0 where id="+tc.getId());
query.executeUpdate();
}
}else{
if(tc.getStatus()!=1){
tc.setStatus(1);
QueueListener.listen_Clientlist.set(i, tc);
Query query = session.createQuery("update TestClient t set t.status =1 where id="+tc.getId());
query.executeUpdate();
}
}
}catch (RemoteException e) {
if(tc.getStatus()!=1){
tc.setStatus(1);
QueueListener.listen_Clientlist.set(i, tc);
Query query = session.createQuery("update TestClient t set t.status =1 where id="+tc.getId());
query.executeUpdate();
}
break;
}
}
break;
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
public String toRunTask(String projname,int jobId,String jobname,String clientip,String loadpath){
Session s = null;
Transaction tx = null;
//System.out.println(tastId);
String tastName = "";
String time = new SimpleDateFormat("yyyyMMddHHmmss").format(new java.util.Date().getTime());
tastName =""+jobname+ "】_"+time;
TestTaskexcute task=add(tastName, jobId, s, tx);
projname = projname.replaceAll(" ","\" \""); //防止计划名称或是项目名称带了空格符号,在run.exec中会执行出错
String result="启动失败!";
try{
//调用远程对象注意RMI路径与接口必须与服务器配置一致
RunService service=(RunService)Naming.lookup("rmi://"+clientip+":6633/RunService");
RunTaskEntity tasken = new RunTaskEntity();
tasken.setProjectname(projname);
tasken.setTaskid(String.valueOf(task.getId()));
if(StrLib.isEmpty(loadpath)){
loadpath="/TestDriven";
}
result=service.runtask(tasken,loadpath);
System.out.println(result);
return result;
}catch (Exception e) {
execFail(s, tx,task.getId(),jobId,tastName);
e.printStackTrace();
return result;
}
}
public String toRunCase(String projname,int tastId,String caseName,String casVersion,String clientip,String loadpath) {
String result="启动失败!";
try{
//调用远程对象注意RMI路径与接口必须与服务器配置一致
RunService service=(RunService)Naming.lookup("rmi://"+clientip+":6633/RunService");
RunCaseEntity onecase = new RunCaseEntity();
onecase.setProjectname(projname);
onecase.setTaskid(String.valueOf(tastId));
onecase.setTestCaseExternalId(caseName);
onecase.setVersion(casVersion);
if(StrLib.isEmpty(loadpath)){
loadpath="/TestDriven";
}
result=service.runcase(onecase,loadpath);
System.out.println(result);
return result;
} catch (Exception e) {
e.printStackTrace();
return result;
}
}
public String toRunCaseBatch(String projname,int taskid,String caseInfo,String clientip,String loadpath) {
String result="启动失败!";
try{
//调用远程对象注意RMI路径与接口必须与服务器配置一致
RunService service=(RunService)Naming.lookup("rmi://"+clientip+":6633/RunService");
RunBatchCaseEntity batchcase = new RunBatchCaseEntity();
batchcase.setProjectname(projname);
batchcase.setTaskid(String.valueOf(taskid));
batchcase.setBatchcase(caseInfo);
if(StrLib.isEmpty(loadpath)){
loadpath="/TestDriven";
}
result=service.runbatchcase(batchcase,loadpath);
System.out.println(result);
return result;
} catch (Exception e) {
e.printStackTrace();
return result;
}
}
/**
* 加入 testJobs表
* @param tastId
* @param name
* @param jobId
* @param s
* @param tx
*/
private TestTaskexcute add(String tastName,int jobId,Session s,Transaction tx){
TestTaskexcute tast = new TestTaskexcute();
try {
tast.getTestJob().setId(jobId);
tast.setTaskId(tastName);
tast.setCaseIsExec("0");
tast.setTaskStatus("0");
tast.setCreateTime(DateUtil.now());
s = HibernateSessionFactoryUtil.openSession();
tx = s.beginTransaction();
s.save(tast);
System.out.println("tastId:"+tast.getId());
tx.commit();
} catch (Exception e) {
tx.rollback();
e.printStackTrace();
} finally {
s.close();
}
return tast;
}
private void execFail(Session s,Transaction tx,int id,int jobId,String tastId){
//执行失败时,写入任务表记录为执行失败
TestTaskexcute tast = new TestTaskexcute();
s = HibernateSessionFactoryUtil.openSession();
tx = s.beginTransaction();
tast=(TestTaskexcute) s.load(TestTaskexcute.class, id);
tast.setTaskStatus("3");
tast.setJobid(jobId);
tast.setTaskId(tastId);
tast.setCaseIsExec("1");
tast.setTaskStatus("3");
s.update(tast);
tx.commit();
s.close();
}
public static void main(String[] args) throws IOException {
}
}

View File

@ -1,226 +1,226 @@
package luckyweb.seagull.quartz;
import org.apache.log4j.Logger;
import org.quartz.CronTrigger;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import luckyweb.seagull.comm.QueueListener;
public class QuartzManager {
//private static SchedulerFactory gSchedulerFactory = new StdSchedulerFactory();
//private static String JOB_GROUP_NAME = "EXTJWEB_JOBGROUP_NAME";
//private static String TRIGGER_GROUP_NAME = "EXTJWEB_TRIGGERGROUP_NAME";
private static final Logger log = Logger.getLogger(QuartzManager.class);
/**
* @Description: 添加一个定时任务使用默认的任务组名触发器名触发器组名
*
* @param jobName
* 任务名
* @param cls
* 任务
* @param time
* 时间设置参考quartz说明文档
*
*/
@SuppressWarnings("unchecked")
public static void addJob(String jobName, Class cls, String time) {
try {
JobDetail jobDetail = new JobDetail(jobName, QueueListener.JOB_GROUP_NAME, cls);// 任务名任务组任务执行类
//System.out.println("jobDetail 's Name :"+jobDetail.getName());
// 触发器
CronTrigger trigger = new CronTrigger(jobDetail.getName(), QueueListener.TRIGGER_GROUP_NAME);// 触发器名,触发器组
trigger.setCronExpression(time);// 触发器时间设定
QueueListener.sched.scheduleJob(jobDetail, trigger);
// 启动
if (!QueueListener.sched.isShutdown()) {
System.out.println("启动。。"+jobName +" ,时间:"+time);
QueueListener.sched.start();
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* @Description: 添加一个定时任务
*
* @param jobName
* 任务名
* @param jobGroupName
* 任务组名
* @param triggerName
* 触发器名
* @param triggerGroupName
* 触发器组名
* @param jobClass
* 任务
* @param time
* 时间设置参考quartz说明文档
* @throws SchedulerException
*
* @Title: QuartzManager.java
*
*/
@SuppressWarnings("unchecked")
public static void addJob(String jobName, String jobGroupName,
String triggerName, String triggerGroupName, Class jobClass,
String time) throws SchedulerException {
// QueueListener.sched=QueueListener.gSchedulerFactory.getScheduler();
try {
JobDetail jobDetail = new JobDetail(jobName, jobGroupName, jobClass);// 任务名任务组任务执行类
// 触发器
CronTrigger trigger = new CronTrigger(triggerName, triggerGroupName);// 触发器名,触发器组
trigger.setCronExpression(time);// 触发器时间设定
QueueListener.sched.scheduleJob(jobDetail, trigger);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* @Description: 修改一个任务的触发时间(使用默认的任务组名触发器名触发器组名)
*
* @param jobName
* @param time
*
* @Title: QuartzManager.java
*
*/
@SuppressWarnings("unchecked")
public static String modifyJobTime(String jobName, String time) {
try {
Scheduler sched=QueueListener.gSchedulerFactory.getScheduler();
CronTrigger trigger = (CronTrigger) sched.getTrigger(jobName,QueueListener.TRIGGER_GROUP_NAME);
if (trigger == null) {
return "任务已经执行过或者不在队列中,请暂定运行后,重启再修改时间.";
}
String oldTime = trigger.getCronExpression();
if (!oldTime.equalsIgnoreCase(time)) {
JobDetail jobDetail = sched.getJobDetail(jobName, QueueListener.JOB_GROUP_NAME);
Class objJobClass = jobDetail.getJobClass();
removeJob(jobName);
addJob(jobName, objJobClass, time);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
return "";
}
/**
* @Description: 修改一个任务的触发时间
*
* @param triggerName
* @param triggerGroupName
* @param time
*
*/
public static void modifyJobTime(String triggerName,
String triggerGroupName, String time) {
try {
QueueListener.sched = QueueListener.gSchedulerFactory.getScheduler();
CronTrigger trigger = (CronTrigger) QueueListener.sched.getTrigger(triggerName,
triggerGroupName);
if (trigger == null) {
return;
}
String oldTime = trigger.getCronExpression();
if (!oldTime.equalsIgnoreCase(time)) {
CronTrigger ct = (CronTrigger) trigger;
// 修改时间
ct.setCronExpression(time);
// 重启触发器
QueueListener.sched.resumeTrigger(triggerName, triggerGroupName);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* @Description: 移除一个任务(使用默认的任务组名触发器名触发器组名)
*
* @param jobName
*
* @Title: QuartzManager.java
*/
public static void removeJob(String jobName) {
try {
QueueListener.sched = QueueListener.gSchedulerFactory.getScheduler();
QueueListener.sched.pauseTrigger(jobName, QueueListener.TRIGGER_GROUP_NAME);// 停止触发器
QueueListener.sched.unscheduleJob(jobName, QueueListener.TRIGGER_GROUP_NAME);// 移除触发器
QueueListener.sched.deleteJob(jobName, QueueListener.TRIGGER_GROUP_NAME);// 删除任务
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* @Description: 移除一个任务
*
* @param jobName
* @param jobGroupName
* @param triggerName
* @param triggerGroupName
*
* @Title: QuartzManager.java
*/
public static void removeJob(String jobName, String jobGroupName,
String triggerName, String triggerGroupName) {
try {
Scheduler sched = QueueListener.gSchedulerFactory.getScheduler();
sched.pauseTrigger(triggerName, triggerGroupName);// 停止触发器
sched.unscheduleJob(triggerName, triggerGroupName);// 移除触发器
sched.deleteJob(jobName, jobGroupName);// 删除任务
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* @Description:启动所有定时任务
*
*
* @Title: QuartzManager.java
*/
public static void startJobs() {
try {
Scheduler sched = QueueListener.gSchedulerFactory.getScheduler();
sched.start();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* @Description:关闭所有定时任务
*
*
* @Title: QuartzManager.java
* @Copyright: Copyright (c) 2014
*
* @author Comsys-LZP
* @date 2014-6-26 下午03:50:26
* @version V2.0
*/
public static void shutdownJobs() {
try {
Scheduler sched = QueueListener.gSchedulerFactory.getScheduler();
if (!sched.isShutdown()) {
sched.shutdown();
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
package luckyweb.seagull.quartz;
import org.apache.log4j.Logger;
import org.quartz.CronTrigger;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import luckyweb.seagull.comm.QueueListener;
public class QuartzManager {
//private static SchedulerFactory gSchedulerFactory = new StdSchedulerFactory();
//private static String JOB_GROUP_NAME = "EXTJWEB_JOBGROUP_NAME";
//private static String TRIGGER_GROUP_NAME = "EXTJWEB_TRIGGERGROUP_NAME";
private static final Logger log = Logger.getLogger(QuartzManager.class);
/**
* @Description: 添加一个定时任务使用默认的任务组名触发器名触发器组名
*
* @param jobName
* 任务名
* @param cls
* 任务
* @param time
* 时间设置参考quartz说明文档
*
*/
@SuppressWarnings("unchecked")
public static void addJob(String jobName, Class cls, String time) {
try {
JobDetail jobDetail = new JobDetail(jobName, QueueListener.JOB_GROUP_NAME, cls);// 任务名任务组任务执行类
//System.out.println("jobDetail 's Name :"+jobDetail.getName());
// 触发器
CronTrigger trigger = new CronTrigger(jobDetail.getName(), QueueListener.TRIGGER_GROUP_NAME);// 触发器名,触发器组
trigger.setCronExpression(time);// 触发器时间设定
QueueListener.sched.scheduleJob(jobDetail, trigger);
// 启动
if (!QueueListener.sched.isShutdown()) {
System.out.println("启动。。"+jobName +" ,时间:"+time);
QueueListener.sched.start();
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* @Description: 添加一个定时任务
*
* @param jobName
* 任务名
* @param jobGroupName
* 任务组名
* @param triggerName
* 触发器名
* @param triggerGroupName
* 触发器组名
* @param jobClass
* 任务
* @param time
* 时间设置参考quartz说明文档
* @throws SchedulerException
*
* @Title: QuartzManager.java
*
*/
@SuppressWarnings("unchecked")
public static void addJob(String jobName, String jobGroupName,
String triggerName, String triggerGroupName, Class jobClass,
String time) throws SchedulerException {
// QueueListener.sched=QueueListener.gSchedulerFactory.getScheduler();
try {
JobDetail jobDetail = new JobDetail(jobName, jobGroupName, jobClass);// 任务名任务组任务执行类
// 触发器
CronTrigger trigger = new CronTrigger(triggerName, triggerGroupName);// 触发器名,触发器组
trigger.setCronExpression(time);// 触发器时间设定
QueueListener.sched.scheduleJob(jobDetail, trigger);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* @Description: 修改一个任务的触发时间(使用默认的任务组名触发器名触发器组名)
*
* @param jobName
* @param time
*
* @Title: QuartzManager.java
*
*/
@SuppressWarnings("unchecked")
public static String modifyJobTime(String jobName, String time) {
try {
Scheduler sched=QueueListener.gSchedulerFactory.getScheduler();
CronTrigger trigger = (CronTrigger) sched.getTrigger(jobName,QueueListener.TRIGGER_GROUP_NAME);
if (trigger == null) {
return "任务已经执行过或者不在队列中,请暂定运行后,重启再修改时间.";
}
String oldTime = trigger.getCronExpression();
if (!oldTime.equalsIgnoreCase(time)) {
JobDetail jobDetail = sched.getJobDetail(jobName, QueueListener.JOB_GROUP_NAME);
Class objJobClass = jobDetail.getJobClass();
removeJob(jobName);
addJob(jobName, objJobClass, time);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
return "";
}
/**
* @Description: 修改一个任务的触发时间
*
* @param triggerName
* @param triggerGroupName
* @param time
*
*/
public static void modifyJobTime(String triggerName,
String triggerGroupName, String time) {
try {
QueueListener.sched = QueueListener.gSchedulerFactory.getScheduler();
CronTrigger trigger = (CronTrigger) QueueListener.sched.getTrigger(triggerName,
triggerGroupName);
if (trigger == null) {
return;
}
String oldTime = trigger.getCronExpression();
if (!oldTime.equalsIgnoreCase(time)) {
CronTrigger ct = (CronTrigger) trigger;
// 修改时间
ct.setCronExpression(time);
// 重启触发器
QueueListener.sched.resumeTrigger(triggerName, triggerGroupName);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* @Description: 移除一个任务(使用默认的任务组名触发器名触发器组名)
*
* @param jobName
*
* @Title: QuartzManager.java
*/
public static void removeJob(String jobName) {
try {
QueueListener.sched = QueueListener.gSchedulerFactory.getScheduler();
QueueListener.sched.pauseTrigger(jobName, QueueListener.TRIGGER_GROUP_NAME);// 停止触发器
QueueListener.sched.unscheduleJob(jobName, QueueListener.TRIGGER_GROUP_NAME);// 移除触发器
QueueListener.sched.deleteJob(jobName, QueueListener.TRIGGER_GROUP_NAME);// 删除任务
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* @Description: 移除一个任务
*
* @param jobName
* @param jobGroupName
* @param triggerName
* @param triggerGroupName
*
* @Title: QuartzManager.java
*/
public static void removeJob(String jobName, String jobGroupName,
String triggerName, String triggerGroupName) {
try {
Scheduler sched = QueueListener.gSchedulerFactory.getScheduler();
sched.pauseTrigger(triggerName, triggerGroupName);// 停止触发器
sched.unscheduleJob(triggerName, triggerGroupName);// 移除触发器
sched.deleteJob(jobName, jobGroupName);// 删除任务
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* @Description:启动所有定时任务
*
*
* @Title: QuartzManager.java
*/
public static void startJobs() {
try {
Scheduler sched = QueueListener.gSchedulerFactory.getScheduler();
sched.start();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* @Description:关闭所有定时任务
*
*
* @Title: QuartzManager.java
* @Copyright: Copyright (c) 2014
*
* @author Comsys-LZP
* @date 2014-6-26 下午03:50:26
* @version V2.0
*/
public static void shutdownJobs() {
try {
Scheduler sched = QueueListener.gSchedulerFactory.getScheduler();
if (!sched.isShutdown()) {
sched.shutdown();
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}

View File

@ -1,44 +1,44 @@
package luckyweb.seagull.quartz;
import org.apache.log4j.Logger;
import luckyweb.seagull.spring.entity.TestClient;
import luckyweb.seagull.spring.entity.TestJobs;
public class QuratzJobDataMgr
{
private static final Logger logger = Logger.getLogger(QuratzJobDataMgr.class);
public void addJobRunTime(TestJobs tj, int id) throws Exception
{
// 比较任务的开始时间和当前时间如果是返回1说明任务的开始时间是还没有过如果返回2 说明任务的开时间应过去
try
{
String startTime = tj.getStartTimestr();
// String startTime=setStartTime(tj);
QuartzManager.addJob(id + "*JOB", QuartzJob.class, startTime);
}
catch (Exception e)
{
logger.error(e);
throw e;
}
}
public void addTestClient(TestClient tc, int id) throws Exception
{
// 比较任务的开始时间和当前时间如果是返回1说明任务的开始时间是还没有过如果返回2 说明任务的开时间应过去
try
{
int checkTime = tc.getCheckinterval();
String startTime="0/"+checkTime+" * * * * ?";
QuartzManager.addJob(id + "*CLIENT", QuartzJob.class, startTime);
}
catch (Exception e)
{
logger.error(e);
throw e;
}
}
}
package luckyweb.seagull.quartz;
import org.apache.log4j.Logger;
import luckyweb.seagull.spring.entity.TestClient;
import luckyweb.seagull.spring.entity.TestJobs;
public class QuratzJobDataMgr
{
private static final Logger logger = Logger.getLogger(QuratzJobDataMgr.class);
public void addJobRunTime(TestJobs tj, int id) throws Exception
{
// 比较任务的开始时间和当前时间如果是返回1说明任务的开始时间是还没有过如果返回2 说明任务的开时间应过去
try
{
String startTime = tj.getStartTimestr();
// String startTime=setStartTime(tj);
QuartzManager.addJob(id + "*JOB", QuartzJob.class, startTime);
}
catch (Exception e)
{
logger.error(e);
throw e;
}
}
public void addTestClient(TestClient tc, int id) throws Exception
{
// 比较任务的开始时间和当前时间如果是返回1说明任务的开始时间是还没有过如果返回2 说明任务的开时间应过去
try
{
int checkTime = tc.getCheckinterval();
String startTime="0/"+checkTime+" * * * * ?";
QuartzManager.addJob(id + "*CLIENT", QuartzJob.class, startTime);
}
catch (Exception e)
{
logger.error(e);
throw e;
}
}
}

View File

@ -1,48 +1,48 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.Accident;
@Transactional
public interface AccidentDao {
public int add(Accident accident) throws Exception;
public void modify(Accident accident) throws Exception;
public void modifyState(Accident accident) throws Exception;
public void modifyInfo(Accident accident) throws Exception;
public void delete(int id) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<Accident> list(Accident accident) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<Accident> list(String hql) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List listavgpro(String sql) throws Exception;
public Accident load(int id) throws Exception;
public List<Accident> load(String name, String cmdType, String planPath)
throws Exception;
public Accident get(int id) throws Exception;
// public List findByPage(final String hql, final int offset,final int pageSize);
//
// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize);
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(Accident accident,String hql);
public List<Accident> findJobsList();
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.Accident;
@Transactional
public interface AccidentDao {
public int add(Accident accident) throws Exception;
public void modify(Accident accident) throws Exception;
public void modifyState(Accident accident) throws Exception;
public void modifyInfo(Accident accident) throws Exception;
public void delete(int id) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<Accident> list(Accident accident) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<Accident> list(String hql) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List listavgpro(String sql) throws Exception;
public Accident load(int id) throws Exception;
public List<Accident> load(String name, String cmdType, String planPath)
throws Exception;
public Accident get(int id) throws Exception;
// public List findByPage(final String hql, final int offset,final int pageSize);
//
// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize);
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(Accident accident,String hql);
public List<Accident> findJobsList();
}

View File

@ -1,204 +1,204 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.Accident;
@Repository("accidentDao")
public class AccidentDaoImpl extends HibernateDaoSupport implements AccidentDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void delete(int id) throws Exception {
try{
Accident accident = this.load(id);
this.getHibernateTemplate().delete(accident);
}catch(Exception e){
e.printStackTrace();
}
}
private void whereParameter(Accident accident, Query query) {
if (accident.getProjectid()!=0) {
query.setParameter("projectid", accident.getProjectid());
}
if (accident.getAccstatus()!=null&&!accident.getAccstatus().equals("")&&!accident.getAccstatus().equals("00")) {
query.setParameter("accstatus", accident.getAccstatus());
}
if (accident.getAccstarttime()!=null&&!"".equals(accident.getAccstarttime())) {
query.setParameter("accstarttime", accident.getAccstarttime());
}
if (accident.getAccendtime()!=null&&!"".equals(accident.getAccendtime())) {
query.setParameter("accendtime", accident.getAccendtime());
}
if (null!=accident.getAccdescription()&&!"".equals(accident.getAccdescription())) {
query.setParameter("accdescription", "%"+accident.getAccdescription()+"%");
}
if (null!=accident.getCausaltype()&&!"".equals(accident.getCausaltype())) {
query.setParameter("causaltype", "%"+accident.getCausaltype()+"%");
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((Accident)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(Accident accident, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(accident, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int add(Accident accident) throws Exception {
this.getHibernateTemplate().save(accident);
return accident.getId();
}
@Override
public void modify(Accident accident) throws Exception {
this.getHibernateTemplate().update(accident);
}
@Override
public void modifyState(Accident accident) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void modifyInfo(Accident accident) throws Exception {
// TODO Auto-generated method stub
}
@Override
public List<Accident> list(Accident accident)
throws Exception {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("unchecked")
@Override
public List<Accident> list(String hql) throws Exception {
return this.getHibernateTemplate().find(hql);
}
@Override
public Accident load(int id) throws Exception {
return (Accident) this.getHibernateTemplate().get(Accident.class, id);
//return (Accident) this.getSession().load(Accident.class, id);
}
@Override
public List<Accident> load(String name, String cmdType,
String planPath) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public Accident get(int id) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public List<Accident> findJobsList() {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("rawtypes")
@Override
public List listavgpro(String sql) throws Exception {
// TODO Auto-generated method stub
List count=null;
Session session=this.getSession(true);
try {
count = session.createSQLQuery(sql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return count;
}
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.Accident;
@Repository("accidentDao")
public class AccidentDaoImpl extends HibernateDaoSupport implements AccidentDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void delete(int id) throws Exception {
try{
Accident accident = this.load(id);
this.getHibernateTemplate().delete(accident);
}catch(Exception e){
e.printStackTrace();
}
}
private void whereParameter(Accident accident, Query query) {
if (accident.getProjectid()!=0) {
query.setParameter("projectid", accident.getProjectid());
}
if (accident.getAccstatus()!=null&&!accident.getAccstatus().equals("")&&!accident.getAccstatus().equals("00")) {
query.setParameter("accstatus", accident.getAccstatus());
}
if (accident.getAccstarttime()!=null&&!"".equals(accident.getAccstarttime())) {
query.setParameter("accstarttime", accident.getAccstarttime());
}
if (accident.getAccendtime()!=null&&!"".equals(accident.getAccendtime())) {
query.setParameter("accendtime", accident.getAccendtime());
}
if (null!=accident.getAccdescription()&&!"".equals(accident.getAccdescription())) {
query.setParameter("accdescription", "%"+accident.getAccdescription()+"%");
}
if (null!=accident.getCausaltype()&&!"".equals(accident.getCausaltype())) {
query.setParameter("causaltype", "%"+accident.getCausaltype()+"%");
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((Accident)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(Accident accident, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(accident, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int add(Accident accident) throws Exception {
this.getHibernateTemplate().save(accident);
return accident.getId();
}
@Override
public void modify(Accident accident) throws Exception {
this.getHibernateTemplate().update(accident);
}
@Override
public void modifyState(Accident accident) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void modifyInfo(Accident accident) throws Exception {
// TODO Auto-generated method stub
}
@Override
public List<Accident> list(Accident accident)
throws Exception {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("unchecked")
@Override
public List<Accident> list(String hql) throws Exception {
return this.getHibernateTemplate().find(hql);
}
@Override
public Accident load(int id) throws Exception {
return (Accident) this.getHibernateTemplate().get(Accident.class, id);
//return (Accident) this.getSession().load(Accident.class, id);
}
@Override
public List<Accident> load(String name, String cmdType,
String planPath) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public Accident get(int id) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public List<Accident> findJobsList() {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("rawtypes")
@Override
public List listavgpro(String sql) throws Exception {
// TODO Auto-generated method stub
List count=null;
Session session=this.getSession(true);
try {
count = session.createSQLQuery(sql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return count;
}
}

View File

@ -1,53 +1,53 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.FlowCheck;
@Transactional
public interface FlowCheckDao {
public int add(FlowCheck flowcheck) throws Exception;
public void modify(FlowCheck flowcheck) throws Exception;
public void modifyState(FlowCheck flowcheck) throws Exception;
public void modifyVersion(String sql) throws Exception;
public void delete(int id) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<FlowCheck> list(FlowCheck flowcheck) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<FlowCheck> list(String hql) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List listcheckinfo(String sql) throws Exception;
public FlowCheck load(int id) throws Exception;
public List<FlowCheck> load(String name, String cmdType, String planPath)
throws Exception;
public String get(String sql) throws Exception;
// public List findByPage(final String hql, final int offset,final int pageSize);
//
// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize);
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(FlowCheck flowcheck,String hql);
public List findByPageTable(final String hql, final Object value,final int offset, final int pageSize);
public int findRowsTable(FlowCheck flowcheck,String hql);
/*public List findRows(String sql);*/
public List<FlowCheck> findJobsList();
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.FlowCheck;
@Transactional
public interface FlowCheckDao {
public int add(FlowCheck flowcheck) throws Exception;
public void modify(FlowCheck flowcheck) throws Exception;
public void modifyState(FlowCheck flowcheck) throws Exception;
public void modifyVersion(String sql) throws Exception;
public void delete(int id) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<FlowCheck> list(FlowCheck flowcheck) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<FlowCheck> list(String hql) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List listcheckinfo(String sql) throws Exception;
public FlowCheck load(int id) throws Exception;
public List<FlowCheck> load(String name, String cmdType, String planPath)
throws Exception;
public String get(String sql) throws Exception;
// public List findByPage(final String hql, final int offset,final int pageSize);
//
// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize);
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(FlowCheck flowcheck,String hql);
public List findByPageTable(final String hql, final Object value,final int offset, final int pageSize);
public int findRowsTable(FlowCheck flowcheck,String hql);
/*public List findRows(String sql);*/
public List<FlowCheck> findJobsList();
}

View File

@ -1,264 +1,264 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.Accident;
import luckyweb.seagull.spring.entity.FlowCheck;
import luckyweb.seagull.spring.entity.FlowInfo;
@Repository("flowcheckDao")
public class FlowCheckDaoImpl extends HibernateDaoSupport implements FlowCheckDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void delete(int id) throws Exception {
FlowCheck flowcheck = this.load(id);
this.getHibernateTemplate().delete(flowcheck);
}
private void whereParameter(FlowCheck flowcheck, Query query) {
if (flowcheck.getId()!=0) {
query.setParameter("id", flowcheck.getId());
}
if (flowcheck.getProjectid()!=0) {
query.setParameter("projectid", flowcheck.getProjectid());
}
if (flowcheck.getCheckid()!=0) {
query.setParameter("checkid", flowcheck.getCheckid());
}
if (flowcheck.getVersionnum()!=null&&!flowcheck.getVersionnum().equals("")) {
query.setParameter("versionnum", flowcheck.getVersionnum());
}
if (flowcheck.getCheckenddate()!=null&&flowcheck.getCheckstartdate()!=null&&
!flowcheck.getCheckenddate().equals("")&&!flowcheck.getCheckstartdate().equals("")) {
query.setParameter("checkstartdate", flowcheck.getCheckstartdate());
query.setParameter("checkenddate", flowcheck.getCheckenddate());
}
}
private void whereParameter(FlowInfo flowinfo, Query query) {
if (flowinfo.getId()!=0&&flowinfo.getId()!=99) {
query.setParameter("projectid", flowinfo.getId());
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
//Query query= session.createQuery(hql);
Query query= session.createSQLQuery(hql);
whereParameter((FlowCheck)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public List findByPageTable(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((FlowCheck)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(FlowCheck flowcheck, String hql) {
int s=0;
Session session=this.getSession(true);
try {
/*Query query=session.createQuery(hql);*/
Query query= session.createSQLQuery(hql);
whereParameter(flowcheck, query);
s= Integer.valueOf(
query.list().size());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int findRowsTable(FlowCheck flowcheck, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(flowcheck, query);
s= Integer.valueOf(
query.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int add(FlowCheck flowcheck) throws Exception {
this.getHibernateTemplate().save(flowcheck);
return flowcheck.getCheckid();
}
@Override
public void modify(FlowCheck flowcheck) throws Exception {
this.getHibernateTemplate().update(flowcheck);
}
@Override
public void modifyState(FlowCheck flowcheck) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void modifyVersion(String sql) throws Exception {
// TODO Auto-generated method stub
Session session=this.getSession(true);
try {
session.beginTransaction();
Query query =session .createQuery(sql);
query.executeUpdate();
session.getTransaction().commit();
} catch (Exception e) {
e.printStackTrace();
}finally
{
session.close();
}
}
@Override
public List<FlowCheck> list(FlowCheck flowcheck)
throws Exception {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("unchecked")
@Override
public List<FlowCheck> list(String hql) throws Exception {
return this.getHibernateTemplate().find(hql);
}
@Override
public FlowCheck load(int id) throws Exception {
return (FlowCheck) this.getHibernateTemplate().get(FlowCheck.class, id);
//return (FlowCheck) this.getSession().load(FlowCheck.class, id);
}
@Override
public List<FlowCheck> load(String name, String cmdType,
String planPath) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public String get(String sql) throws Exception {
String result = "";
Session session = this.getSession(true);
@SuppressWarnings("unchecked")
List<Object> count = session.createSQLQuery(sql).list();
if(count.size()!=0&&count.get(0)!=null){
result = count.get(0).toString();
}
session.close();
return result;
}
@Override
public List<FlowCheck> findJobsList() {
// TODO Auto-generated method stub
return null;
}
@Override
public List listcheckinfo(String sql) throws Exception {
// TODO Auto-generated method stub
List count=null;
Session session=this.getSession(true);
try {
count = session.createSQLQuery(sql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return count;
}
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.Accident;
import luckyweb.seagull.spring.entity.FlowCheck;
import luckyweb.seagull.spring.entity.FlowInfo;
@Repository("flowcheckDao")
public class FlowCheckDaoImpl extends HibernateDaoSupport implements FlowCheckDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void delete(int id) throws Exception {
FlowCheck flowcheck = this.load(id);
this.getHibernateTemplate().delete(flowcheck);
}
private void whereParameter(FlowCheck flowcheck, Query query) {
if (flowcheck.getId()!=0) {
query.setParameter("id", flowcheck.getId());
}
if (flowcheck.getProjectid()!=0) {
query.setParameter("projectid", flowcheck.getProjectid());
}
if (flowcheck.getCheckid()!=0) {
query.setParameter("checkid", flowcheck.getCheckid());
}
if (flowcheck.getVersionnum()!=null&&!flowcheck.getVersionnum().equals("")) {
query.setParameter("versionnum", flowcheck.getVersionnum());
}
if (flowcheck.getCheckenddate()!=null&&flowcheck.getCheckstartdate()!=null&&
!flowcheck.getCheckenddate().equals("")&&!flowcheck.getCheckstartdate().equals("")) {
query.setParameter("checkstartdate", flowcheck.getCheckstartdate());
query.setParameter("checkenddate", flowcheck.getCheckenddate());
}
}
private void whereParameter(FlowInfo flowinfo, Query query) {
if (flowinfo.getId()!=0&&flowinfo.getId()!=99) {
query.setParameter("projectid", flowinfo.getId());
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
//Query query= session.createQuery(hql);
Query query= session.createSQLQuery(hql);
whereParameter((FlowCheck)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public List findByPageTable(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((FlowCheck)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(FlowCheck flowcheck, String hql) {
int s=0;
Session session=this.getSession(true);
try {
/*Query query=session.createQuery(hql);*/
Query query= session.createSQLQuery(hql);
whereParameter(flowcheck, query);
s= Integer.valueOf(
query.list().size());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int findRowsTable(FlowCheck flowcheck, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(flowcheck, query);
s= Integer.valueOf(
query.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int add(FlowCheck flowcheck) throws Exception {
this.getHibernateTemplate().save(flowcheck);
return flowcheck.getCheckid();
}
@Override
public void modify(FlowCheck flowcheck) throws Exception {
this.getHibernateTemplate().update(flowcheck);
}
@Override
public void modifyState(FlowCheck flowcheck) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void modifyVersion(String sql) throws Exception {
// TODO Auto-generated method stub
Session session=this.getSession(true);
try {
session.beginTransaction();
Query query =session .createQuery(sql);
query.executeUpdate();
session.getTransaction().commit();
} catch (Exception e) {
e.printStackTrace();
}finally
{
session.close();
}
}
@Override
public List<FlowCheck> list(FlowCheck flowcheck)
throws Exception {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("unchecked")
@Override
public List<FlowCheck> list(String hql) throws Exception {
return this.getHibernateTemplate().find(hql);
}
@Override
public FlowCheck load(int id) throws Exception {
return (FlowCheck) this.getHibernateTemplate().get(FlowCheck.class, id);
//return (FlowCheck) this.getSession().load(FlowCheck.class, id);
}
@Override
public List<FlowCheck> load(String name, String cmdType,
String planPath) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public String get(String sql) throws Exception {
String result = "";
Session session = this.getSession(true);
@SuppressWarnings("unchecked")
List<Object> count = session.createSQLQuery(sql).list();
if(count.size()!=0&&count.get(0)!=null){
result = count.get(0).toString();
}
session.close();
return result;
}
@Override
public List<FlowCheck> findJobsList() {
// TODO Auto-generated method stub
return null;
}
@Override
public List listcheckinfo(String sql) throws Exception {
// TODO Auto-generated method stub
List count=null;
Session session=this.getSession(true);
try {
count = session.createSQLQuery(sql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return count;
}
}

View File

@ -1,25 +1,25 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.FlowInfo;
@Transactional
public interface FlowInfoDao {
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<FlowInfo> list(FlowInfo flowinfo) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<FlowInfo> list(String hql) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List listcheckinfo(String sql) throws Exception;
public FlowInfo load(int id) throws Exception;
public FlowInfo get(int id) throws Exception;
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.FlowInfo;
@Transactional
public interface FlowInfoDao {
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<FlowInfo> list(FlowInfo flowinfo) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<FlowInfo> list(String hql) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List listcheckinfo(String sql) throws Exception;
public FlowInfo load(int id) throws Exception;
public FlowInfo get(int id) throws Exception;
}

View File

@ -1,75 +1,75 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.Accident;
import luckyweb.seagull.spring.entity.FlowCheck;
import luckyweb.seagull.spring.entity.FlowInfo;
@Repository("flowinfoDao")
public class FlowInfoDaoImpl extends HibernateDaoSupport implements FlowInfoDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public List<FlowInfo> list(FlowInfo flowinfo)
throws Exception {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("unchecked")
@Override
public List<FlowInfo> list(String hql) throws Exception {
return this.getHibernateTemplate().find(hql);
}
@Override
public FlowInfo load(int id) throws Exception {
return (FlowInfo) this.getSession().load(FlowInfo.class, id);
}
@Override
public FlowInfo get(int id) throws Exception {
// TODO Auto-generated method stub
return (FlowInfo) this.getHibernateTemplate().get(FlowInfo.class, id);
}
@Override
public List listcheckinfo(String sql) throws Exception {
// TODO Auto-generated method stub
// List<TestTastexcute> list=new ArrayList<TestTastexcute>();
List count=null;
Session session=this.getSession(true);
try {
count = session.createSQLQuery(sql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return count;
}
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.Accident;
import luckyweb.seagull.spring.entity.FlowCheck;
import luckyweb.seagull.spring.entity.FlowInfo;
@Repository("flowinfoDao")
public class FlowInfoDaoImpl extends HibernateDaoSupport implements FlowInfoDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public List<FlowInfo> list(FlowInfo flowinfo)
throws Exception {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("unchecked")
@Override
public List<FlowInfo> list(String hql) throws Exception {
return this.getHibernateTemplate().find(hql);
}
@Override
public FlowInfo load(int id) throws Exception {
return (FlowInfo) this.getSession().load(FlowInfo.class, id);
}
@Override
public FlowInfo get(int id) throws Exception {
// TODO Auto-generated method stub
return (FlowInfo) this.getHibernateTemplate().get(FlowInfo.class, id);
}
@Override
public List listcheckinfo(String sql) throws Exception {
// TODO Auto-generated method stub
// List<TestTastexcute> list=new ArrayList<TestTastexcute>();
List count=null;
Session session=this.getSession(true);
try {
count = session.createSQLQuery(sql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return count;
}
}

View File

@ -1,22 +1,22 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.OperationLog;
@Transactional
public interface OperationLogDao {
public OperationLog load(int id) throws Exception;
public int add(OperationLog oplog) throws Exception;
public List findByPage(final String hql, final Object value, final int offset, final int pageSize);
public int findRows(OperationLog oplog, String hql);
public void delete(String hql) throws Exception;
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.OperationLog;
@Transactional
public interface OperationLogDao {
public OperationLog load(int id) throws Exception;
public int add(OperationLog oplog) throws Exception;
public List findByPage(final String hql, final Object value, final int offset, final int pageSize);
public int findRows(OperationLog oplog, String hql);
public void delete(String hql) throws Exception;
}

View File

@ -1,115 +1,115 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.OperationLog;
@Repository("operationlogDao")
public class OperationLogDaoImpl extends HibernateDaoSupport implements OperationLogDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public OperationLog load(int id) throws Exception {
//return (UserInfo)this.getSession().get(UserInfo.class, id);
return (OperationLog) this.getHibernateTemplate().get(OperationLog.class, id);
}
@Override
public int add(OperationLog oplog) throws Exception {
this.getHibernateTemplate().save(oplog);
return oplog.getId();
}
private void whereParameter(OperationLog oplog, Query query) {
if (oplog.getStarttime()!=null&&oplog.getEndtime()!=null
&&!oplog.getStarttime().equals("")&&!oplog.getEndtime().equals("")) {
query.setParameter("starttime", oplog.getStarttime());
query.setParameter("endtime", oplog.getEndtime());
}
if (oplog.getProjectid()!=0) {
query.setParameter("projectid", oplog.getProjectid());
}
if (oplog.getOperationer()!=null&&!oplog.getOperationer().equals("")) {
query.setParameter("operationer", "%"+oplog.getOperationer()+"%");
}
if (oplog.getOperation_description()!=null&&!oplog.getOperation_description().equals("")) {
query.setParameter("operation_description", "%"+oplog.getOperation_description()+"%");
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((OperationLog)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(OperationLog oplog, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(oplog, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public void delete(String hql) throws Exception {
Session session=this.getSession(true);
try {
session.beginTransaction();
Query query =session .createQuery(hql);
query.executeUpdate();
session.getTransaction().commit();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
}
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.OperationLog;
@Repository("operationlogDao")
public class OperationLogDaoImpl extends HibernateDaoSupport implements OperationLogDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public OperationLog load(int id) throws Exception {
//return (UserInfo)this.getSession().get(UserInfo.class, id);
return (OperationLog) this.getHibernateTemplate().get(OperationLog.class, id);
}
@Override
public int add(OperationLog oplog) throws Exception {
this.getHibernateTemplate().save(oplog);
return oplog.getId();
}
private void whereParameter(OperationLog oplog, Query query) {
if (oplog.getStarttime()!=null&&oplog.getEndtime()!=null
&&!oplog.getStarttime().equals("")&&!oplog.getEndtime().equals("")) {
query.setParameter("starttime", oplog.getStarttime());
query.setParameter("endtime", oplog.getEndtime());
}
if (oplog.getProjectid()!=0) {
query.setParameter("projectid", oplog.getProjectid());
}
if (oplog.getOperationer()!=null&&!oplog.getOperationer().equals("")) {
query.setParameter("operationer", "%"+oplog.getOperationer()+"%");
}
if (oplog.getOperation_description()!=null&&!oplog.getOperation_description().equals("")) {
query.setParameter("operation_description", "%"+oplog.getOperation_description()+"%");
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((OperationLog)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(OperationLog oplog, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(oplog, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public void delete(String hql) throws Exception {
Session session=this.getSession(true);
try {
session.beginTransaction();
Query query =session .createQuery(hql);
query.executeUpdate();
session.getTransaction().commit();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
}
}

View File

@ -1,26 +1,26 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.PlanFlowCheck;
@Transactional
public interface PlanFlowCheckDao {
public int add(PlanFlowCheck pfc) throws Exception;
public void modify(PlanFlowCheck pfc) throws Exception;
public void delete(int id) throws Exception;
public PlanFlowCheck load(int id) throws Exception;
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(PlanFlowCheck pfc,String hql);
/*public List findRows(String sql);*/
public List<PlanFlowCheck> list(String hql) throws Exception;
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.PlanFlowCheck;
@Transactional
public interface PlanFlowCheckDao {
public int add(PlanFlowCheck pfc) throws Exception;
public void modify(PlanFlowCheck pfc) throws Exception;
public void delete(int id) throws Exception;
public PlanFlowCheck load(int id) throws Exception;
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(PlanFlowCheck pfc,String hql);
/*public List findRows(String sql);*/
public List<PlanFlowCheck> list(String hql) throws Exception;
}

View File

@ -1,118 +1,118 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.PlanFlowCheck;
@Repository("planflowcheckDao")
public class PlanFlowCheckDaoImpl extends HibernateDaoSupport implements PlanFlowCheckDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void delete(int id) throws Exception {
PlanFlowCheck pfc = this.load(id);
this.getHibernateTemplate().delete(pfc);
}
private void whereParameter(PlanFlowCheck pfc, Query query) {
if (pfc.getId()!=0) {
query.setParameter("id", pfc.getId());
}
if (pfc.getStatus()!=0) {
query.setParameter("status", pfc.getStatus());
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((PlanFlowCheck)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(PlanFlowCheck pfc, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(pfc, query);
s= Integer.valueOf(
query.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int add(PlanFlowCheck pfc) throws Exception {
try{
this.getHibernateTemplate().save(pfc);
}catch(Exception e){
e.printStackTrace();
}
return pfc.getId();
}
@Override
public void modify(PlanFlowCheck pfc) throws Exception {
this.getHibernateTemplate().update(pfc);
}
@SuppressWarnings("unchecked")
@Override
public List<PlanFlowCheck> list(String hql) throws Exception {
return this.getHibernateTemplate().find(hql);
}
@Override
public PlanFlowCheck load(int id) throws Exception {
return (PlanFlowCheck) this.getHibernateTemplate().get(PlanFlowCheck.class, id);
//return (FlowCheck) this.getSession().load(FlowCheck.class, id);
}
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.PlanFlowCheck;
@Repository("planflowcheckDao")
public class PlanFlowCheckDaoImpl extends HibernateDaoSupport implements PlanFlowCheckDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void delete(int id) throws Exception {
PlanFlowCheck pfc = this.load(id);
this.getHibernateTemplate().delete(pfc);
}
private void whereParameter(PlanFlowCheck pfc, Query query) {
if (pfc.getId()!=0) {
query.setParameter("id", pfc.getId());
}
if (pfc.getStatus()!=0) {
query.setParameter("status", pfc.getStatus());
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((PlanFlowCheck)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(PlanFlowCheck pfc, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(pfc, query);
s= Integer.valueOf(
query.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int add(PlanFlowCheck pfc) throws Exception {
try{
this.getHibernateTemplate().save(pfc);
}catch(Exception e){
e.printStackTrace();
}
return pfc.getId();
}
@Override
public void modify(PlanFlowCheck pfc) throws Exception {
this.getHibernateTemplate().update(pfc);
}
@SuppressWarnings("unchecked")
@Override
public List<PlanFlowCheck> list(String hql) throws Exception {
return this.getHibernateTemplate().find(hql);
}
@Override
public PlanFlowCheck load(int id) throws Exception {
return (PlanFlowCheck) this.getHibernateTemplate().get(PlanFlowCheck.class, id);
//return (FlowCheck) this.getSession().load(FlowCheck.class, id);
}
}

View File

@ -1,49 +1,49 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.ProjectCase;
@Transactional
public interface ProjectCaseDao {
public int add(ProjectCase projectcase) throws Exception;
public void modify(ProjectCase projectcase) throws Exception;
public void modifyState(ProjectCase projectcase) throws Exception;
public void modifyInfo(ProjectCase projectcase) throws Exception;
public void delete(int id) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectCase> list(ProjectCase projectcase) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectCase> list(String hql) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectCase> getList(String sql) throws Exception;
public ProjectCase load(int id) throws Exception;
public List<ProjectCase> load(String name, String cmdType, String planPath)
throws Exception;
public ProjectCase get(int id) throws Exception;
// public List findByPage(final String hql, final int offset,final int pageSize);
//
// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize);
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(ProjectCase projectcase,String hql);
public List<ProjectCase> findJobsList();
public String getCaseMaxIndex(String sql) throws Exception ;
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.ProjectCase;
@Transactional
public interface ProjectCaseDao {
public int add(ProjectCase projectcase) throws Exception;
public void modify(ProjectCase projectcase) throws Exception;
public void modifyState(ProjectCase projectcase) throws Exception;
public void modifyInfo(ProjectCase projectcase) throws Exception;
public void delete(int id) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectCase> list(ProjectCase projectcase) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectCase> list(String hql) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectCase> getList(String sql) throws Exception;
public ProjectCase load(int id) throws Exception;
public List<ProjectCase> load(String name, String cmdType, String planPath)
throws Exception;
public ProjectCase get(int id) throws Exception;
// public List findByPage(final String hql, final int offset,final int pageSize);
//
// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize);
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(ProjectCase projectcase,String hql);
public List<ProjectCase> findJobsList();
public String getCaseMaxIndex(String sql) throws Exception ;
}

View File

@ -1,220 +1,220 @@
package luckyweb.seagull.spring.dao;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.ProjectCase;
@Repository("projectCaseDao")
public class ProjectCaseDaoImpl extends HibernateDaoSupport implements ProjectCaseDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void delete(int id) throws Exception {
try{
ProjectCase projectcase = this.load(id);
this.getHibernateTemplate().delete(projectcase);
}catch(Exception e){
e.printStackTrace();
}
}
private void whereParameter(ProjectCase projectcase, Query query) {
if (projectcase.getProjectid()!=0&&projectcase.getProjectid()!=99) {
query.setParameter("projectid", projectcase.getProjectid());
}
if (projectcase.getModuleid()!=0&&projectcase.getModuleidarr().length>0) {
Collection<Integer> collection = new ArrayList<Integer>(Arrays.asList(projectcase.getModuleidarr()));
query.setParameterList("moduleid", collection);
}
if (null!=projectcase.getSign()&&!"".equals(projectcase.getSign())) {
query.setParameter("sign", "%"+projectcase.getSign()+"%");
}
if (null!=projectcase.getName()&&!"".equals(projectcase.getName())) {
query.setParameter("name", "%"+projectcase.getName()+"%");
}
if (null!=projectcase.getOperationer()&&!"".equals(projectcase.getOperationer())) {
query.setParameter("operationer", "%"+projectcase.getOperationer()+"%");
}
if (null!=projectcase.getRemark()&&!"".equals(projectcase.getRemark())) {
query.setParameter("remark", "%"+projectcase.getRemark()+"%");
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((ProjectCase)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(ProjectCase projectcase, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(projectcase, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int add(ProjectCase projectcase) throws Exception {
this.getHibernateTemplate().save(projectcase);
return projectcase.getId();
}
@Override
public void modify(ProjectCase projectcase) throws Exception {
this.getHibernateTemplate().update(projectcase);
}
@Override
public void modifyState(ProjectCase projectcase) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void modifyInfo(ProjectCase projectcase) throws Exception {
// TODO Auto-generated method stub
}
@Override
public List<ProjectCase> list(ProjectCase projectcase)
throws Exception {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("unchecked")
@Override
public List<ProjectCase> list(String hql) throws Exception {
return this.getHibernateTemplate().find(hql);
}
@Override
public ProjectCase load(int id) throws Exception {
return (ProjectCase) this.getHibernateTemplate().get(ProjectCase.class, id);
}
@Override
public List<ProjectCase> load(String name, String cmdType,
String planPath) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public ProjectCase get(int id) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public List<ProjectCase> findJobsList() {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("rawtypes")
@Override
public List<ProjectCase> getList(String hql) throws Exception {
// TODO Auto-generated method stub
List<ProjectCase> list=null;
Session session=this.getSession(true);
try {
list = session.createQuery(hql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return list;
}
@SuppressWarnings("rawtypes")
@Override
public String getCaseMaxIndex(String sql) throws Exception {
// TODO Auto-generated method stub
List list=null;
Session session=this.getSession(true);
try {
list = session.createSQLQuery(sql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return list.get(0).toString();
}
}
package luckyweb.seagull.spring.dao;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.ProjectCase;
@Repository("projectCaseDao")
public class ProjectCaseDaoImpl extends HibernateDaoSupport implements ProjectCaseDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void delete(int id) throws Exception {
try{
ProjectCase projectcase = this.load(id);
this.getHibernateTemplate().delete(projectcase);
}catch(Exception e){
e.printStackTrace();
}
}
private void whereParameter(ProjectCase projectcase, Query query) {
if (projectcase.getProjectid()!=0&&projectcase.getProjectid()!=99) {
query.setParameter("projectid", projectcase.getProjectid());
}
if (projectcase.getModuleid()!=0&&projectcase.getModuleidarr().length>0) {
Collection<Integer> collection = new ArrayList<Integer>(Arrays.asList(projectcase.getModuleidarr()));
query.setParameterList("moduleid", collection);
}
if (null!=projectcase.getSign()&&!"".equals(projectcase.getSign())) {
query.setParameter("sign", "%"+projectcase.getSign()+"%");
}
if (null!=projectcase.getName()&&!"".equals(projectcase.getName())) {
query.setParameter("name", "%"+projectcase.getName()+"%");
}
if (null!=projectcase.getOperationer()&&!"".equals(projectcase.getOperationer())) {
query.setParameter("operationer", "%"+projectcase.getOperationer()+"%");
}
if (null!=projectcase.getRemark()&&!"".equals(projectcase.getRemark())) {
query.setParameter("remark", "%"+projectcase.getRemark()+"%");
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((ProjectCase)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(ProjectCase projectcase, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(projectcase, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int add(ProjectCase projectcase) throws Exception {
this.getHibernateTemplate().save(projectcase);
return projectcase.getId();
}
@Override
public void modify(ProjectCase projectcase) throws Exception {
this.getHibernateTemplate().update(projectcase);
}
@Override
public void modifyState(ProjectCase projectcase) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void modifyInfo(ProjectCase projectcase) throws Exception {
// TODO Auto-generated method stub
}
@Override
public List<ProjectCase> list(ProjectCase projectcase)
throws Exception {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("unchecked")
@Override
public List<ProjectCase> list(String hql) throws Exception {
return this.getHibernateTemplate().find(hql);
}
@Override
public ProjectCase load(int id) throws Exception {
return (ProjectCase) this.getHibernateTemplate().get(ProjectCase.class, id);
}
@Override
public List<ProjectCase> load(String name, String cmdType,
String planPath) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public ProjectCase get(int id) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public List<ProjectCase> findJobsList() {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("rawtypes")
@Override
public List<ProjectCase> getList(String hql) throws Exception {
// TODO Auto-generated method stub
List<ProjectCase> list=null;
Session session=this.getSession(true);
try {
list = session.createQuery(hql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return list;
}
@SuppressWarnings("rawtypes")
@Override
public String getCaseMaxIndex(String sql) throws Exception {
// TODO Auto-generated method stub
List list=null;
Session session=this.getSession(true);
try {
list = session.createSQLQuery(sql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return list.get(0).toString();
}
}

View File

@ -1,48 +1,48 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.ProjectCasesteps;
@Transactional
public interface ProjectCasestepsDao {
public int add(ProjectCasesteps casesteps) throws Exception;
public void modify(ProjectCasesteps casesteps) throws Exception;
public void modifyState(ProjectCasesteps casesteps) throws Exception;
public void modifyInfo(ProjectCasesteps casesteps) throws Exception;
public void delete(int id) throws Exception;
public void delete(String hql, int id) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectCasesteps> list(ProjectCasesteps casesteps) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectCasesteps> list(String hql) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectCasesteps> steps(String sql) throws Exception;
public ProjectCasesteps load(int id) throws Exception;
public List<ProjectCasesteps> load(String name, String cmdType, String planPath)
throws Exception;
public ProjectCasesteps get(int id) throws Exception;
// public List findByPage(final String hql, final int offset,final int pageSize);
//
// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize);
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(ProjectCasesteps casesteps,String hql);
public List<ProjectCasesteps> findJobsList();
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.ProjectCasesteps;
@Transactional
public interface ProjectCasestepsDao {
public int add(ProjectCasesteps casesteps) throws Exception;
public void modify(ProjectCasesteps casesteps) throws Exception;
public void modifyState(ProjectCasesteps casesteps) throws Exception;
public void modifyInfo(ProjectCasesteps casesteps) throws Exception;
public void delete(int id) throws Exception;
public void delete(String hql, int id) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectCasesteps> list(ProjectCasesteps casesteps) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectCasesteps> list(String hql) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectCasesteps> steps(String sql) throws Exception;
public ProjectCasesteps load(int id) throws Exception;
public List<ProjectCasesteps> load(String name, String cmdType, String planPath)
throws Exception;
public ProjectCasesteps get(int id) throws Exception;
// public List findByPage(final String hql, final int offset,final int pageSize);
//
// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize);
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(ProjectCasesteps casesteps,String hql);
public List<ProjectCasesteps> findJobsList();
}

View File

@ -1,197 +1,197 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.ProjectCasesteps;
import luckyweb.seagull.spring.entity.TestLogdetail;
@Repository("projectCasestepsDao")
public class ProjectCasestepsDaoImpl extends HibernateDaoSupport implements ProjectCasestepsDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void delete(int id) throws Exception {
try{
ProjectCasesteps casesteps = this.load(id);
this.getHibernateTemplate().delete(casesteps);
}catch(Exception e){
e.printStackTrace();
}
}
@Override
public void delete(String hql, int id) throws Exception {
Session session=this.getSession(true);
session.beginTransaction();
Query query =session .createQuery(hql);
query.setInteger("caseId", id);
query.executeUpdate();
session.getTransaction().commit();
session.close();
}
private void whereParameter(ProjectCasesteps casesteps, Query query) {
if (casesteps.getProjectid()!=0) {
query.setParameter("projectid", casesteps.getProjectid());
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((ProjectCasesteps)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(ProjectCasesteps casesteps, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(casesteps, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int add(ProjectCasesteps casesteps) throws Exception {
this.getHibernateTemplate().save(casesteps);
return casesteps.getId();
}
@Override
public void modify(ProjectCasesteps casesteps) throws Exception {
this.getHibernateTemplate().update(casesteps);
}
@Override
public void modifyState(ProjectCasesteps casesteps) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void modifyInfo(ProjectCasesteps casesteps) throws Exception {
// TODO Auto-generated method stub
}
@Override
public List<ProjectCasesteps> list(ProjectCasesteps casesteps)
throws Exception {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("unchecked")
@Override
public List<ProjectCasesteps> list(String hql) throws Exception {
return this.getHibernateTemplate().find(hql);
}
@Override
public ProjectCasesteps load(int id) throws Exception {
return (ProjectCasesteps) this.getHibernateTemplate().get(ProjectCasesteps.class, id);
//return (ProjectCasesteps) this.getSession().load(ProjectCasesteps.class, id);
}
@Override
public List<ProjectCasesteps> load(String name, String cmdType,
String planPath) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public ProjectCasesteps get(int id) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public List<ProjectCasesteps> findJobsList() {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("rawtypes")
@Override
public List<ProjectCasesteps> steps(String sql) throws Exception {
// TODO Auto-generated method stub
List<ProjectCasesteps> list=null;
Session session=this.getSession(true);
try {
list = session.createQuery(sql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return list;
}
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.ProjectCasesteps;
import luckyweb.seagull.spring.entity.TestLogdetail;
@Repository("projectCasestepsDao")
public class ProjectCasestepsDaoImpl extends HibernateDaoSupport implements ProjectCasestepsDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void delete(int id) throws Exception {
try{
ProjectCasesteps casesteps = this.load(id);
this.getHibernateTemplate().delete(casesteps);
}catch(Exception e){
e.printStackTrace();
}
}
@Override
public void delete(String hql, int id) throws Exception {
Session session=this.getSession(true);
session.beginTransaction();
Query query =session .createQuery(hql);
query.setInteger("caseId", id);
query.executeUpdate();
session.getTransaction().commit();
session.close();
}
private void whereParameter(ProjectCasesteps casesteps, Query query) {
if (casesteps.getProjectid()!=0) {
query.setParameter("projectid", casesteps.getProjectid());
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((ProjectCasesteps)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(ProjectCasesteps casesteps, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(casesteps, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int add(ProjectCasesteps casesteps) throws Exception {
this.getHibernateTemplate().save(casesteps);
return casesteps.getId();
}
@Override
public void modify(ProjectCasesteps casesteps) throws Exception {
this.getHibernateTemplate().update(casesteps);
}
@Override
public void modifyState(ProjectCasesteps casesteps) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void modifyInfo(ProjectCasesteps casesteps) throws Exception {
// TODO Auto-generated method stub
}
@Override
public List<ProjectCasesteps> list(ProjectCasesteps casesteps)
throws Exception {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("unchecked")
@Override
public List<ProjectCasesteps> list(String hql) throws Exception {
return this.getHibernateTemplate().find(hql);
}
@Override
public ProjectCasesteps load(int id) throws Exception {
return (ProjectCasesteps) this.getHibernateTemplate().get(ProjectCasesteps.class, id);
//return (ProjectCasesteps) this.getSession().load(ProjectCasesteps.class, id);
}
@Override
public List<ProjectCasesteps> load(String name, String cmdType,
String planPath) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public ProjectCasesteps get(int id) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public List<ProjectCasesteps> findJobsList() {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("rawtypes")
@Override
public List<ProjectCasesteps> steps(String sql) throws Exception {
// TODO Auto-generated method stub
List<ProjectCasesteps> list=null;
Session session=this.getSession(true);
try {
list = session.createQuery(sql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return list;
}
}

View File

@ -1,45 +1,45 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.ProjectModule;
@Transactional
public interface ProjectModuleDao {
public int add(ProjectModule projectmodule) throws Exception;
public void modify(ProjectModule projectmodule) throws Exception;
public void modifyState(ProjectModule projectmodule) throws Exception;
public void modifyInfo(ProjectModule projectmodule) throws Exception;
public void delete(ProjectModule projectmodule) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectModule> list(ProjectModule projectmodule) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectModule> list(String hql) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectModule> getList(String sql) throws Exception;
public ProjectModule load(int id) throws Exception;
public List<ProjectModule> load(String name, String cmdType, String planPath)
throws Exception;
public ProjectModule get(int id) throws Exception;
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(ProjectModule projectmodule,String hql);
public List<ProjectModule> findJobsList();
public String getModuleIdByName(String sql) throws Exception ;
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.ProjectModule;
@Transactional
public interface ProjectModuleDao {
public int add(ProjectModule projectmodule) throws Exception;
public void modify(ProjectModule projectmodule) throws Exception;
public void modifyState(ProjectModule projectmodule) throws Exception;
public void modifyInfo(ProjectModule projectmodule) throws Exception;
public void delete(ProjectModule projectmodule) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectModule> list(ProjectModule projectmodule) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectModule> list(String hql) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectModule> getList(String sql) throws Exception;
public ProjectModule load(int id) throws Exception;
public List<ProjectModule> load(String name, String cmdType, String planPath)
throws Exception;
public ProjectModule get(int id) throws Exception;
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(ProjectModule projectmodule,String hql);
public List<ProjectModule> findJobsList();
public String getModuleIdByName(String sql) throws Exception ;
}

View File

@ -1,200 +1,200 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.ProjectModule;
@Repository("projectModuleDao")
public class ProjectModuleDaoImpl extends HibernateDaoSupport implements ProjectModuleDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void delete(ProjectModule projectmodule) throws Exception {
try{
this.getHibernateTemplate().delete(projectmodule);
}catch(Exception e){
e.printStackTrace();
}
}
private void whereParameter(ProjectModule projectmodule, Query query) {
if (projectmodule.getProjectid()!=0&&projectmodule.getProjectid()!=99) {
query.setParameter("projectid", projectmodule.getProjectid());
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((ProjectModule)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(ProjectModule projectmodule, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(projectmodule, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int add(ProjectModule projectmodule) throws Exception {
this.getHibernateTemplate().save(projectmodule);
return projectmodule.getId();
}
@Override
public void modify(ProjectModule projectmodule) throws Exception {
this.getHibernateTemplate().update(projectmodule);
}
@Override
public void modifyState(ProjectModule projectmodule) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void modifyInfo(ProjectModule projectmodule) throws Exception {
// TODO Auto-generated method stub
}
@Override
public List<ProjectModule> list(ProjectModule projectmodule)
throws Exception {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("unchecked")
@Override
public List<ProjectModule> list(String hql) throws Exception {
return this.getHibernateTemplate().find(hql);
}
@Override
public ProjectModule load(int id) throws Exception {
return (ProjectModule) this.getHibernateTemplate().get(ProjectModule.class, id);
}
@Override
public List<ProjectModule> load(String name, String cmdType,
String planPath) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public ProjectModule get(int id) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public List<ProjectModule> findJobsList() {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("rawtypes")
@Override
public List<ProjectModule> getList(String hql) throws Exception {
// TODO Auto-generated method stub
List<ProjectModule> list=null;
Session session=this.getSession(true);
try {
list = session.createQuery(hql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return list;
}
@SuppressWarnings("rawtypes")
@Override
public String getModuleIdByName(String sql) throws Exception {
// TODO Auto-generated method stub
List list=null;
Session session=this.getSession(true);
try {
list = session.createSQLQuery(sql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return list.get(0).toString();
}
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.ProjectModule;
@Repository("projectModuleDao")
public class ProjectModuleDaoImpl extends HibernateDaoSupport implements ProjectModuleDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void delete(ProjectModule projectmodule) throws Exception {
try{
this.getHibernateTemplate().delete(projectmodule);
}catch(Exception e){
e.printStackTrace();
}
}
private void whereParameter(ProjectModule projectmodule, Query query) {
if (projectmodule.getProjectid()!=0&&projectmodule.getProjectid()!=99) {
query.setParameter("projectid", projectmodule.getProjectid());
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((ProjectModule)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(ProjectModule projectmodule, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(projectmodule, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int add(ProjectModule projectmodule) throws Exception {
this.getHibernateTemplate().save(projectmodule);
return projectmodule.getId();
}
@Override
public void modify(ProjectModule projectmodule) throws Exception {
this.getHibernateTemplate().update(projectmodule);
}
@Override
public void modifyState(ProjectModule projectmodule) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void modifyInfo(ProjectModule projectmodule) throws Exception {
// TODO Auto-generated method stub
}
@Override
public List<ProjectModule> list(ProjectModule projectmodule)
throws Exception {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("unchecked")
@Override
public List<ProjectModule> list(String hql) throws Exception {
return this.getHibernateTemplate().find(hql);
}
@Override
public ProjectModule load(int id) throws Exception {
return (ProjectModule) this.getHibernateTemplate().get(ProjectModule.class, id);
}
@Override
public List<ProjectModule> load(String name, String cmdType,
String planPath) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public ProjectModule get(int id) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public List<ProjectModule> findJobsList() {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("rawtypes")
@Override
public List<ProjectModule> getList(String hql) throws Exception {
// TODO Auto-generated method stub
List<ProjectModule> list=null;
Session session=this.getSession(true);
try {
list = session.createQuery(hql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return list;
}
@SuppressWarnings("rawtypes")
@Override
public String getModuleIdByName(String sql) throws Exception {
// TODO Auto-generated method stub
List list=null;
Session session=this.getSession(true);
try {
list = session.createSQLQuery(sql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return list.get(0).toString();
}
}

View File

@ -1,49 +1,49 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.ProjectPlanCase;
@Transactional
public interface ProjectPlanCaseDao {
public int add(ProjectPlanCase projectplancase) throws Exception;
public void modify(ProjectPlanCase projectplancase) throws Exception;
public void modifyState(ProjectPlanCase projectplancase) throws Exception;
public void modifyInfo(ProjectPlanCase projectplancase) throws Exception;
public void delete(ProjectPlanCase projectplancase) throws Exception;
public void delete(String hql, int id) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectPlanCase> list(ProjectPlanCase projectplancase) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectPlanCase> list(String hql) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List getList(String sql) throws Exception;
public ProjectPlanCase load(int id) throws Exception;
public List<ProjectPlanCase> load(String name, String cmdType, String planPath)
throws Exception;
public ProjectPlanCase get(int id) throws Exception;
// public List findByPage(final String hql, final int offset,final int pageSize);
//
// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize);
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(ProjectPlanCase projectplancase,String hql);
public List<ProjectPlanCase> findJobsList();
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.ProjectPlanCase;
@Transactional
public interface ProjectPlanCaseDao {
public int add(ProjectPlanCase projectplancase) throws Exception;
public void modify(ProjectPlanCase projectplancase) throws Exception;
public void modifyState(ProjectPlanCase projectplancase) throws Exception;
public void modifyInfo(ProjectPlanCase projectplancase) throws Exception;
public void delete(ProjectPlanCase projectplancase) throws Exception;
public void delete(String hql, int id) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectPlanCase> list(ProjectPlanCase projectplancase) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectPlanCase> list(String hql) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List getList(String sql) throws Exception;
public ProjectPlanCase load(int id) throws Exception;
public List<ProjectPlanCase> load(String name, String cmdType, String planPath)
throws Exception;
public ProjectPlanCase get(int id) throws Exception;
// public List findByPage(final String hql, final int offset,final int pageSize);
//
// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize);
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(ProjectPlanCase projectplancase,String hql);
public List<ProjectPlanCase> findJobsList();
}

View File

@ -1,205 +1,205 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.ProjectCasesteps;
import luckyweb.seagull.spring.entity.ProjectPlanCase;
@Repository("projectPlanCaseDao")
public class ProjectPlanCaseDaoImpl extends HibernateDaoSupport implements ProjectPlanCaseDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void delete(ProjectPlanCase projectplancase) throws Exception {
try{
this.getHibernateTemplate().delete(projectplancase);
}catch(Exception e){
e.printStackTrace();
}
}
@Override
public void delete(String hql, int id) throws Exception {
Session session=this.getSession(true);
session.beginTransaction();
Query query =session .createQuery(hql);
query.setInteger("planId", id);
query.executeUpdate();
session.getTransaction().commit();
session.close();
}
private void whereParameter(ProjectPlanCase projectplancase, Query query) {
if (projectplancase.getCaseid()!=0) {
query.setParameter("caseid", projectplancase.getCaseid());
}
if (projectplancase.getPlanid()!=0) {
query.setParameter("planid", projectplancase.getPlanid());
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((ProjectPlanCase)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(ProjectPlanCase projectplancase, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(projectplancase, query);
if(0==query.list().size()){
return 0;
}
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int add(ProjectPlanCase projectplancase) throws Exception {
this.getHibernateTemplate().save(projectplancase);
return projectplancase.getId();
}
@Override
public void modify(ProjectPlanCase projectplancase) throws Exception {
this.getHibernateTemplate().update(projectplancase);
}
@Override
public void modifyState(ProjectPlanCase projectplancase) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void modifyInfo(ProjectPlanCase projectplancase) throws Exception {
// TODO Auto-generated method stub
}
@Override
public List<ProjectPlanCase> list(ProjectPlanCase projectplancase)
throws Exception {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("unchecked")
@Override
public List<ProjectPlanCase> list(String hql) throws Exception {
return this.getHibernateTemplate().find(hql);
}
@Override
public ProjectPlanCase load(int id) throws Exception {
return (ProjectPlanCase) this.getHibernateTemplate().get(ProjectPlanCase.class, id);
//return (ProjectCase) this.getSession().load(ProjectCase.class, id);
}
@Override
public List<ProjectPlanCase> load(String name, String cmdType,
String planPath) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public ProjectPlanCase get(int id) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public List<ProjectPlanCase> findJobsList() {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("rawtypes")
@Override
public List<ProjectPlanCase> getList(String sql) throws Exception {
// TODO Auto-generated method stub
List<ProjectPlanCase> count=null;
Session session=this.getSession(true);
try {
count = session.createQuery(sql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return count;
}
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.ProjectCasesteps;
import luckyweb.seagull.spring.entity.ProjectPlanCase;
@Repository("projectPlanCaseDao")
public class ProjectPlanCaseDaoImpl extends HibernateDaoSupport implements ProjectPlanCaseDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void delete(ProjectPlanCase projectplancase) throws Exception {
try{
this.getHibernateTemplate().delete(projectplancase);
}catch(Exception e){
e.printStackTrace();
}
}
@Override
public void delete(String hql, int id) throws Exception {
Session session=this.getSession(true);
session.beginTransaction();
Query query =session .createQuery(hql);
query.setInteger("planId", id);
query.executeUpdate();
session.getTransaction().commit();
session.close();
}
private void whereParameter(ProjectPlanCase projectplancase, Query query) {
if (projectplancase.getCaseid()!=0) {
query.setParameter("caseid", projectplancase.getCaseid());
}
if (projectplancase.getPlanid()!=0) {
query.setParameter("planid", projectplancase.getPlanid());
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((ProjectPlanCase)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(ProjectPlanCase projectplancase, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(projectplancase, query);
if(0==query.list().size()){
return 0;
}
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int add(ProjectPlanCase projectplancase) throws Exception {
this.getHibernateTemplate().save(projectplancase);
return projectplancase.getId();
}
@Override
public void modify(ProjectPlanCase projectplancase) throws Exception {
this.getHibernateTemplate().update(projectplancase);
}
@Override
public void modifyState(ProjectPlanCase projectplancase) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void modifyInfo(ProjectPlanCase projectplancase) throws Exception {
// TODO Auto-generated method stub
}
@Override
public List<ProjectPlanCase> list(ProjectPlanCase projectplancase)
throws Exception {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("unchecked")
@Override
public List<ProjectPlanCase> list(String hql) throws Exception {
return this.getHibernateTemplate().find(hql);
}
@Override
public ProjectPlanCase load(int id) throws Exception {
return (ProjectPlanCase) this.getHibernateTemplate().get(ProjectPlanCase.class, id);
//return (ProjectCase) this.getSession().load(ProjectCase.class, id);
}
@Override
public List<ProjectPlanCase> load(String name, String cmdType,
String planPath) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public ProjectPlanCase get(int id) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public List<ProjectPlanCase> findJobsList() {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("rawtypes")
@Override
public List<ProjectPlanCase> getList(String sql) throws Exception {
// TODO Auto-generated method stub
List<ProjectPlanCase> count=null;
Session session=this.getSession(true);
try {
count = session.createQuery(sql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return count;
}
}

View File

@ -1,49 +1,49 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.ProjectPlan;
@Transactional
public interface ProjectPlanDao {
public int add(ProjectPlan projectplan) throws Exception;
public void modify(ProjectPlan projectplan) throws Exception;
public void modifyState(ProjectPlan projectplan) throws Exception;
public void modifyInfo(ProjectPlan projectplan) throws Exception;
public void delete(ProjectPlan projectplan) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectPlan> list(ProjectPlan projectplan) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectPlan> list(String hql) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List getList(String sql) throws Exception;
public ProjectPlan load(int id) throws Exception;
public List<ProjectPlan> load(String name, String cmdType, String planPath)
throws Exception;
public ProjectPlan get(int id) throws Exception;
// public List findByPage(final String hql, final int offset,final int pageSize);
//
// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize);
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(ProjectPlan projectplan,String hql);
public List<ProjectPlan> findJobsList();
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.ProjectPlan;
@Transactional
public interface ProjectPlanDao {
public int add(ProjectPlan projectplan) throws Exception;
public void modify(ProjectPlan projectplan) throws Exception;
public void modifyState(ProjectPlan projectplan) throws Exception;
public void modifyInfo(ProjectPlan projectplan) throws Exception;
public void delete(ProjectPlan projectplan) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectPlan> list(ProjectPlan projectplan) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectPlan> list(String hql) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List getList(String sql) throws Exception;
public ProjectPlan load(int id) throws Exception;
public List<ProjectPlan> load(String name, String cmdType, String planPath)
throws Exception;
public ProjectPlan get(int id) throws Exception;
// public List findByPage(final String hql, final int offset,final int pageSize);
//
// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize);
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(ProjectPlan projectplan,String hql);
public List<ProjectPlan> findJobsList();
}

View File

@ -1,196 +1,196 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.ProjectPlan;
@Repository("projectPlanDao")
public class ProjectPlanDaoImpl extends HibernateDaoSupport implements ProjectPlanDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void delete(ProjectPlan projectplan) throws Exception {
try{
this.getHibernateTemplate().delete(projectplan);
}catch(Exception e){
e.printStackTrace();
}
}
private void whereParameter(ProjectPlan projectplan, Query query) {
if (projectplan.getProjectid()!=0&&projectplan.getProjectid()!=99) {
query.setParameter("projectid", projectplan.getProjectid());
}
if (null!=projectplan.getName()&&!"".equals(projectplan.getName())) {
query.setParameter("name", "%"+projectplan.getName()+"%");
}
if (null!=projectplan.getOperationer()&&!"".equals(projectplan.getOperationer())) {
query.setParameter("operationer", "%"+projectplan.getOperationer()+"%");
}
if (null!=projectplan.getRemark()&&!"".equals(projectplan.getRemark())) {
query.setParameter("remark", "%"+projectplan.getRemark()+"%");
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((ProjectPlan)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(ProjectPlan projectplan, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(projectplan, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int add(ProjectPlan projectplan) throws Exception {
this.getHibernateTemplate().save(projectplan);
return projectplan.getId();
}
@Override
public void modify(ProjectPlan projectplan) throws Exception {
this.getHibernateTemplate().update(projectplan);
}
@Override
public void modifyState(ProjectPlan projectplan) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void modifyInfo(ProjectPlan projectplan) throws Exception {
// TODO Auto-generated method stub
}
@Override
public List<ProjectPlan> list(ProjectPlan projectplan)
throws Exception {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("unchecked")
@Override
public List<ProjectPlan> list(String hql) throws Exception {
return this.getHibernateTemplate().find(hql);
}
@Override
public ProjectPlan load(int id) throws Exception {
return (ProjectPlan) this.getHibernateTemplate().get(ProjectPlan.class, id);
//return (ProjectCase) this.getSession().load(ProjectCase.class, id);
}
@Override
public List<ProjectPlan> load(String name, String cmdType,
String planPath) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public ProjectPlan get(int id) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public List<ProjectPlan> findJobsList() {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("rawtypes")
@Override
public List<ProjectPlan> getList(String sql) throws Exception {
// TODO Auto-generated method stub
List<ProjectPlan> count=null;
Session session=this.getSession(true);
try {
count = session.createQuery(sql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return count;
}
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.ProjectPlan;
@Repository("projectPlanDao")
public class ProjectPlanDaoImpl extends HibernateDaoSupport implements ProjectPlanDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void delete(ProjectPlan projectplan) throws Exception {
try{
this.getHibernateTemplate().delete(projectplan);
}catch(Exception e){
e.printStackTrace();
}
}
private void whereParameter(ProjectPlan projectplan, Query query) {
if (projectplan.getProjectid()!=0&&projectplan.getProjectid()!=99) {
query.setParameter("projectid", projectplan.getProjectid());
}
if (null!=projectplan.getName()&&!"".equals(projectplan.getName())) {
query.setParameter("name", "%"+projectplan.getName()+"%");
}
if (null!=projectplan.getOperationer()&&!"".equals(projectplan.getOperationer())) {
query.setParameter("operationer", "%"+projectplan.getOperationer()+"%");
}
if (null!=projectplan.getRemark()&&!"".equals(projectplan.getRemark())) {
query.setParameter("remark", "%"+projectplan.getRemark()+"%");
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((ProjectPlan)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(ProjectPlan projectplan, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(projectplan, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int add(ProjectPlan projectplan) throws Exception {
this.getHibernateTemplate().save(projectplan);
return projectplan.getId();
}
@Override
public void modify(ProjectPlan projectplan) throws Exception {
this.getHibernateTemplate().update(projectplan);
}
@Override
public void modifyState(ProjectPlan projectplan) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void modifyInfo(ProjectPlan projectplan) throws Exception {
// TODO Auto-generated method stub
}
@Override
public List<ProjectPlan> list(ProjectPlan projectplan)
throws Exception {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("unchecked")
@Override
public List<ProjectPlan> list(String hql) throws Exception {
return this.getHibernateTemplate().find(hql);
}
@Override
public ProjectPlan load(int id) throws Exception {
return (ProjectPlan) this.getHibernateTemplate().get(ProjectPlan.class, id);
//return (ProjectCase) this.getSession().load(ProjectCase.class, id);
}
@Override
public List<ProjectPlan> load(String name, String cmdType,
String planPath) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public ProjectPlan get(int id) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public List<ProjectPlan> findJobsList() {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("rawtypes")
@Override
public List<ProjectPlan> getList(String sql) throws Exception {
// TODO Auto-generated method stub
List<ProjectPlan> count=null;
Session session=this.getSession(true);
try {
count = session.createQuery(sql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return count;
}
}

View File

@ -1,23 +1,23 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.ProjectProtocolTemplate;
@Transactional
public interface ProjectProtocolTemplateDao {
public ProjectProtocolTemplate load(int id) throws Exception;
public int add(ProjectProtocolTemplate ppt) throws Exception;
public void modify(ProjectProtocolTemplate ppt) throws Exception;
public List findByPage(final String hql, final Object value, final int offset, final int pageSize);
public int findRows(ProjectProtocolTemplate ppt, String hql);
public void delete(String hql) throws Exception;
public void deleteforob(ProjectProtocolTemplate ppt) throws Exception;
public List findstepsparamList(String hql);
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.ProjectProtocolTemplate;
@Transactional
public interface ProjectProtocolTemplateDao {
public ProjectProtocolTemplate load(int id) throws Exception;
public int add(ProjectProtocolTemplate ppt) throws Exception;
public void modify(ProjectProtocolTemplate ppt) throws Exception;
public List findByPage(final String hql, final Object value, final int offset, final int pageSize);
public int findRows(ProjectProtocolTemplate ppt, String hql);
public void delete(String hql) throws Exception;
public void deleteforob(ProjectProtocolTemplate ppt) throws Exception;
public List findstepsparamList(String hql);
}

View File

@ -1,147 +1,147 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.ProjectPlan;
import luckyweb.seagull.spring.entity.ProjectProtocolTemplate;
import luckyweb.seagull.spring.entity.ProjectTemplateParams;
import luckyweb.seagull.util.StrLib;
@Repository("projectprotocoltemplateDao")
public class ProjectProtocolTemplateImpl extends HibernateDaoSupport implements ProjectProtocolTemplateDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public ProjectProtocolTemplate load(int id) throws Exception {
//return (UserInfo)this.getSession().get(UserInfo.class, id);
return (ProjectProtocolTemplate) this.getHibernateTemplate().get(ProjectProtocolTemplate.class, id);
}
@Override
public int add(ProjectProtocolTemplate ppt) throws Exception {
this.getHibernateTemplate().save(ppt);
return ppt.getId();
}
@Override
public void modify(ProjectProtocolTemplate ppt) throws Exception {
this.getHibernateTemplate().update(ppt);
}
@Override
public void deleteforob(ProjectProtocolTemplate ppt) throws Exception {
try{
this.getHibernateTemplate().delete(ppt);
}catch(Exception e){
e.printStackTrace();
}
}
private void whereParameter(ProjectProtocolTemplate ppt, Query query) {
if (ppt.getProjectid()!=0&&ppt.getProjectid()!=99) {
query.setParameter("projectid", ppt.getProjectid());
}
if (!StrLib.isEmpty(ppt.getProtocoltype())) {
query.setParameter("protocoltype", ppt.getProtocoltype());
}
if (ppt.getOperationer()!=null&&!ppt.getOperationer().equals("")) {
query.setParameter("operationer", "%"+ppt.getOperationer()+"%");
}
if (ppt.getName()!=null&&!ppt.getName().equals("")) {
query.setParameter("name", "%"+ppt.getName()+"%");
}
if (ppt.getRemark()!=null&&!ppt.getRemark().equals("")) {
query.setParameter("remark", "%"+ppt.getRemark()+"%");
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((ProjectProtocolTemplate)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(ProjectProtocolTemplate ppt, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(ppt, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public void delete(String hql) throws Exception {
Session session=this.getSession(true);
try {
session.beginTransaction();
Query query =session .createQuery(hql);
query.executeUpdate();
session.getTransaction().commit();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
}
@Override
public List findstepsparamList(String hql) {
Session session = this.getSession(true);
List count=null;
try {
count = session.createSQLQuery(hql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return count;
}
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.ProjectPlan;
import luckyweb.seagull.spring.entity.ProjectProtocolTemplate;
import luckyweb.seagull.spring.entity.ProjectTemplateParams;
import luckyweb.seagull.util.StrLib;
@Repository("projectprotocoltemplateDao")
public class ProjectProtocolTemplateImpl extends HibernateDaoSupport implements ProjectProtocolTemplateDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public ProjectProtocolTemplate load(int id) throws Exception {
//return (UserInfo)this.getSession().get(UserInfo.class, id);
return (ProjectProtocolTemplate) this.getHibernateTemplate().get(ProjectProtocolTemplate.class, id);
}
@Override
public int add(ProjectProtocolTemplate ppt) throws Exception {
this.getHibernateTemplate().save(ppt);
return ppt.getId();
}
@Override
public void modify(ProjectProtocolTemplate ppt) throws Exception {
this.getHibernateTemplate().update(ppt);
}
@Override
public void deleteforob(ProjectProtocolTemplate ppt) throws Exception {
try{
this.getHibernateTemplate().delete(ppt);
}catch(Exception e){
e.printStackTrace();
}
}
private void whereParameter(ProjectProtocolTemplate ppt, Query query) {
if (ppt.getProjectid()!=0&&ppt.getProjectid()!=99) {
query.setParameter("projectid", ppt.getProjectid());
}
if (!StrLib.isEmpty(ppt.getProtocoltype())) {
query.setParameter("protocoltype", ppt.getProtocoltype());
}
if (ppt.getOperationer()!=null&&!ppt.getOperationer().equals("")) {
query.setParameter("operationer", "%"+ppt.getOperationer()+"%");
}
if (ppt.getName()!=null&&!ppt.getName().equals("")) {
query.setParameter("name", "%"+ppt.getName()+"%");
}
if (ppt.getRemark()!=null&&!ppt.getRemark().equals("")) {
query.setParameter("remark", "%"+ppt.getRemark()+"%");
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((ProjectProtocolTemplate)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(ProjectProtocolTemplate ppt, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(ppt, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public void delete(String hql) throws Exception {
Session session=this.getSession(true);
try {
session.beginTransaction();
Query query =session .createQuery(hql);
query.executeUpdate();
session.getTransaction().commit();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
}
@Override
public List findstepsparamList(String hql) {
Session session = this.getSession(true);
List count=null;
try {
count = session.createSQLQuery(hql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return count;
}
}

View File

@ -1,24 +1,24 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.ProjectTemplateParams;
@Transactional
public interface ProjectTemplateParamsDao {
public ProjectTemplateParams load(int id) throws Exception;
public int add(ProjectTemplateParams ptp) throws Exception;
public List findByPage(final String hql, final Object value, final int offset, final int pageSize);
public int findRows(ProjectTemplateParams ptp, String hql);
public void delete(String hql) throws Exception;
public void deleteforob(ProjectTemplateParams ptp) throws Exception;
public void modify(ProjectTemplateParams ptp) throws Exception;
public List<ProjectTemplateParams> getParamsList(String sql) throws Exception;
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.ProjectTemplateParams;
@Transactional
public interface ProjectTemplateParamsDao {
public ProjectTemplateParams load(int id) throws Exception;
public int add(ProjectTemplateParams ptp) throws Exception;
public List findByPage(final String hql, final Object value, final int offset, final int pageSize);
public int findRows(ProjectTemplateParams ptp, String hql);
public void delete(String hql) throws Exception;
public void deleteforob(ProjectTemplateParams ptp) throws Exception;
public void modify(ProjectTemplateParams ptp) throws Exception;
public List<ProjectTemplateParams> getParamsList(String sql) throws Exception;
}

View File

@ -1,139 +1,139 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.ProjectCase;
import luckyweb.seagull.spring.entity.ProjectCasesteps;
import luckyweb.seagull.spring.entity.ProjectPlanCase;
import luckyweb.seagull.spring.entity.ProjectProtocolTemplate;
import luckyweb.seagull.spring.entity.ProjectTemplateParams;
@Repository("projecttemplateparamsDao")
public class ProjectTemplateParamsImpl extends HibernateDaoSupport implements ProjectTemplateParamsDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public ProjectTemplateParams load(int id) throws Exception {
//return (UserInfo)this.getSession().get(UserInfo.class, id);
return (ProjectTemplateParams) this.getHibernateTemplate().get(ProjectTemplateParams.class, id);
}
@Override
public int add(ProjectTemplateParams ptp) throws Exception {
this.getHibernateTemplate().save(ptp);
return ptp.getId();
}
@Override
public void deleteforob(ProjectTemplateParams ptp) throws Exception {
try{
this.getHibernateTemplate().delete(ptp);
}catch(Exception e){
e.printStackTrace();
}
}
@Override
public void modify(ProjectTemplateParams ptp) throws Exception {
this.getHibernateTemplate().update(ptp);
}
private void whereParameter(ProjectTemplateParams ptp, Query query) {
if (ptp.getTemplateid()!=0) {
query.setParameter("templateid", ptp.getTemplateid());
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((ProjectTemplateParams)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(ProjectTemplateParams ptp, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(ptp, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public void delete(String hql) throws Exception {
Session session=this.getSession(true);
try {
session.beginTransaction();
Query query =session .createQuery(hql);
query.executeUpdate();
session.getTransaction().commit();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
}
@SuppressWarnings("rawtypes")
@Override
public List<ProjectTemplateParams> getParamsList(String sql) throws Exception {
// TODO Auto-generated method stub
List<ProjectTemplateParams> list=null;
Session session=this.getSession(true);
try {
list = session.createQuery(sql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return list;
}
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.ProjectCase;
import luckyweb.seagull.spring.entity.ProjectCasesteps;
import luckyweb.seagull.spring.entity.ProjectPlanCase;
import luckyweb.seagull.spring.entity.ProjectProtocolTemplate;
import luckyweb.seagull.spring.entity.ProjectTemplateParams;
@Repository("projecttemplateparamsDao")
public class ProjectTemplateParamsImpl extends HibernateDaoSupport implements ProjectTemplateParamsDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public ProjectTemplateParams load(int id) throws Exception {
//return (UserInfo)this.getSession().get(UserInfo.class, id);
return (ProjectTemplateParams) this.getHibernateTemplate().get(ProjectTemplateParams.class, id);
}
@Override
public int add(ProjectTemplateParams ptp) throws Exception {
this.getHibernateTemplate().save(ptp);
return ptp.getId();
}
@Override
public void deleteforob(ProjectTemplateParams ptp) throws Exception {
try{
this.getHibernateTemplate().delete(ptp);
}catch(Exception e){
e.printStackTrace();
}
}
@Override
public void modify(ProjectTemplateParams ptp) throws Exception {
this.getHibernateTemplate().update(ptp);
}
private void whereParameter(ProjectTemplateParams ptp, Query query) {
if (ptp.getTemplateid()!=0) {
query.setParameter("templateid", ptp.getTemplateid());
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((ProjectTemplateParams)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(ProjectTemplateParams ptp, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(ptp, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public void delete(String hql) throws Exception {
Session session=this.getSession(true);
try {
session.beginTransaction();
Query query =session .createQuery(hql);
query.executeUpdate();
session.getTransaction().commit();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
}
@SuppressWarnings("rawtypes")
@Override
public List<ProjectTemplateParams> getParamsList(String sql) throws Exception {
// TODO Auto-generated method stub
List<ProjectTemplateParams> list=null;
Session session=this.getSession(true);
try {
list = session.createQuery(sql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return list;
}
}

View File

@ -1,51 +1,51 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.ProjectVersion;
@Transactional
public interface ProjectVersionDao {
public int add(ProjectVersion projectversion) throws Exception;
public void modify(ProjectVersion projectversion) throws Exception;
public void modifyState(ProjectVersion projectversion) throws Exception;
public void modifyInfo(ProjectVersion projectversion) throws Exception;
public void delete(int id) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectVersion> list(ProjectVersion projectversion) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectVersion> list(String hql) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List listavgpro(String sql) throws Exception;
public ProjectVersion load(int id) throws Exception;
public List<ProjectVersion> load(String name, String cmdType, String planPath)
throws Exception;
public ProjectVersion get(int id) throws Exception;
// public List findByPage(final String hql, final int offset,final int pageSize);
//
// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize);
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public List findByPagereport(final String hql, final int offset, final int pageSize);
public int findRows(ProjectVersion projectversion,String hql);
public int findRowsreport(String hql);
public List<ProjectVersion> findJobsList();
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.ProjectVersion;
@Transactional
public interface ProjectVersionDao {
public int add(ProjectVersion projectversion) throws Exception;
public void modify(ProjectVersion projectversion) throws Exception;
public void modifyState(ProjectVersion projectversion) throws Exception;
public void modifyInfo(ProjectVersion projectversion) throws Exception;
public void delete(int id) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectVersion> list(ProjectVersion projectversion) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ProjectVersion> list(String hql) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List listavgpro(String sql) throws Exception;
public ProjectVersion load(int id) throws Exception;
public List<ProjectVersion> load(String name, String cmdType, String planPath)
throws Exception;
public ProjectVersion get(int id) throws Exception;
// public List findByPage(final String hql, final int offset,final int pageSize);
//
// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize);
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public List findByPagereport(final String hql, final int offset, final int pageSize);
public int findRows(ProjectVersion projectversion,String hql);
public int findRowsreport(String hql);
public List<ProjectVersion> findJobsList();
}

View File

@ -1,239 +1,239 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.ProjectVersion;
import luckyweb.seagull.util.StrLib;
@Repository("projectversionDao")
public class ProjectVersionDaoImpl extends HibernateDaoSupport implements ProjectVersionDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void delete(int versionid) throws Exception {
try{
ProjectVersion projectversion = this.load(versionid);
this.getHibernateTemplate().delete(projectversion);
}catch(Exception e){
e.printStackTrace();
}
}
private void whereParameter(ProjectVersion projectversion, Query query) {
if (projectversion.getProjectid()!=0&&projectversion.getProjectid()!=99) {
query.setParameter("projectid", projectversion.getProjectid());
}
if (!StrLib.isEmpty(projectversion.getStartactually_launchdate())) {
query.setParameter("startactually_launchdate", projectversion.getStartactually_launchdate());
}
if (!StrLib.isEmpty(projectversion.getEndactually_launchdate())) {
query.setParameter("endactually_launchdate", projectversion.getEndactually_launchdate());
}
if (!StrLib.isEmpty(projectversion.getVersionnumber())) {
query.setParameter("versionnumber", "%"+projectversion.getVersionnumber().trim()+"%");
}
if (!StrLib.isEmpty(projectversion.getImprint())) {
query.setParameter("imprint", "%"+projectversion.getImprint().trim()+"%");
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((ProjectVersion)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public List findByPagereport(final String hql,final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
//Query query= session.createQuery(hql);
Query query= session.createSQLQuery(hql);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(ProjectVersion projectversion, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(projectversion, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int findRowsreport(String hql) {
int s=0;
Session session=this.getSession(true);
try {
/*Query query=session.createQuery(hql);*/
Query query= session.createSQLQuery(hql);
s= Integer.valueOf(
query.list().size());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int add(ProjectVersion projectversion) throws Exception {
this.getHibernateTemplate().save(projectversion);
return projectversion.getVersionid();
}
@Override
public void modify(ProjectVersion projectversion) throws Exception {
this.getHibernateTemplate().update(projectversion);
}
@Override
public void modifyState(ProjectVersion projectversion) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void modifyInfo(ProjectVersion projectversion) throws Exception {
// TODO Auto-generated method stub
}
@Override
public List<ProjectVersion> list(ProjectVersion projectversion)
throws Exception {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("unchecked")
@Override
public List<ProjectVersion> list(String hql) throws Exception {
return this.getHibernateTemplate().find(hql);
}
@Override
public ProjectVersion load(int versionid) throws Exception {
return (ProjectVersion) this.getHibernateTemplate().get(ProjectVersion.class, versionid);
//return (ProjectVersion) this.getSession().load(ProjectVersion.class, versionid);
}
@Override
public List<ProjectVersion> load(String name, String cmdType,
String planPath) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public ProjectVersion get(int id) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public List<ProjectVersion> findJobsList() {
// TODO Auto-generated method stub
return null;
}
@Override
public List listavgpro(String sql) throws Exception {
// TODO Auto-generated method stub
// List<TestTastexcute> list=new ArrayList<TestTastexcute>();
List count=null;
Session session=this.getSession(true);
try {
count = session.createSQLQuery(sql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return count;
}
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.ProjectVersion;
import luckyweb.seagull.util.StrLib;
@Repository("projectversionDao")
public class ProjectVersionDaoImpl extends HibernateDaoSupport implements ProjectVersionDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void delete(int versionid) throws Exception {
try{
ProjectVersion projectversion = this.load(versionid);
this.getHibernateTemplate().delete(projectversion);
}catch(Exception e){
e.printStackTrace();
}
}
private void whereParameter(ProjectVersion projectversion, Query query) {
if (projectversion.getProjectid()!=0&&projectversion.getProjectid()!=99) {
query.setParameter("projectid", projectversion.getProjectid());
}
if (!StrLib.isEmpty(projectversion.getStartactually_launchdate())) {
query.setParameter("startactually_launchdate", projectversion.getStartactually_launchdate());
}
if (!StrLib.isEmpty(projectversion.getEndactually_launchdate())) {
query.setParameter("endactually_launchdate", projectversion.getEndactually_launchdate());
}
if (!StrLib.isEmpty(projectversion.getVersionnumber())) {
query.setParameter("versionnumber", "%"+projectversion.getVersionnumber().trim()+"%");
}
if (!StrLib.isEmpty(projectversion.getImprint())) {
query.setParameter("imprint", "%"+projectversion.getImprint().trim()+"%");
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((ProjectVersion)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public List findByPagereport(final String hql,final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
//Query query= session.createQuery(hql);
Query query= session.createSQLQuery(hql);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(ProjectVersion projectversion, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(projectversion, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int findRowsreport(String hql) {
int s=0;
Session session=this.getSession(true);
try {
/*Query query=session.createQuery(hql);*/
Query query= session.createSQLQuery(hql);
s= Integer.valueOf(
query.list().size());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int add(ProjectVersion projectversion) throws Exception {
this.getHibernateTemplate().save(projectversion);
return projectversion.getVersionid();
}
@Override
public void modify(ProjectVersion projectversion) throws Exception {
this.getHibernateTemplate().update(projectversion);
}
@Override
public void modifyState(ProjectVersion projectversion) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void modifyInfo(ProjectVersion projectversion) throws Exception {
// TODO Auto-generated method stub
}
@Override
public List<ProjectVersion> list(ProjectVersion projectversion)
throws Exception {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("unchecked")
@Override
public List<ProjectVersion> list(String hql) throws Exception {
return this.getHibernateTemplate().find(hql);
}
@Override
public ProjectVersion load(int versionid) throws Exception {
return (ProjectVersion) this.getHibernateTemplate().get(ProjectVersion.class, versionid);
//return (ProjectVersion) this.getSession().load(ProjectVersion.class, versionid);
}
@Override
public List<ProjectVersion> load(String name, String cmdType,
String planPath) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public ProjectVersion get(int id) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public List<ProjectVersion> findJobsList() {
// TODO Auto-generated method stub
return null;
}
@Override
public List listavgpro(String sql) throws Exception {
// TODO Auto-generated method stub
// List<TestTastexcute> list=new ArrayList<TestTastexcute>();
List count=null;
Session session=this.getSession(true);
try {
count = session.createSQLQuery(sql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return count;
}
}

View File

@ -1,27 +1,27 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.Review;
@Transactional
public interface ReviewDao {
public int add(Review review) throws Exception;
public void modify(Review review) throws Exception;
public void delete(int id) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<Review> list(Review review) throws Exception;
public Review get(int id) throws Exception;
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(Review review,String hql);
public void update(String hql) throws Exception;
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.Review;
@Transactional
public interface ReviewDao {
public int add(Review review) throws Exception;
public void modify(Review review) throws Exception;
public void delete(int id) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<Review> list(Review review) throws Exception;
public Review get(int id) throws Exception;
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(Review review,String hql);
public void update(String hql) throws Exception;
}

View File

@ -1,142 +1,142 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.Review;
@Repository("reviewDao")
public class ReviewDaoImpl extends HibernateDaoSupport implements ReviewDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void delete(int id) throws Exception {
try{
Review review = this.get(id);
this.getHibernateTemplate().delete(review);
}catch(Exception e){
e.printStackTrace();
}
}
@Override
public void update(String hql) throws Exception {
Session session=this.getSession(true);
session.beginTransaction();
Query query =session .createQuery(hql);
query.executeUpdate();
session.getTransaction().commit();
session.close();
}
private void whereParameter(Review review, Query query) {
if (review.getProjectid()!=0) {
query.setParameter("projectid", review.getProjectid());
}
if (review.getReview_startdate()!=null&&!"".equals(review.getReview_startdate())) {
query.setParameter("review_startdate", review.getReview_startdate());
}
if (review.getReview_enddate()!=null&&!"".equals(review.getReview_enddate())) {
query.setParameter("review_enddate", review.getReview_enddate());
}
if (null!=review.getVersion()&&!"".equals(review.getVersion())) {
query.setParameter("version", "%"+review.getVersion()+"%");
}
if (null!=review.getReview_type()&&!"".equals(review.getReview_type())) {
query.setParameter("review_type", "%"+review.getReview_type()+"%");
}
if (null!=review.getReview_result()&&!"".equals(review.getReview_result())) {
query.setParameter("review_result", "%"+review.getReview_result()+"%");
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((Review)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(Review review, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(review, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int add(Review review) throws Exception {
this.getHibernateTemplate().save(review);
return review.getId();
}
@Override
public void modify(Review review) throws Exception {
this.getHibernateTemplate().update(review);
}
@Override
public List<Review> list(Review review)
throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public Review get(int id) throws Exception {
// TODO Auto-generated method stub
return (Review) this.getHibernateTemplate().get(Review.class, id);
}
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.Review;
@Repository("reviewDao")
public class ReviewDaoImpl extends HibernateDaoSupport implements ReviewDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void delete(int id) throws Exception {
try{
Review review = this.get(id);
this.getHibernateTemplate().delete(review);
}catch(Exception e){
e.printStackTrace();
}
}
@Override
public void update(String hql) throws Exception {
Session session=this.getSession(true);
session.beginTransaction();
Query query =session .createQuery(hql);
query.executeUpdate();
session.getTransaction().commit();
session.close();
}
private void whereParameter(Review review, Query query) {
if (review.getProjectid()!=0) {
query.setParameter("projectid", review.getProjectid());
}
if (review.getReview_startdate()!=null&&!"".equals(review.getReview_startdate())) {
query.setParameter("review_startdate", review.getReview_startdate());
}
if (review.getReview_enddate()!=null&&!"".equals(review.getReview_enddate())) {
query.setParameter("review_enddate", review.getReview_enddate());
}
if (null!=review.getVersion()&&!"".equals(review.getVersion())) {
query.setParameter("version", "%"+review.getVersion()+"%");
}
if (null!=review.getReview_type()&&!"".equals(review.getReview_type())) {
query.setParameter("review_type", "%"+review.getReview_type()+"%");
}
if (null!=review.getReview_result()&&!"".equals(review.getReview_result())) {
query.setParameter("review_result", "%"+review.getReview_result()+"%");
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((Review)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(Review review, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(review, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int add(Review review) throws Exception {
this.getHibernateTemplate().save(review);
return review.getId();
}
@Override
public void modify(Review review) throws Exception {
this.getHibernateTemplate().update(review);
}
@Override
public List<Review> list(Review review)
throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public Review get(int id) throws Exception {
// TODO Auto-generated method stub
return (Review) this.getHibernateTemplate().get(Review.class, id);
}
}

View File

@ -1,29 +1,29 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.ReviewInfo;
@Transactional
public interface ReviewInfoDao {
public int add(ReviewInfo reviewinfo) throws Exception;
public void modify(ReviewInfo reviewinfo) throws Exception;
public void delete(int id) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ReviewInfo> list(ReviewInfo reviewinfo) throws Exception;
public ReviewInfo get(int id) throws Exception;
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(ReviewInfo reviewinfo,String hql);
public void update(String hql) throws Exception;
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.ReviewInfo;
@Transactional
public interface ReviewInfoDao {
public int add(ReviewInfo reviewinfo) throws Exception;
public void modify(ReviewInfo reviewinfo) throws Exception;
public void delete(int id) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<ReviewInfo> list(ReviewInfo reviewinfo) throws Exception;
public ReviewInfo get(int id) throws Exception;
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(ReviewInfo reviewinfo,String hql);
public void update(String hql) throws Exception;
}

View File

@ -1,129 +1,129 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.ReviewInfo;
@Repository("reviewInfoDao")
public class ReviewInfoDaoImpl extends HibernateDaoSupport implements ReviewInfoDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void delete(int id) throws Exception {
try{
ReviewInfo reviewinfo = this.get(id);
this.getHibernateTemplate().delete(reviewinfo);
}catch(Exception e){
e.printStackTrace();
}
}
@Override
public void update(String hql) throws Exception {
Session session=this.getSession(true);
session.beginTransaction();
Query query =session .createQuery(hql);
query.executeUpdate();
session.getTransaction().commit();
session.close();
}
private void whereParameter(ReviewInfo reviewinfo, Query query) {
if (reviewinfo.getReview_id()!=0) {
query.setParameter("review_id", reviewinfo.getReview_id());
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((ReviewInfo)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(ReviewInfo reviewinfo, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(reviewinfo, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int add(ReviewInfo reviewinfo) throws Exception {
this.getHibernateTemplate().save(reviewinfo);
return reviewinfo.getId();
}
@Override
public void modify(ReviewInfo reviewinfo) throws Exception {
this.getHibernateTemplate().update(reviewinfo);
}
@Override
public List<ReviewInfo> list(ReviewInfo reviewinfo)
throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public ReviewInfo get(int id) throws Exception {
// TODO Auto-generated method stub
return (ReviewInfo) this.getHibernateTemplate().get(ReviewInfo.class, id);
}
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.ReviewInfo;
@Repository("reviewInfoDao")
public class ReviewInfoDaoImpl extends HibernateDaoSupport implements ReviewInfoDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void delete(int id) throws Exception {
try{
ReviewInfo reviewinfo = this.get(id);
this.getHibernateTemplate().delete(reviewinfo);
}catch(Exception e){
e.printStackTrace();
}
}
@Override
public void update(String hql) throws Exception {
Session session=this.getSession(true);
session.beginTransaction();
Query query =session .createQuery(hql);
query.executeUpdate();
session.getTransaction().commit();
session.close();
}
private void whereParameter(ReviewInfo reviewinfo, Query query) {
if (reviewinfo.getReview_id()!=0) {
query.setParameter("review_id", reviewinfo.getReview_id());
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((ReviewInfo)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(ReviewInfo reviewinfo, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(reviewinfo, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int add(ReviewInfo reviewinfo) throws Exception {
this.getHibernateTemplate().save(reviewinfo);
return reviewinfo.getId();
}
@Override
public void modify(ReviewInfo reviewinfo) throws Exception {
this.getHibernateTemplate().update(reviewinfo);
}
@Override
public List<ReviewInfo> list(ReviewInfo reviewinfo)
throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public ReviewInfo get(int id) throws Exception {
// TODO Auto-generated method stub
return (ReviewInfo) this.getHibernateTemplate().get(ReviewInfo.class, id);
}
}

View File

@ -1,42 +1,42 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.SecondarySector;
@Transactional
public interface SecondarySectorDao {
public int add(SecondarySector sector) throws Exception;
public void modify(SecondarySector sector) throws Exception;
public void modifyState(SecondarySector sector) throws Exception;
public void modifyInfo(SecondarySector sector) throws Exception;
public void delete(SecondarySector sector) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<SecondarySector> list(SecondarySector sector) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<SecondarySector> list() throws Exception;
public SecondarySector load(int id) throws Exception;
public List<SecondarySector> load(String name, String cmdType, String planPath)
throws Exception;
// public List findByPage(final String hql, final int offset,final int pageSize);
//
// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize);
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(SecondarySector sector,String hql);
public List<SecondarySector> findSectorList() throws Exception ;
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.SecondarySector;
@Transactional
public interface SecondarySectorDao {
public int add(SecondarySector sector) throws Exception;
public void modify(SecondarySector sector) throws Exception;
public void modifyState(SecondarySector sector) throws Exception;
public void modifyInfo(SecondarySector sector) throws Exception;
public void delete(SecondarySector sector) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<SecondarySector> list(SecondarySector sector) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<SecondarySector> list() throws Exception;
public SecondarySector load(int id) throws Exception;
public List<SecondarySector> load(String name, String cmdType, String planPath)
throws Exception;
// public List findByPage(final String hql, final int offset,final int pageSize);
//
// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize);
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(SecondarySector sector,String hql);
public List<SecondarySector> findSectorList() throws Exception ;
}

View File

@ -1,154 +1,154 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.SecondarySector;
import luckyweb.seagull.util.StrLib;
@Repository("secondarysectorDao")
public class SecondarySectorDaoImpl extends HibernateDaoSupport implements SecondarySectorDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public int add(SecondarySector sector) throws Exception {
// TODO Auto-generated method stub
this.getHibernateTemplate().save(sector);
return sector.getSectorid();
}
@Override
public void modify(SecondarySector sector) throws Exception {
// TODO Auto-generated method stub
this.getHibernateTemplate().update(sector);
}
@Override
public void modifyState(SecondarySector sector) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void modifyInfo(SecondarySector sector) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void delete(SecondarySector sector) throws Exception {
// TODO Auto-generated method stub
this.getHibernateTemplate().delete(sector);
}
@Override
public List<SecondarySector> list(SecondarySector sector) throws Exception {
// TODO Auto-generated method stub
@SuppressWarnings("unchecked")
List<SecondarySector> list = this.getHibernateTemplate().find(" from SecondarySector");
return list;
}
@SuppressWarnings("unchecked")
@Override
public List<SecondarySector> list() throws Exception {
// TODO Auto-generated method stub
return this.getHibernateTemplate().loadAll(SecondarySector.class);
}
@Override
public SecondarySector load(int id) throws Exception {
// TODO Auto-generated method stub
return (SecondarySector) this.getHibernateTemplate().get(SecondarySector.class, id);
}
@Override
public List<SecondarySector> load(String name, String cmdType,
String planPath) throws Exception {
// TODO Auto-generated method stub
return null;
}
private void whereParameter(SecondarySector ss, Query query) {
if (!StrLib.isEmpty(ss.getDepartmenthead())) {
query.setParameter("departmenthead", "%"+ss.getDepartmenthead().trim()+"%");
}
if (!StrLib.isEmpty(ss.getDepartmentname())) {
query.setParameter("departmentname","%"+ss.getDepartmentname().trim()+"%");
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((SecondarySector)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(SecondarySector sector, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(sector, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@SuppressWarnings("rawtypes")
@Override
public List<SecondarySector> findSectorList() throws Exception {
// TODO Auto-generated method stub
List<SecondarySector> list=null;
Session session=this.getSession(true);
try {
list = session.createQuery(" from SecondarySector order by sectorid").list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return list;
}
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.SecondarySector;
import luckyweb.seagull.util.StrLib;
@Repository("secondarysectorDao")
public class SecondarySectorDaoImpl extends HibernateDaoSupport implements SecondarySectorDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public int add(SecondarySector sector) throws Exception {
// TODO Auto-generated method stub
this.getHibernateTemplate().save(sector);
return sector.getSectorid();
}
@Override
public void modify(SecondarySector sector) throws Exception {
// TODO Auto-generated method stub
this.getHibernateTemplate().update(sector);
}
@Override
public void modifyState(SecondarySector sector) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void modifyInfo(SecondarySector sector) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void delete(SecondarySector sector) throws Exception {
// TODO Auto-generated method stub
this.getHibernateTemplate().delete(sector);
}
@Override
public List<SecondarySector> list(SecondarySector sector) throws Exception {
// TODO Auto-generated method stub
@SuppressWarnings("unchecked")
List<SecondarySector> list = this.getHibernateTemplate().find(" from SecondarySector");
return list;
}
@SuppressWarnings("unchecked")
@Override
public List<SecondarySector> list() throws Exception {
// TODO Auto-generated method stub
return this.getHibernateTemplate().loadAll(SecondarySector.class);
}
@Override
public SecondarySector load(int id) throws Exception {
// TODO Auto-generated method stub
return (SecondarySector) this.getHibernateTemplate().get(SecondarySector.class, id);
}
@Override
public List<SecondarySector> load(String name, String cmdType,
String planPath) throws Exception {
// TODO Auto-generated method stub
return null;
}
private void whereParameter(SecondarySector ss, Query query) {
if (!StrLib.isEmpty(ss.getDepartmenthead())) {
query.setParameter("departmenthead", "%"+ss.getDepartmenthead().trim()+"%");
}
if (!StrLib.isEmpty(ss.getDepartmentname())) {
query.setParameter("departmentname","%"+ss.getDepartmentname().trim()+"%");
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((SecondarySector)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(SecondarySector sector, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(sector, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@SuppressWarnings("rawtypes")
@Override
public List<SecondarySector> findSectorList() throws Exception {
// TODO Auto-generated method stub
List<SecondarySector> list=null;
Session session=this.getSession(true);
try {
list = session.createQuery(" from SecondarySector order by sectorid").list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return list;
}
}

View File

@ -1,45 +1,45 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.SectorProjects;
@Transactional
public interface SectorProjectsDao {
public int add(SectorProjects sectorprojects) throws Exception;
public void modify(SectorProjects sectorprojects) throws Exception;
public void modifyState(SectorProjects sectorprojects) throws Exception;
public void modifyInfo(SectorProjects sectorprojects) throws Exception;
public void delete(SectorProjects sectorprojects) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<SectorProjects> list(SectorProjects sectorprojects) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<SectorProjects> list() throws Exception;
public Object findproject(int projectid) throws Exception;
public List<SectorProjects> load(String name, String cmdType, String planPath)
throws Exception;
public int getid(String projectname) throws Exception;
// public List findByPage(final String hql, final int offset,final int pageSize);
//
// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize);
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(SectorProjects sectorprojects,String hql);
public SectorProjects load(int projectid) throws Exception;
public int projectrow(String hql);
public List<SectorProjects> getAllProject();
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.SectorProjects;
@Transactional
public interface SectorProjectsDao {
public int add(SectorProjects sectorprojects) throws Exception;
public void modify(SectorProjects sectorprojects) throws Exception;
public void modifyState(SectorProjects sectorprojects) throws Exception;
public void modifyInfo(SectorProjects sectorprojects) throws Exception;
public void delete(SectorProjects sectorprojects) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<SectorProjects> list(SectorProjects sectorprojects) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<SectorProjects> list() throws Exception;
public Object findproject(int projectid) throws Exception;
public List<SectorProjects> load(String name, String cmdType, String planPath)
throws Exception;
public int getid(String projectname) throws Exception;
// public List findByPage(final String hql, final int offset,final int pageSize);
//
// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize);
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(SectorProjects sectorprojects,String hql);
public SectorProjects load(int projectid) throws Exception;
public int projectrow(String hql);
public List<SectorProjects> getAllProject();
}

View File

@ -1,214 +1,214 @@
package luckyweb.seagull.spring.dao;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.ProjectVersion;
import luckyweb.seagull.spring.entity.SectorProjects;
import luckyweb.seagull.spring.entity.UserInfo;
import luckyweb.seagull.util.StrLib;
@Repository("sectorprojectsDao")
public class SectorProjectsDaoImpl extends HibernateDaoSupport implements SectorProjectsDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void delete(SectorProjects sectorprojects) throws Exception {
// TODO Auto-generated method stub
this.getHibernateTemplate().delete(sectorprojects);
}
private void whereParameter(SectorProjects sectorprojects, Query query) {
if (!StrLib.isEmpty(sectorprojects.getProjectname())) {
query.setParameter("projectname", "%"+sectorprojects.getProjectname().trim()+"%");
}
if (!StrLib.isEmpty(sectorprojects.getProjectmanager())) {
query.setParameter("projectmanager","%"+sectorprojects.getProjectmanager().trim()+"%");
}
if (!StrLib.isEmpty(sectorprojects.getProjectsign())) {
query.setParameter("projectsign","%"+sectorprojects.getProjectsign().trim()+"%");
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((SectorProjects)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(SectorProjects sectorprojects, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(sectorprojects, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int add(SectorProjects sectorprojects) throws Exception {
this.getHibernateTemplate().save(sectorprojects);
return sectorprojects.getProjectid();
}
@Override
public void modify(SectorProjects sectorprojects) throws Exception {
// TODO Auto-generated method stub
this.getHibernateTemplate().update(sectorprojects);
}
@Override
public void modifyState(SectorProjects sectorprojects) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void modifyInfo(SectorProjects sectorprojects) throws Exception {
// TODO Auto-generated method stub
}
@Override
public List<SectorProjects> list(SectorProjects sectorprojects)
throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public List<SectorProjects> list() throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public Object findproject(int projectid) throws Exception {
// TODO Auto-generated method stub
Session session = this.getSession(true);
List list = session.createSQLQuery("select * from QA_SECTORPROJECTS where projectid="+projectid).list();
session.close();
return list.get(0);
}
@Override
public int getid(String projectname) throws Exception {
// TODO Auto-generated method stub
int projectid = 0;
Session session = this.getSession(true);
@SuppressWarnings("unchecked")
List<Object> list = session.createSQLQuery("select projectid from QA_SECTORPROJECTS where projectname like '%"+projectname+"%'").list();
if(list.size()!=0&&list.get(0)!=null){
projectid = Integer.valueOf(list.get(0).toString());
}else{
projectid = 99;
}
session.close();
return projectid;
}
@Override
public List<SectorProjects> load(String name, String cmdType,
String planPath) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public SectorProjects load(int projectid) throws Exception {
// TODO Auto-generated method stub
return (SectorProjects) this.getHibernateTemplate().get(SectorProjects.class, projectid);
}
@Override
public int projectrow(String hql) {
// List<TestTastexcute> list=new ArrayList<TestTastexcute>();
Session session = this.getSession(true);
int count=0;
try {
count = session.createSQLQuery(hql).list().size();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return count;
// return this.getHibernateTemplate().find("select id,name,planproj from TestJobs order by id asc ");
}
@Override
public List<SectorProjects> getAllProject() {
// List<TestTastexcute> list=new ArrayList<TestTastexcute>();
Session session = this.getSession(true);
List<SectorProjects> list = new ArrayList<>();
try {
list = session.createQuery("from SectorProjects order by projectid asc").list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return list;
// return this.getHibernateTemplate().find("select id,name,planproj from TestJobs order by id asc ");
}
}
package luckyweb.seagull.spring.dao;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.ProjectVersion;
import luckyweb.seagull.spring.entity.SectorProjects;
import luckyweb.seagull.spring.entity.UserInfo;
import luckyweb.seagull.util.StrLib;
@Repository("sectorprojectsDao")
public class SectorProjectsDaoImpl extends HibernateDaoSupport implements SectorProjectsDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void delete(SectorProjects sectorprojects) throws Exception {
// TODO Auto-generated method stub
this.getHibernateTemplate().delete(sectorprojects);
}
private void whereParameter(SectorProjects sectorprojects, Query query) {
if (!StrLib.isEmpty(sectorprojects.getProjectname())) {
query.setParameter("projectname", "%"+sectorprojects.getProjectname().trim()+"%");
}
if (!StrLib.isEmpty(sectorprojects.getProjectmanager())) {
query.setParameter("projectmanager","%"+sectorprojects.getProjectmanager().trim()+"%");
}
if (!StrLib.isEmpty(sectorprojects.getProjectsign())) {
query.setParameter("projectsign","%"+sectorprojects.getProjectsign().trim()+"%");
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((SectorProjects)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(SectorProjects sectorprojects, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(sectorprojects, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int add(SectorProjects sectorprojects) throws Exception {
this.getHibernateTemplate().save(sectorprojects);
return sectorprojects.getProjectid();
}
@Override
public void modify(SectorProjects sectorprojects) throws Exception {
// TODO Auto-generated method stub
this.getHibernateTemplate().update(sectorprojects);
}
@Override
public void modifyState(SectorProjects sectorprojects) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void modifyInfo(SectorProjects sectorprojects) throws Exception {
// TODO Auto-generated method stub
}
@Override
public List<SectorProjects> list(SectorProjects sectorprojects)
throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public List<SectorProjects> list() throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public Object findproject(int projectid) throws Exception {
// TODO Auto-generated method stub
Session session = this.getSession(true);
List list = session.createSQLQuery("select * from QA_SECTORPROJECTS where projectid="+projectid).list();
session.close();
return list.get(0);
}
@Override
public int getid(String projectname) throws Exception {
// TODO Auto-generated method stub
int projectid = 0;
Session session = this.getSession(true);
@SuppressWarnings("unchecked")
List<Object> list = session.createSQLQuery("select projectid from QA_SECTORPROJECTS where projectname like '%"+projectname+"%'").list();
if(list.size()!=0&&list.get(0)!=null){
projectid = Integer.valueOf(list.get(0).toString());
}else{
projectid = 99;
}
session.close();
return projectid;
}
@Override
public List<SectorProjects> load(String name, String cmdType,
String planPath) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public SectorProjects load(int projectid) throws Exception {
// TODO Auto-generated method stub
return (SectorProjects) this.getHibernateTemplate().get(SectorProjects.class, projectid);
}
@Override
public int projectrow(String hql) {
// List<TestTastexcute> list=new ArrayList<TestTastexcute>();
Session session = this.getSession(true);
int count=0;
try {
count = session.createSQLQuery(hql).list().size();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return count;
// return this.getHibernateTemplate().find("select id,name,planproj from TestJobs order by id asc ");
}
@Override
public List<SectorProjects> getAllProject() {
// List<TestTastexcute> list=new ArrayList<TestTastexcute>();
Session session = this.getSession(true);
List<SectorProjects> list = new ArrayList<>();
try {
list = session.createQuery("from SectorProjects order by projectid asc").list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return list;
// return this.getHibernateTemplate().find("select id,name,planproj from TestJobs order by id asc ");
}
}

View File

@ -1,24 +1,24 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.TempCasestepDebug;
@Transactional
public interface TempCasestepDebugDao {
public TempCasestepDebug load(int id) throws Exception;
public int add(TempCasestepDebug tcd) throws Exception;
public List findByPage(final String hql, final Object value, final int offset, final int pageSize);
public int findRows(TempCasestepDebug tcd, String hql);
public void delete(String hql) throws Exception;
public void deleteforob(TempCasestepDebug tcd) throws Exception;
public void modify(TempCasestepDebug tcd) throws Exception;
public List<TempCasestepDebug> getParamsList(String sql) throws Exception;
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.TempCasestepDebug;
@Transactional
public interface TempCasestepDebugDao {
public TempCasestepDebug load(int id) throws Exception;
public int add(TempCasestepDebug tcd) throws Exception;
public List findByPage(final String hql, final Object value, final int offset, final int pageSize);
public int findRows(TempCasestepDebug tcd, String hql);
public void delete(String hql) throws Exception;
public void deleteforob(TempCasestepDebug tcd) throws Exception;
public void modify(TempCasestepDebug tcd) throws Exception;
public List<TempCasestepDebug> getParamsList(String sql) throws Exception;
}

View File

@ -1,139 +1,139 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.TempCasestepDebug;
import luckyweb.seagull.util.StrLib;
@Repository("tempcasestepdebugDao")
public class TempCasestepDebugImpl extends HibernateDaoSupport implements TempCasestepDebugDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public TempCasestepDebug load(int id) throws Exception {
//return (UserInfo)this.getSession().get(UserInfo.class, id);
return (TempCasestepDebug) this.getHibernateTemplate().get(TempCasestepDebug.class, id);
}
@Override
public int add(TempCasestepDebug tcd) throws Exception {
this.getHibernateTemplate().save(tcd);
return tcd.getId();
}
@Override
public void deleteforob(TempCasestepDebug tcd) throws Exception {
try{
this.getHibernateTemplate().delete(tcd);
}catch(Exception e){
e.printStackTrace();
}
}
@Override
public void modify(TempCasestepDebug tcd) throws Exception {
this.getHibernateTemplate().update(tcd);
}
private void whereParameter(TempCasestepDebug tcd, Query query) {
if (!StrLib.isEmpty(tcd.getSign())) {
query.setParameter("sign", tcd.getSign());
}
if (!StrLib.isEmpty(tcd.getExecutor())) {
query.setParameter("executor", tcd.getExecutor());
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((TempCasestepDebug)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(TempCasestepDebug tcd, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(tcd, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public void delete(String hql) throws Exception {
Session session=this.getSession(true);
try {
session.beginTransaction();
Query query =session .createQuery(hql);
query.executeUpdate();
session.getTransaction().commit();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
}
@SuppressWarnings("rawtypes")
@Override
public List<TempCasestepDebug> getParamsList(String sql) throws Exception {
// TODO Auto-generated method stub
List<TempCasestepDebug> list=null;
Session session=this.getSession(true);
try {
list = session.createQuery(sql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return list;
}
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.TempCasestepDebug;
import luckyweb.seagull.util.StrLib;
@Repository("tempcasestepdebugDao")
public class TempCasestepDebugImpl extends HibernateDaoSupport implements TempCasestepDebugDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public TempCasestepDebug load(int id) throws Exception {
//return (UserInfo)this.getSession().get(UserInfo.class, id);
return (TempCasestepDebug) this.getHibernateTemplate().get(TempCasestepDebug.class, id);
}
@Override
public int add(TempCasestepDebug tcd) throws Exception {
this.getHibernateTemplate().save(tcd);
return tcd.getId();
}
@Override
public void deleteforob(TempCasestepDebug tcd) throws Exception {
try{
this.getHibernateTemplate().delete(tcd);
}catch(Exception e){
e.printStackTrace();
}
}
@Override
public void modify(TempCasestepDebug tcd) throws Exception {
this.getHibernateTemplate().update(tcd);
}
private void whereParameter(TempCasestepDebug tcd, Query query) {
if (!StrLib.isEmpty(tcd.getSign())) {
query.setParameter("sign", tcd.getSign());
}
if (!StrLib.isEmpty(tcd.getExecutor())) {
query.setParameter("executor", tcd.getExecutor());
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((TempCasestepDebug)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(TempCasestepDebug tcd, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(tcd, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public void delete(String hql) throws Exception {
Session session=this.getSession(true);
try {
session.beginTransaction();
Query query =session .createQuery(hql);
query.executeUpdate();
session.getTransaction().commit();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
}
@SuppressWarnings("rawtypes")
@Override
public List<TempCasestepDebug> getParamsList(String sql) throws Exception {
// TODO Auto-generated method stub
List<TempCasestepDebug> list=null;
Session session=this.getSession(true);
try {
list = session.createQuery(sql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return list;
}
}

View File

@ -1,27 +1,27 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.TestCasedetail;
@Transactional
public interface TestCasedetailDao {
@Transactional(propagation=Propagation.REQUIRED)
public void add(TestCasedetail caseDetail);
@Transactional(propagation=Propagation.NOT_SUPPORTED)
public List<TestCasedetail> list(TestCasedetail caseDetail);
public TestCasedetail load(int id);
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(String hql,TestCasedetail tast);
@Transactional(propagation=Propagation.REQUIRED)
public void delete(String hql,int id) throws Exception;
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.TestCasedetail;
@Transactional
public interface TestCasedetailDao {
@Transactional(propagation=Propagation.REQUIRED)
public void add(TestCasedetail caseDetail);
@Transactional(propagation=Propagation.NOT_SUPPORTED)
public List<TestCasedetail> list(TestCasedetail caseDetail);
public TestCasedetail load(int id);
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(String hql,TestCasedetail tast);
@Transactional(propagation=Propagation.REQUIRED)
public void delete(String hql,int id) throws Exception;
}

View File

@ -1,145 +1,145 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.apache.log4j.Logger;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.TestCasedetail;
import luckyweb.seagull.util.StrLib;
@Repository("casedetailDao")
public class TestCasedetailDaoImpl extends HibernateDaoSupport implements TestCasedetailDao {
private static final Logger logger = Logger.getLogger(TestCasedetailDaoImpl.class);
@Resource(name="sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory){
super.setSessionFactory(sessionFactory);
}
@Override
public void add(TestCasedetail caseDetail) {
this.getHibernateTemplate().save(caseDetail);
}
@Override
public List<TestCasedetail> list(TestCasedetail caseDetail) {
List<TestCasedetail> list=this.getSession().createQuery(" from TestCasedetail where taskid=?")
.setInteger(0, caseDetail.getTestTaskexcute().getId())
.list();
return list;
}
@Override
public TestCasedetail load(int id) {
return (TestCasedetail) this.getHibernateTemplate().get(TestCasedetail.class, id);
}
/**
* 使用hql语句进行分页查询
*
* @param hql
* 需要查询的hql语句
* @param value
* 如果hql 有一个参数需要传入value就是传入Hql语句的参数
*
* @param offset
* 第一条记录索引
*
* @param pageSize
* 每页需要显示的记录条数
* @return 当前页的所有记录
*/
public List findByPage(final String hql, final Object value,
final int offset, final int pageSize) {
// 通过一个HibernateCallback 对象来执行查询
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
@SuppressWarnings("rawtypes")
List result=null;
try{
Query query=session.createQuery(hql);
whereParameter((TestCasedetail)value, query);
result = query
.setFirstResult(offset).setMaxResults(pageSize).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}return result;
}
});
return list;
}
private void whereParameter(TestCasedetail caseDetail, Query query) {
if (!StrLib.isEmpty(caseDetail.getStartDate())&&!StrLib.isEmpty(caseDetail.getEndDate())) {
query.setParameter("startDate", caseDetail.getStartDate().trim());
query.setParameter("endDate", caseDetail.getEndDate().trim());
}if (caseDetail.getTaskId()!=0) {
query.setParameter("taskId", caseDetail.getTaskId());
}
if (!StrLib.isEmpty(caseDetail.getCasestatus())) {
query.setParameter("casestatus", caseDetail.getCasestatus().trim());
}
if (!StrLib.isEmpty(caseDetail.getCaseno())) {
query.setParameter("caseno", "%"+caseDetail.getCaseno().trim()+"%");
}
if (!StrLib.isEmpty(caseDetail.getCasename())) {
query.setParameter("casename", "%"+caseDetail.getCasename().trim()+"%");
}
}
public int findRows(String hql, TestCasedetail caseDetail) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(caseDetail, query);
s= Integer.valueOf(query.list().get(0).toString());
} catch (Exception e) {
e.printStackTrace();
}finally
{
session.close();
}
return s;
}
@Override
public void delete(String hql, int id) throws Exception {
Session session=this.getSession(true);
session.beginTransaction();
Query query =session .createQuery(hql);
query.setInteger("taskId", id);
query.executeUpdate();
session.getTransaction().commit();
session.close();
}
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.apache.log4j.Logger;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.TestCasedetail;
import luckyweb.seagull.util.StrLib;
@Repository("casedetailDao")
public class TestCasedetailDaoImpl extends HibernateDaoSupport implements TestCasedetailDao {
private static final Logger logger = Logger.getLogger(TestCasedetailDaoImpl.class);
@Resource(name="sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory){
super.setSessionFactory(sessionFactory);
}
@Override
public void add(TestCasedetail caseDetail) {
this.getHibernateTemplate().save(caseDetail);
}
@Override
public List<TestCasedetail> list(TestCasedetail caseDetail) {
List<TestCasedetail> list=this.getSession().createQuery(" from TestCasedetail where taskid=?")
.setInteger(0, caseDetail.getTestTaskexcute().getId())
.list();
return list;
}
@Override
public TestCasedetail load(int id) {
return (TestCasedetail) this.getHibernateTemplate().get(TestCasedetail.class, id);
}
/**
* 使用hql语句进行分页查询
*
* @param hql
* 需要查询的hql语句
* @param value
* 如果hql 有一个参数需要传入value就是传入Hql语句的参数
*
* @param offset
* 第一条记录索引
*
* @param pageSize
* 每页需要显示的记录条数
* @return 当前页的所有记录
*/
public List findByPage(final String hql, final Object value,
final int offset, final int pageSize) {
// 通过一个HibernateCallback 对象来执行查询
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
@SuppressWarnings("rawtypes")
List result=null;
try{
Query query=session.createQuery(hql);
whereParameter((TestCasedetail)value, query);
result = query
.setFirstResult(offset).setMaxResults(pageSize).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}return result;
}
});
return list;
}
private void whereParameter(TestCasedetail caseDetail, Query query) {
if (!StrLib.isEmpty(caseDetail.getStartDate())&&!StrLib.isEmpty(caseDetail.getEndDate())) {
query.setParameter("startDate", caseDetail.getStartDate().trim());
query.setParameter("endDate", caseDetail.getEndDate().trim());
}if (caseDetail.getTaskId()!=0) {
query.setParameter("taskId", caseDetail.getTaskId());
}
if (!StrLib.isEmpty(caseDetail.getCasestatus())) {
query.setParameter("casestatus", caseDetail.getCasestatus().trim());
}
if (!StrLib.isEmpty(caseDetail.getCaseno())) {
query.setParameter("caseno", "%"+caseDetail.getCaseno().trim()+"%");
}
if (!StrLib.isEmpty(caseDetail.getCasename())) {
query.setParameter("casename", "%"+caseDetail.getCasename().trim()+"%");
}
}
public int findRows(String hql, TestCasedetail caseDetail) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(caseDetail, query);
s= Integer.valueOf(query.list().get(0).toString());
} catch (Exception e) {
e.printStackTrace();
}finally
{
session.close();
}
return s;
}
@Override
public void delete(String hql, int id) throws Exception {
Session session=this.getSession(true);
session.beginTransaction();
Query query =session .createQuery(hql);
query.setInteger("taskId", id);
query.executeUpdate();
session.getTransaction().commit();
session.close();
}
}

View File

@ -1,26 +1,26 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.TestClient;
@Transactional
public interface TestClientDao {
public TestClient load(int id) throws Exception;
public int add(TestClient tc) throws Exception;
public void modify(TestClient tc) throws Exception;
public void delete(TestClient tc) throws Exception;
public int get(String sql) throws Exception;
@SuppressWarnings("rawtypes")
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(TestClient tc,String hql);
public int sqlfindRows(String hql);
@SuppressWarnings("rawtypes")
public List listsql(String sql) throws Exception;
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.TestClient;
@Transactional
public interface TestClientDao {
public TestClient load(int id) throws Exception;
public int add(TestClient tc) throws Exception;
public void modify(TestClient tc) throws Exception;
public void delete(TestClient tc) throws Exception;
public int get(String sql) throws Exception;
@SuppressWarnings("rawtypes")
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(TestClient tc,String hql);
public int sqlfindRows(String hql);
@SuppressWarnings("rawtypes")
public List listsql(String sql) throws Exception;
}

View File

@ -1,156 +1,156 @@
package luckyweb.seagull.spring.dao;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.Review;
import luckyweb.seagull.spring.entity.SectorProjects;
import luckyweb.seagull.spring.entity.TestClient;
@Repository("testclientDao")
public class TestClientDaoImpl extends HibernateDaoSupport implements TestClientDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public TestClient load(int id) throws Exception {
//return (TestClient)this.getSession().get(TestClient.class, id);
return (TestClient) this.getHibernateTemplate().get(TestClient.class, id);
}
@Override
public int add(TestClient tc) throws Exception {
this.getHibernateTemplate().save(tc);
return tc.getId();
}
@Override
public void modify(TestClient tc) throws Exception {
this.getHibernateTemplate().update(tc);
}
@Override
public void delete(TestClient tc) throws Exception {
try{
this.getHibernateTemplate().delete(tc);
}catch(Exception e){
e.printStackTrace();
}
}
@Override
public int get(String sql) throws Exception {
int id = 0;
Session session = this.getSession(true);
@SuppressWarnings("unchecked")
List<Object> count = session.createSQLQuery(sql).list();
if(count.size()!=0){
if(count.get(0)!=null){
id = Integer.valueOf(count.get(0).toString());
}
}
session.close();
return id;
}
private void whereParameter(TestClient tc, Query query) {
if (null!=tc.getClientip()&&!"".equals(tc.getClientip())) {
query.setParameter("clientip", "%"+tc.getClientip()+"%");
}
if (null!=tc.getName()&&!"".equals(tc.getName())) {
query.setParameter("name", "%"+tc.getName()+"%");
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((TestClient)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(TestClient tc, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(tc, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int sqlfindRows(String hql) {
int s=0;
Session session=this.getSession(true);
try {
/*Query query=session.createQuery(hql);*/
Query query= session.createSQLQuery(hql);
s= Integer.valueOf(
query.list().size());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@SuppressWarnings("unchecked")
@Override
public List<TestClient> listsql(String sql) throws Exception {
Session session = this.getSession(true);
List<TestClient> list = new ArrayList<>();
try {
list = session.createQuery(sql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return list;
}
}
package luckyweb.seagull.spring.dao;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.Review;
import luckyweb.seagull.spring.entity.SectorProjects;
import luckyweb.seagull.spring.entity.TestClient;
@Repository("testclientDao")
public class TestClientDaoImpl extends HibernateDaoSupport implements TestClientDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public TestClient load(int id) throws Exception {
//return (TestClient)this.getSession().get(TestClient.class, id);
return (TestClient) this.getHibernateTemplate().get(TestClient.class, id);
}
@Override
public int add(TestClient tc) throws Exception {
this.getHibernateTemplate().save(tc);
return tc.getId();
}
@Override
public void modify(TestClient tc) throws Exception {
this.getHibernateTemplate().update(tc);
}
@Override
public void delete(TestClient tc) throws Exception {
try{
this.getHibernateTemplate().delete(tc);
}catch(Exception e){
e.printStackTrace();
}
}
@Override
public int get(String sql) throws Exception {
int id = 0;
Session session = this.getSession(true);
@SuppressWarnings("unchecked")
List<Object> count = session.createSQLQuery(sql).list();
if(count.size()!=0){
if(count.get(0)!=null){
id = Integer.valueOf(count.get(0).toString());
}
}
session.close();
return id;
}
private void whereParameter(TestClient tc, Query query) {
if (null!=tc.getClientip()&&!"".equals(tc.getClientip())) {
query.setParameter("clientip", "%"+tc.getClientip()+"%");
}
if (null!=tc.getName()&&!"".equals(tc.getName())) {
query.setParameter("name", "%"+tc.getName()+"%");
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((TestClient)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(TestClient tc, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(tc, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int sqlfindRows(String hql) {
int s=0;
Session session=this.getSession(true);
try {
/*Query query=session.createQuery(hql);*/
Query query= session.createSQLQuery(hql);
s= Integer.valueOf(
query.list().size());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@SuppressWarnings("unchecked")
@Override
public List<TestClient> listsql(String sql) throws Exception {
Session session = this.getSession(true);
List<TestClient> list = new ArrayList<>();
try {
list = session.createQuery(sql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return list;
}
}

View File

@ -1,45 +1,45 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.TestJobs;
@Transactional
public interface TestJobsDao {
public int add(TestJobs tjob) throws Exception;
public void modify(TestJobs tjob) throws Exception;
public void modifyState(TestJobs tjob) throws Exception;
public void modifyInfo(TestJobs tjob) throws Exception;
public void delete(int id) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<TestJobs> list(TestJobs tjob) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<TestJobs> list() throws Exception;
public TestJobs load(int id) throws Exception;
public List<TestJobs> load(String name, String cmdType, String planPath)
throws Exception;
public TestJobs get(int id) throws Exception;
// public List findByPage(final String hql, final int offset,final int pageSize);
//
// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize);
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(TestJobs jobs,String hql);
public List findJobsList(String hql);
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.TestJobs;
@Transactional
public interface TestJobsDao {
public int add(TestJobs tjob) throws Exception;
public void modify(TestJobs tjob) throws Exception;
public void modifyState(TestJobs tjob) throws Exception;
public void modifyInfo(TestJobs tjob) throws Exception;
public void delete(int id) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<TestJobs> list(TestJobs tjob) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<TestJobs> list() throws Exception;
public TestJobs load(int id) throws Exception;
public List<TestJobs> load(String name, String cmdType, String planPath)
throws Exception;
public TestJobs get(int id) throws Exception;
// public List findByPage(final String hql, final int offset,final int pageSize);
//
// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize);
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(TestJobs jobs,String hql);
public List findJobsList(String hql);
}

View File

@ -1,352 +1,352 @@
package luckyweb.seagull.spring.dao;
import java.sql.SQLException;
import java.util.List;
import javax.annotation.Resource;
import org.apache.log4j.Logger;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.quartz.impl.StdSchedulerFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.comm.QueueListener;
import luckyweb.seagull.quartz.QuratzJobDataMgr;
import luckyweb.seagull.spring.entity.TestClient;
import luckyweb.seagull.spring.entity.TestJobs;
import luckyweb.seagull.util.StrLib;
@Repository("testJobsDao")
public class TestJobsDaoImpl extends HibernateDaoSupport implements TestJobsDao {
private static final Logger log = Logger.getLogger(TestJobsDaoImpl.class);
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
public static boolean isRun = false;
/**
* 启动 定时任务 修改状态为启动 state=1
*
* @throws Exception
*/
@SuppressWarnings("unchecked")
public static void init(Session session) throws Exception {
QueueListener.gSchedulerFactory = new StdSchedulerFactory();
QueueListener.sched = QueueListener.gSchedulerFactory.getScheduler();
if (isRun == false) {
try {
Query queryproj = session.createQuery("from SectorProjects where projecttype=1 order by projectid asc");
QueueListener.projlist = queryproj.list();//获取所有项目
Query query = session.createQuery("from TestJobs where (tasktype ='D') or (tasktype ='O' and runtime>sysdate()) ");
QueueListener.list = query.list();
QueueListener.qa_projlist = session.createQuery("from SectorProjects where projecttype=0 order by projectid asc").list();
QueueListener.listen_Clientlist=session.createQuery("from TestClient order by id asc").list();
//将测试调度任务加入到定时任务中
QuratzJobDataMgr mgr = new QuratzJobDataMgr();
for (TestJobs tb : QueueListener.list) {
try{
mgr.addJobRunTime(tb, tb.getId());
}catch(Exception e){
log.error("启动 测试调度定时任务失败:" + e.getMessage());
System.out.println("任务ID号"+tb.getId()+"启动失败请检查测试调度任务配置情况尤其是Cron表达式是否正确");
continue;
}
}
//将客户端心跳加入到定时任务中
for (TestClient tc : QueueListener.listen_Clientlist) {
try{
mgr.addTestClient(tc, tc.getId());
}catch(Exception e){
log.error("启动 客户端心跳检测监听失败:" + e.getMessage());
System.out.println("任务ID号"+tc.getId()+"启动失败请检查客户端心跳检测任务配置情况尤其是Cron表达式是否正确");
continue;
}
}
if (QueueListener.list.size() != 0) {
//设置任务的状态为启动
session.beginTransaction();
TestJobs tjob = new TestJobs();
tjob.setState("1");
Query query2 = session.createQuery("update TestJobs t set t.state = '1' where (tasktype ='D') or (tasktype ='O' and runtime>sysdate() ) ");
query2.executeUpdate();
session.getTransaction().commit();
}
isRun = true;
} catch (Exception e) {
log.error("启动 定时任务失败:" + e.getMessage());
System.out.println("启动 定时任务失败:" + e.getMessage());
throw new Exception("启动 定时任务失败:" + e);
}finally{
session.close();
}
}
}
/**
* 关闭 定时任务修改状态为未启动 state=0
*
* @throws Exception
*/
public static void stop(Session session) throws Exception {
// QuratzJobDataMgr query = QuratzJobDataMgr.getInstance();
try {
// Session session=sessionFactory.openSession();
session.beginTransaction();
Query query = session.createQuery("update TestJobs t set t.state = '0' where (tasktype ='D') or (tasktype ='O' and to_date(runtime,'yyyy-MM-dd HH24:mi:ss')>sysdate ) ");
query.executeUpdate();
session.getTransaction().commit();
} catch (Exception e) {
throw new Exception("关闭 定时任务失败:" + e);
}finally{
session.close();
}
}
@Override
public int add(TestJobs tjob) throws Exception{
this.getHibernateTemplate().save(tjob);
return tjob.getId();
}
@Override
public void modify(TestJobs tjob) throws Exception{
this.getHibernateTemplate().update(tjob);
//Query query = this.getSession().createQuery("update TestJobs t set t.projPath =?,t.startDate=?,t.startTime=?,t.endDate=?,t.end where id =? ");
//query.executeUpdate();
}
@Override
public void modifyState(TestJobs tjob) throws Exception{
this.getHibernateTemplate().update(tjob);
}
@Override
public void delete(int id) throws Exception{
try{
TestJobs tjob = this.load(id);
this.getHibernateTemplate().delete(tjob);
}catch(Exception e){
e.printStackTrace();
}
}
// public List<TestJobs> list(TestJobs tjob) {
// Session session = this.getSession();
// String hql = "from TestJobs ";
// hql += where(tjob);
// Query query = session.createQuery(hql);
// whereParameter(tjob, query);
// List<TestJobs> list = query.list();
// return list;
// }
@Override
public List<TestJobs> list(TestJobs tjob) {
@SuppressWarnings("unchecked")
List<TestJobs> list = this.getHibernateTemplate().find(" from TestJobs");
return list;
}
@Override
public List<TestJobs> list() {
return this.getHibernateTemplate().loadAll(TestJobs.class);
}
@Override
public TestJobs load(int id) {
return (TestJobs) this.getHibernateTemplate().get(TestJobs.class, id);
}
/*public List<TestJobs> listFenye(TestJobs tjob, int curpage, int pagesize) {
Session session = this.getSession();
String hql = "from TestJobs ";
hql += where(tjob);
// Query query=session.createQuery(hql);
List<TestJobs> list = findOnePage(session, hql, tjob, curpage, pagesize);
return list;
}
public List<TestJobs> findOnePage(Session session, String strHQL,
TestJobs tjob, int offset, int pagesize) {
List<TestJobs> lst = null;
try {
Query query = session.createQuery(strHQL);
whereParameter(tjob, query);
if (offset != 0 && pagesize != 0) {
query.setFirstResult((offset - 1) * pagesize);
query.setMaxResults(pagesize);
}
lst = query.list();
} catch (Exception ex) {
ex.printStackTrace();
}
return lst;
}*/
private void whereParameter(TestJobs jb, Query query) {
if (!StrLib.isEmpty(jb.getTaskName())) {
query.setParameter("name", "%"+jb.getTaskName().trim()+"%");
}
if (!StrLib.isEmpty(jb.getPlanproj())) {
query.setParameter("planproj", "%"+jb.getPlanproj().trim()+"%");
}
if (jb.getProjectid()!=0&&jb.getProjectid()!=99) {
query.setParameter("projectid", jb.getProjectid());
}
}
@Override
public TestJobs get(int id) {
return (TestJobs) this.getHibernateTemplate().get(TestJobs.class, id);
}
@Override
public List<TestJobs> load(String name, String cmdType, String planPath) {
Session session=this.getSession(true);
List<TestJobs> list=null;
try{
String hql = " from TestJobs where planName=? and cmdType=? and planPath=?";
list= (List<TestJobs>)session
.createQuery(hql).setString(0, name).setString(1, cmdType)
.setString(2, planPath).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return list;
}
@Override
/**
* 修改信息
*/
public void modifyInfo(TestJobs tjob) {
Session session=this.getSession(true);
try {
session .createQuery(
"update TestJobs set startDate=? ,startTime=?, endDate=?, endTime=?,startTimestr=?,runTime=? where id=? ")
.executeUpdate();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
}
/**
* 使用hql语句进行分页查询
*
* @param hql
* 需要查询的hql语句
* @param value
* 如果hql 有一个参数需要传入value就是传入Hql语句的参数
*
* @param offset
* 第一条记录索引
*
* @param pageSize
* 每页需要显示的记录条数
* @return 当前页的所有记录
*/
public List findByPage(final String hql, final Object value,
final int offset, final int pageSize) {
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((TestJobs)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
public int findRows(TestJobs jobs,String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(jobs, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
public List<TestJobs> getListForPage(final String hql, final int offset,
final int lengh) {
log.debug("finding ListForPage");
try {
List list = getHibernateTemplate().executeFind(
new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException, SQLException {
List list2 = session.createQuery(hql)
.setFirstResult(offset)
.setMaxResults(lengh).list();
session.close();
return list2;
}
});
return list;
} catch (RuntimeException re) {
log.error("find ListForPage failed", re);
throw re;
}
}
@Override
public List findJobsList(String hql) {
// List<TestTastexcute> list=new ArrayList<TestTastexcute>();
Session session = this.getSession(true);
List count=null;
try {
count = session.createSQLQuery(hql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return count;
// return this.getHibernateTemplate().find("select id,name,planproj from TestJobs order by id asc ");
}
package luckyweb.seagull.spring.dao;
import java.sql.SQLException;
import java.util.List;
import javax.annotation.Resource;
import org.apache.log4j.Logger;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.quartz.impl.StdSchedulerFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.comm.QueueListener;
import luckyweb.seagull.quartz.QuratzJobDataMgr;
import luckyweb.seagull.spring.entity.TestClient;
import luckyweb.seagull.spring.entity.TestJobs;
import luckyweb.seagull.util.StrLib;
@Repository("testJobsDao")
public class TestJobsDaoImpl extends HibernateDaoSupport implements TestJobsDao {
private static final Logger log = Logger.getLogger(TestJobsDaoImpl.class);
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
public static boolean isRun = false;
/**
* 启动 定时任务 修改状态为启动 state=1
*
* @throws Exception
*/
@SuppressWarnings("unchecked")
public static void init(Session session) throws Exception {
QueueListener.gSchedulerFactory = new StdSchedulerFactory();
QueueListener.sched = QueueListener.gSchedulerFactory.getScheduler();
if (isRun == false) {
try {
Query queryproj = session.createQuery("from SectorProjects where projecttype=1 order by projectid asc");
QueueListener.projlist = queryproj.list();//获取所有项目
Query query = session.createQuery("from TestJobs where (tasktype ='D') or (tasktype ='O' and runtime>sysdate()) ");
QueueListener.list = query.list();
QueueListener.qa_projlist = session.createQuery("from SectorProjects where projecttype=0 order by projectid asc").list();
QueueListener.listen_Clientlist=session.createQuery("from TestClient order by id asc").list();
//将测试调度任务加入到定时任务中
QuratzJobDataMgr mgr = new QuratzJobDataMgr();
for (TestJobs tb : QueueListener.list) {
try{
mgr.addJobRunTime(tb, tb.getId());
}catch(Exception e){
log.error("启动 测试调度定时任务失败:" + e.getMessage());
System.out.println("任务ID号"+tb.getId()+"启动失败请检查测试调度任务配置情况尤其是Cron表达式是否正确");
continue;
}
}
//将客户端心跳加入到定时任务中
for (TestClient tc : QueueListener.listen_Clientlist) {
try{
mgr.addTestClient(tc, tc.getId());
}catch(Exception e){
log.error("启动 客户端心跳检测监听失败:" + e.getMessage());
System.out.println("任务ID号"+tc.getId()+"启动失败请检查客户端心跳检测任务配置情况尤其是Cron表达式是否正确");
continue;
}
}
if (QueueListener.list.size() != 0) {
//设置任务的状态为启动
session.beginTransaction();
TestJobs tjob = new TestJobs();
tjob.setState("1");
Query query2 = session.createQuery("update TestJobs t set t.state = '1' where (tasktype ='D') or (tasktype ='O' and runtime>sysdate() ) ");
query2.executeUpdate();
session.getTransaction().commit();
}
isRun = true;
} catch (Exception e) {
log.error("启动 定时任务失败:" + e.getMessage());
System.out.println("启动 定时任务失败:" + e.getMessage());
throw new Exception("启动 定时任务失败:" + e);
}finally{
session.close();
}
}
}
/**
* 关闭 定时任务修改状态为未启动 state=0
*
* @throws Exception
*/
public static void stop(Session session) throws Exception {
// QuratzJobDataMgr query = QuratzJobDataMgr.getInstance();
try {
// Session session=sessionFactory.openSession();
session.beginTransaction();
Query query = session.createQuery("update TestJobs t set t.state = '0' where (tasktype ='D') or (tasktype ='O' and to_date(runtime,'yyyy-MM-dd HH24:mi:ss')>sysdate ) ");
query.executeUpdate();
session.getTransaction().commit();
} catch (Exception e) {
throw new Exception("关闭 定时任务失败:" + e);
}finally{
session.close();
}
}
@Override
public int add(TestJobs tjob) throws Exception{
this.getHibernateTemplate().save(tjob);
return tjob.getId();
}
@Override
public void modify(TestJobs tjob) throws Exception{
this.getHibernateTemplate().update(tjob);
//Query query = this.getSession().createQuery("update TestJobs t set t.projPath =?,t.startDate=?,t.startTime=?,t.endDate=?,t.end where id =? ");
//query.executeUpdate();
}
@Override
public void modifyState(TestJobs tjob) throws Exception{
this.getHibernateTemplate().update(tjob);
}
@Override
public void delete(int id) throws Exception{
try{
TestJobs tjob = this.load(id);
this.getHibernateTemplate().delete(tjob);
}catch(Exception e){
e.printStackTrace();
}
}
// public List<TestJobs> list(TestJobs tjob) {
// Session session = this.getSession();
// String hql = "from TestJobs ";
// hql += where(tjob);
// Query query = session.createQuery(hql);
// whereParameter(tjob, query);
// List<TestJobs> list = query.list();
// return list;
// }
@Override
public List<TestJobs> list(TestJobs tjob) {
@SuppressWarnings("unchecked")
List<TestJobs> list = this.getHibernateTemplate().find(" from TestJobs");
return list;
}
@Override
public List<TestJobs> list() {
return this.getHibernateTemplate().loadAll(TestJobs.class);
}
@Override
public TestJobs load(int id) {
return (TestJobs) this.getHibernateTemplate().get(TestJobs.class, id);
}
/*public List<TestJobs> listFenye(TestJobs tjob, int curpage, int pagesize) {
Session session = this.getSession();
String hql = "from TestJobs ";
hql += where(tjob);
// Query query=session.createQuery(hql);
List<TestJobs> list = findOnePage(session, hql, tjob, curpage, pagesize);
return list;
}
public List<TestJobs> findOnePage(Session session, String strHQL,
TestJobs tjob, int offset, int pagesize) {
List<TestJobs> lst = null;
try {
Query query = session.createQuery(strHQL);
whereParameter(tjob, query);
if (offset != 0 && pagesize != 0) {
query.setFirstResult((offset - 1) * pagesize);
query.setMaxResults(pagesize);
}
lst = query.list();
} catch (Exception ex) {
ex.printStackTrace();
}
return lst;
}*/
private void whereParameter(TestJobs jb, Query query) {
if (!StrLib.isEmpty(jb.getTaskName())) {
query.setParameter("name", "%"+jb.getTaskName().trim()+"%");
}
if (!StrLib.isEmpty(jb.getPlanproj())) {
query.setParameter("planproj", "%"+jb.getPlanproj().trim()+"%");
}
if (jb.getProjectid()!=0&&jb.getProjectid()!=99) {
query.setParameter("projectid", jb.getProjectid());
}
}
@Override
public TestJobs get(int id) {
return (TestJobs) this.getHibernateTemplate().get(TestJobs.class, id);
}
@Override
public List<TestJobs> load(String name, String cmdType, String planPath) {
Session session=this.getSession(true);
List<TestJobs> list=null;
try{
String hql = " from TestJobs where planName=? and cmdType=? and planPath=?";
list= (List<TestJobs>)session
.createQuery(hql).setString(0, name).setString(1, cmdType)
.setString(2, planPath).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return list;
}
@Override
/**
* 修改信息
*/
public void modifyInfo(TestJobs tjob) {
Session session=this.getSession(true);
try {
session .createQuery(
"update TestJobs set startDate=? ,startTime=?, endDate=?, endTime=?,startTimestr=?,runTime=? where id=? ")
.executeUpdate();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
}
/**
* 使用hql语句进行分页查询
*
* @param hql
* 需要查询的hql语句
* @param value
* 如果hql 有一个参数需要传入value就是传入Hql语句的参数
*
* @param offset
* 第一条记录索引
*
* @param pageSize
* 每页需要显示的记录条数
* @return 当前页的所有记录
*/
public List findByPage(final String hql, final Object value,
final int offset, final int pageSize) {
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((TestJobs)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
public int findRows(TestJobs jobs,String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(jobs, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
public List<TestJobs> getListForPage(final String hql, final int offset,
final int lengh) {
log.debug("finding ListForPage");
try {
List list = getHibernateTemplate().executeFind(
new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException, SQLException {
List list2 = session.createQuery(hql)
.setFirstResult(offset)
.setMaxResults(lengh).list();
session.close();
return list2;
}
});
return list;
} catch (RuntimeException re) {
log.error("find ListForPage failed", re);
throw re;
}
}
@Override
public List findJobsList(String hql) {
// List<TestTastexcute> list=new ArrayList<TestTastexcute>();
Session session = this.getSession(true);
List count=null;
try {
count = session.createSQLQuery(hql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return count;
// return this.getHibernateTemplate().find("select id,name,planproj from TestJobs order by id asc ");
}
}

View File

@ -1,25 +1,25 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.TestLogdetail;
@Transactional
public interface TestLogdetailDao {
public void add(TestLogdetail logDetail);
@Transactional(propagation=Propagation.NOT_SUPPORTED)
public List<TestLogdetail> list(TestLogdetail logDetail);
public TestLogdetail load(int id);
public void delete(String hql,int id) throws Exception;
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(String hql,TestLogdetail logs);
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.TestLogdetail;
@Transactional
public interface TestLogdetailDao {
public void add(TestLogdetail logDetail);
@Transactional(propagation=Propagation.NOT_SUPPORTED)
public List<TestLogdetail> list(TestLogdetail logDetail);
public TestLogdetail load(int id);
public void delete(String hql,int id) throws Exception;
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(String hql,TestLogdetail logs);
}

View File

@ -1,116 +1,116 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.apache.log4j.Logger;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.TestLogdetail;
@Repository("logdetailDao")
public class TestLogdetailDaoImpl extends HibernateDaoSupport implements
TestLogdetailDao {
private static final Logger logger = Logger
.getLogger(TestLogdetailDaoImpl.class);
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void add(TestLogdetail caseDetail) {
this.getHibernateTemplate().save(caseDetail);
}
@Override
public List<TestLogdetail> list(TestLogdetail log) {
Session session=this.getSession(true);
List<TestLogdetail> list = session.createQuery(" from TestLogdetail where caseid=? order by id asc")
.setInteger(0, log.getCaseid()).list();
session.close();
return list;
}
@Override
public TestLogdetail load(int id) {
return (TestLogdetail) this.getHibernateTemplate().get(TestLogdetail.class, id);
}
@Override
public void delete(String hql, int id) throws Exception {
Session session=this.getSession(true);
session.beginTransaction();
Query query =session .createQuery(hql).setInteger("taskId", id);
query.executeUpdate();
session.getTransaction().commit();
session.close();
}
/*
* 使用hql语句进行分页查询
*
* @param hql 需要查询的hql语句
*
* @param offset 第一条记录索引
*
* @param pageSize 每页需要显示的记录条数
*
* @return 当前页的所有记录
*/
public List findByPage(final String hql, final Object value,
final int offset, final int pageSize) {
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((TestLogdetail)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
public int findRows(String hql, TestLogdetail log) {
int s = 0;
Session session = this.getSession(true);
try {
Query query = session.createQuery(hql);
whereParameter(log, query);
s = Integer.valueOf(query.list().get(0).toString());
} catch (Exception e) {
e.printStackTrace();
} finally {
session.close();
}
return s;
}
private void whereParameter(TestLogdetail log, Query query) {
if (log.getTaskid()!=0) {
query.setParameter("taskid", log.getTaskid());
}
if (log.getCaseid()!=0) {
query.setParameter("caseid", log.getCaseid());
}
}
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.apache.log4j.Logger;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.TestLogdetail;
@Repository("logdetailDao")
public class TestLogdetailDaoImpl extends HibernateDaoSupport implements
TestLogdetailDao {
private static final Logger logger = Logger
.getLogger(TestLogdetailDaoImpl.class);
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void add(TestLogdetail caseDetail) {
this.getHibernateTemplate().save(caseDetail);
}
@Override
public List<TestLogdetail> list(TestLogdetail log) {
Session session=this.getSession(true);
List<TestLogdetail> list = session.createQuery(" from TestLogdetail where caseid=? order by id asc")
.setInteger(0, log.getCaseid()).list();
session.close();
return list;
}
@Override
public TestLogdetail load(int id) {
return (TestLogdetail) this.getHibernateTemplate().get(TestLogdetail.class, id);
}
@Override
public void delete(String hql, int id) throws Exception {
Session session=this.getSession(true);
session.beginTransaction();
Query query =session .createQuery(hql).setInteger("taskId", id);
query.executeUpdate();
session.getTransaction().commit();
session.close();
}
/*
* 使用hql语句进行分页查询
*
* @param hql 需要查询的hql语句
*
* @param offset 第一条记录索引
*
* @param pageSize 每页需要显示的记录条数
*
* @return 当前页的所有记录
*/
public List findByPage(final String hql, final Object value,
final int offset, final int pageSize) {
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((TestLogdetail)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
public int findRows(String hql, TestLogdetail log) {
int s = 0;
Session session = this.getSession(true);
try {
Query query = session.createQuery(hql);
whereParameter(log, query);
s = Integer.valueOf(query.list().get(0).toString());
} catch (Exception e) {
e.printStackTrace();
} finally {
session.close();
}
return s;
}
private void whereParameter(TestLogdetail log, Query query) {
if (log.getTaskid()!=0) {
query.setParameter("taskid", log.getTaskid());
}
if (log.getCaseid()!=0) {
query.setParameter("caseid", log.getCaseid());
}
}
}

View File

@ -1,34 +1,34 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.TestTaskexcute;
public interface TestTastExcuteDao {
public void add(TestTaskexcute tjob);
@Transactional(propagation=Propagation.NOT_SUPPORTED)
public List<TestTaskexcute> list(TestTaskexcute tjob);
public TestTaskexcute load(int id);
public TestTaskexcute get(int id);
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(String hql,TestTaskexcute tast);
public List findTastList(String sql);
public void delete(int id) throws Exception;
public List listtastinfo(String sql) throws Exception;
public void delete_forjobid(String hql, int jobid) throws Exception;
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.TestTaskexcute;
public interface TestTastExcuteDao {
public void add(TestTaskexcute tjob);
@Transactional(propagation=Propagation.NOT_SUPPORTED)
public List<TestTaskexcute> list(TestTaskexcute tjob);
public TestTaskexcute load(int id);
public TestTaskexcute get(int id);
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(String hql,TestTaskexcute tast);
public List findTastList(String sql);
public void delete(int id) throws Exception;
public List listtastinfo(String sql) throws Exception;
public void delete_forjobid(String hql, int jobid) throws Exception;
}

View File

@ -1,231 +1,231 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.apache.log4j.Logger;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.Accident;
import luckyweb.seagull.spring.entity.TestTaskexcute;
import luckyweb.seagull.util.StrLib;
@Repository("tastExcuteDao")
public class TestTastExcuteDaoImpl extends HibernateDaoSupport implements
TestTastExcuteDao {
private static final Logger log = Logger
.getLogger(TestTastExcuteDaoImpl.class);
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void add(TestTaskexcute tast) {
this.getHibernateTemplate().save(tast);
}
@Override
public List<TestTaskexcute> list(TestTaskexcute tast) {
List<TestTaskexcute> list = null;
Session session = this.getSession(true);
try {
list = session
.createQuery(
"from TestTastexcute where jobid=? order by asc ")
.setInteger(0, tast.getTestJob().getId()).list();
} catch (Exception e) {
e.printStackTrace();
} finally {
session.close();
}
return list;
}
@Override
public TestTaskexcute load(int id) {
/* return (TestTastexcute) this.getSession()
.load(TestTastexcute.class, id);*/
return (TestTaskexcute) this.getHibernateTemplate().get(TestTaskexcute.class, id);
}
@Override
public TestTaskexcute get(int id) {
// return (TestTastexcute) this.getSession().get(TestTastexcute.class, id);
return (TestTaskexcute) this.getHibernateTemplate().get(TestTaskexcute.class, id);
}
/*
* 使用hql语句进行分页查询
*
* @param hql 需要查询的hql语句
*
* @param offset 第一条记录索引
*
* @param pageSize 每页需要显示的记录条数
*
* @return 当前页的所有记录
*/
public List findByPage(final TestTaskexcute tast, final String hql,
final int offset, final int pageSize) {
// 通过一个HibernateCallback 对象来执行查询
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
List result = null;
try {
result = session.createQuery(hql)
.setInteger(0, tast.getTestJob().getId())
.setFirstResult(offset).setMaxResults(pageSize)
.list();
} catch (Exception e) {
e.printStackTrace();
} finally {
session.close();
}
return result;
}
});
return list;
}
/**
* 使用hql语句进行分页查询
*
* @param hql
* 需要查询的hql语句
* @param value
* 如果hql 有一个参数需要传入value就是传入Hql语句的参数
*
* @param offset
* 第一条记录索引
*
* @param pageSize
* 每页需要显示的记录条数
* @return 当前页的所有记录
*/
public List findByPage(final String hql, final Object value,
final int offset, final int pageSize) {
// 通过一个HibernateCallback 对象来执行查询
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
List result = null;
try {
Query query = session.createQuery(hql);
whereParameter((TestTaskexcute) value, query);
result = query.setFirstResult(offset)
.setMaxResults(pageSize).list();
} catch (Exception e) {
e.printStackTrace();
} finally {
session.close();
}
return result;
}
});
return list;
}
public int findRows(String hql, TestTaskexcute tast) {
int s = 0;
Session session = this.getSession(true);
try {
Query query = session.createQuery(hql);
whereParameter(tast, query);
s = Integer.valueOf(query.list().get(0).toString());
} catch (Exception e) {
e.printStackTrace();
} finally {
session.close();
}
return s;
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public List findTastList(String sql) {
Session session = this.getSession(true);
List tastlist = session.createSQLQuery(sql).list();
session.close();
return tastlist;
}
private void whereParameter(TestTaskexcute tast, Query query) {
if (!StrLib.isEmpty(tast.getStartDate())) {
query.setParameter(0, tast.getStartDate());
}
if (!StrLib.isEmpty(tast.getStartDate())) {
query.setParameter(1, tast.getEndDate());
}
if (tast.getJobid() != 0) {
query.setParameter("jobId", tast.getJobid());
}
if (!StrLib.isEmpty(tast.getTaskId())) {
query.setParameter("taskId", "%" + tast.getTaskId().trim() + "%");
}
if (!StrLib.isEmpty(tast.getTaskStatus()) ) {
query.setParameter("taskStatus", tast.getTaskStatus());
}
}
@Override
public void delete(int id) throws Exception {
TestTaskexcute tast = this.get(id);
this.getHibernateTemplate().delete(tast);
}
@Override
public List listtastinfo(String sql) throws Exception {
// TODO Auto-generated method stub
Session session = this.getSession(true);
List count = session.createSQLQuery(sql).list();
session.close();
return count;
}
@Override
public void delete_forjobid(String hql, int jobid) throws Exception {
Session session=this.getSession(true);
session.beginTransaction();
Query query =session .createQuery(hql);
query.setInteger("jobId", jobid);
query.executeUpdate();
session.getTransaction().commit();
session.close();
}
/*
* public List<TestTastexcute> getListForPage(final String hql, final int
* offset, final int lengh) { log.debug("finding ListForPage"); try { List
* list = getHibernateTemplate().executeFind( new HibernateCallback() {
* public Object doInHibernate(Session session) throws HibernateException,
* SQLException { List list2 = session.createQuery(hql) .setInteger(0, val)
* .setFirstResult(offset) .setMaxResults(lengh).list(); return list2; } });
* return list; } catch (RuntimeException re) {
* log.error("find ListForPage failed", re); throw re; } }
*/
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.apache.log4j.Logger;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.Accident;
import luckyweb.seagull.spring.entity.TestTaskexcute;
import luckyweb.seagull.util.StrLib;
@Repository("tastExcuteDao")
public class TestTastExcuteDaoImpl extends HibernateDaoSupport implements
TestTastExcuteDao {
private static final Logger log = Logger
.getLogger(TestTastExcuteDaoImpl.class);
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public void add(TestTaskexcute tast) {
this.getHibernateTemplate().save(tast);
}
@Override
public List<TestTaskexcute> list(TestTaskexcute tast) {
List<TestTaskexcute> list = null;
Session session = this.getSession(true);
try {
list = session
.createQuery(
"from TestTastexcute where jobid=? order by asc ")
.setInteger(0, tast.getTestJob().getId()).list();
} catch (Exception e) {
e.printStackTrace();
} finally {
session.close();
}
return list;
}
@Override
public TestTaskexcute load(int id) {
/* return (TestTastexcute) this.getSession()
.load(TestTastexcute.class, id);*/
return (TestTaskexcute) this.getHibernateTemplate().get(TestTaskexcute.class, id);
}
@Override
public TestTaskexcute get(int id) {
// return (TestTastexcute) this.getSession().get(TestTastexcute.class, id);
return (TestTaskexcute) this.getHibernateTemplate().get(TestTaskexcute.class, id);
}
/*
* 使用hql语句进行分页查询
*
* @param hql 需要查询的hql语句
*
* @param offset 第一条记录索引
*
* @param pageSize 每页需要显示的记录条数
*
* @return 当前页的所有记录
*/
public List findByPage(final TestTaskexcute tast, final String hql,
final int offset, final int pageSize) {
// 通过一个HibernateCallback 对象来执行查询
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
List result = null;
try {
result = session.createQuery(hql)
.setInteger(0, tast.getTestJob().getId())
.setFirstResult(offset).setMaxResults(pageSize)
.list();
} catch (Exception e) {
e.printStackTrace();
} finally {
session.close();
}
return result;
}
});
return list;
}
/**
* 使用hql语句进行分页查询
*
* @param hql
* 需要查询的hql语句
* @param value
* 如果hql 有一个参数需要传入value就是传入Hql语句的参数
*
* @param offset
* 第一条记录索引
*
* @param pageSize
* 每页需要显示的记录条数
* @return 当前页的所有记录
*/
public List findByPage(final String hql, final Object value,
final int offset, final int pageSize) {
// 通过一个HibernateCallback 对象来执行查询
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
List result = null;
try {
Query query = session.createQuery(hql);
whereParameter((TestTaskexcute) value, query);
result = query.setFirstResult(offset)
.setMaxResults(pageSize).list();
} catch (Exception e) {
e.printStackTrace();
} finally {
session.close();
}
return result;
}
});
return list;
}
public int findRows(String hql, TestTaskexcute tast) {
int s = 0;
Session session = this.getSession(true);
try {
Query query = session.createQuery(hql);
whereParameter(tast, query);
s = Integer.valueOf(query.list().get(0).toString());
} catch (Exception e) {
e.printStackTrace();
} finally {
session.close();
}
return s;
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public List findTastList(String sql) {
Session session = this.getSession(true);
List tastlist = session.createSQLQuery(sql).list();
session.close();
return tastlist;
}
private void whereParameter(TestTaskexcute tast, Query query) {
if (!StrLib.isEmpty(tast.getStartDate())) {
query.setParameter(0, tast.getStartDate());
}
if (!StrLib.isEmpty(tast.getStartDate())) {
query.setParameter(1, tast.getEndDate());
}
if (tast.getJobid() != 0) {
query.setParameter("jobId", tast.getJobid());
}
if (!StrLib.isEmpty(tast.getTaskId())) {
query.setParameter("taskId", "%" + tast.getTaskId().trim() + "%");
}
if (!StrLib.isEmpty(tast.getTaskStatus()) ) {
query.setParameter("taskStatus", tast.getTaskStatus());
}
}
@Override
public void delete(int id) throws Exception {
TestTaskexcute tast = this.get(id);
this.getHibernateTemplate().delete(tast);
}
@Override
public List listtastinfo(String sql) throws Exception {
// TODO Auto-generated method stub
Session session = this.getSession(true);
List count = session.createSQLQuery(sql).list();
session.close();
return count;
}
@Override
public void delete_forjobid(String hql, int jobid) throws Exception {
Session session=this.getSession(true);
session.beginTransaction();
Query query =session .createQuery(hql);
query.setInteger("jobId", jobid);
query.executeUpdate();
session.getTransaction().commit();
session.close();
}
/*
* public List<TestTastexcute> getListForPage(final String hql, final int
* offset, final int lengh) { log.debug("finding ListForPage"); try { List
* list = getHibernateTemplate().executeFind( new HibernateCallback() {
* public Object doInHibernate(Session session) throws HibernateException,
* SQLException { List list2 = session.createQuery(hql) .setInteger(0, val)
* .setFirstResult(offset) .setMaxResults(lengh).list(); return list2; } });
* return list; } catch (RuntimeException re) {
* log.error("find ListForPage failed", re); throw re; } }
*/
}

View File

@ -1,17 +1,17 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.UserAuthority;
@Transactional
public interface UserAuthorityDao {
public UserAuthority load(int id) throws Exception;
public List<UserAuthority> listall() throws Exception;
public List<Object[]> get(String sql) throws Exception;
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.UserAuthority;
@Transactional
public interface UserAuthorityDao {
public UserAuthority load(int id) throws Exception;
public List<UserAuthority> listall() throws Exception;
public List<Object[]> get(String sql) throws Exception;
}

View File

@ -1,48 +1,48 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.UserAuthority;
@Repository("userauthorityDao")
public class UserAuthorityDaoImpl extends HibernateDaoSupport implements UserAuthorityDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public UserAuthority load(int id) throws Exception {
//return (UserInfo)this.getSession().get(UserInfo.class, id);
return (UserAuthority) this.getHibernateTemplate().get(UserAuthority.class, id);
}
@SuppressWarnings("unchecked")
@Override
public List<UserAuthority> listall() throws Exception {
// TODO Auto-generated method stub
return this.getHibernateTemplate().loadAll(UserAuthority.class);
}
@Override
public List<Object[]> get(String sql) throws Exception {
Session session = this.getSession(true);
@SuppressWarnings("unchecked")
List<Object[]> ob = session.createSQLQuery(sql).list();
session.close();
return ob;
}
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.UserAuthority;
@Repository("userauthorityDao")
public class UserAuthorityDaoImpl extends HibernateDaoSupport implements UserAuthorityDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public UserAuthority load(int id) throws Exception {
//return (UserInfo)this.getSession().get(UserInfo.class, id);
return (UserAuthority) this.getHibernateTemplate().get(UserAuthority.class, id);
}
@SuppressWarnings("unchecked")
@Override
public List<UserAuthority> listall() throws Exception {
// TODO Auto-generated method stub
return this.getHibernateTemplate().loadAll(UserAuthority.class);
}
@Override
public List<Object[]> get(String sql) throws Exception {
Session session = this.getSession(true);
@SuppressWarnings("unchecked")
List<Object[]> ob = session.createSQLQuery(sql).list();
session.close();
return ob;
}
}

View File

@ -1,26 +1,26 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.UserInfo;
@Transactional
public interface UserInfoDao {
public UserInfo load(int id) throws Exception;
public int add(UserInfo userinfo) throws Exception;
public void modify(UserInfo userinfo) throws Exception;
public void delete(int id) throws Exception;
public int get(String sql) throws Exception;
@SuppressWarnings("rawtypes")
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(UserInfo userinfo,String hql);
public int sqlfindRows(String hql);
@SuppressWarnings("rawtypes")
public List listsql(String sql) throws Exception;
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.UserInfo;
@Transactional
public interface UserInfoDao {
public UserInfo load(int id) throws Exception;
public int add(UserInfo userinfo) throws Exception;
public void modify(UserInfo userinfo) throws Exception;
public void delete(int id) throws Exception;
public int get(String sql) throws Exception;
@SuppressWarnings("rawtypes")
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(UserInfo userinfo,String hql);
public int sqlfindRows(String hql);
@SuppressWarnings("rawtypes")
public List listsql(String sql) throws Exception;
}

View File

@ -1,155 +1,155 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.Review;
import luckyweb.seagull.spring.entity.UserInfo;
@Repository("userinfoDao")
public class UserInfoDaoImpl extends HibernateDaoSupport implements UserInfoDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public UserInfo load(int id) throws Exception {
//return (UserInfo)this.getSession().get(UserInfo.class, id);
return (UserInfo) this.getHibernateTemplate().get(UserInfo.class, id);
}
@Override
public int add(UserInfo userinfo) throws Exception {
this.getHibernateTemplate().save(userinfo);
return userinfo.getId();
}
@Override
public void modify(UserInfo userinfo) throws Exception {
this.getHibernateTemplate().update(userinfo);
}
@Override
public void delete(int id) throws Exception {
try{
UserInfo userinfo = this.load(id);
this.getHibernateTemplate().delete(userinfo);
}catch(Exception e){
e.printStackTrace();
}
}
@Override
public int get(String sql) throws Exception {
int id = 0;
Session session = this.getSession(true);
@SuppressWarnings("unchecked")
List<Object> count = session.createSQLQuery(sql).list();
if(count.size()!=0){
if(count.get(0)!=null){
id = Integer.valueOf(count.get(0).toString());
}
}
session.close();
return id;
}
private void whereParameter(UserInfo userinfo, Query query) {
if (null!=userinfo.getUsercode()&&!"".equals(userinfo.getUsercode())) {
query.setParameter("usercode", "%"+userinfo.getUsercode()+"%");
}
if (null!=userinfo.getUsername()&&!"".equals(userinfo.getUsername())) {
query.setParameter("username", "%"+userinfo.getUsername()+"%");
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((UserInfo)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(UserInfo userinfo, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(userinfo, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int sqlfindRows(String hql) {
int s=0;
Session session=this.getSession(true);
try {
/*Query query=session.createQuery(hql);*/
Query query= session.createSQLQuery(hql);
s= Integer.valueOf(
query.list().size());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@SuppressWarnings("rawtypes")
@Override
public List listsql(String sql) throws Exception {
List count=null;
Session session=this.getSession(true);
try {
count = session.createSQLQuery(sql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return count;
}
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.Review;
import luckyweb.seagull.spring.entity.UserInfo;
@Repository("userinfoDao")
public class UserInfoDaoImpl extends HibernateDaoSupport implements UserInfoDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public UserInfo load(int id) throws Exception {
//return (UserInfo)this.getSession().get(UserInfo.class, id);
return (UserInfo) this.getHibernateTemplate().get(UserInfo.class, id);
}
@Override
public int add(UserInfo userinfo) throws Exception {
this.getHibernateTemplate().save(userinfo);
return userinfo.getId();
}
@Override
public void modify(UserInfo userinfo) throws Exception {
this.getHibernateTemplate().update(userinfo);
}
@Override
public void delete(int id) throws Exception {
try{
UserInfo userinfo = this.load(id);
this.getHibernateTemplate().delete(userinfo);
}catch(Exception e){
e.printStackTrace();
}
}
@Override
public int get(String sql) throws Exception {
int id = 0;
Session session = this.getSession(true);
@SuppressWarnings("unchecked")
List<Object> count = session.createSQLQuery(sql).list();
if(count.size()!=0){
if(count.get(0)!=null){
id = Integer.valueOf(count.get(0).toString());
}
}
session.close();
return id;
}
private void whereParameter(UserInfo userinfo, Query query) {
if (null!=userinfo.getUsercode()&&!"".equals(userinfo.getUsercode())) {
query.setParameter("usercode", "%"+userinfo.getUsercode()+"%");
}
if (null!=userinfo.getUsername()&&!"".equals(userinfo.getUsername())) {
query.setParameter("username", "%"+userinfo.getUsername()+"%");
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((UserInfo)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(UserInfo userinfo, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(userinfo, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int sqlfindRows(String hql) {
int s=0;
Session session=this.getSession(true);
try {
/*Query query=session.createQuery(hql);*/
Query query= session.createSQLQuery(hql);
s= Integer.valueOf(
query.list().size());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@SuppressWarnings("rawtypes")
@Override
public List listsql(String sql) throws Exception {
List count=null;
Session session=this.getSession(true);
try {
count = session.createSQLQuery(sql).list();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return count;
}
}

View File

@ -1,20 +1,20 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.UserRole;
@Transactional
public interface UserRoleDao {
public UserRole load(int id) throws Exception;
public List<UserRole> listall() throws Exception;
public List<Object[]> get(String sql) throws Exception;
public int add(UserRole userrole) throws Exception;
public void modify(UserRole userrole) throws Exception;
public void delete(int id) throws Exception;
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.UserRole;
@Transactional
public interface UserRoleDao {
public UserRole load(int id) throws Exception;
public List<UserRole> listall() throws Exception;
public List<Object[]> get(String sql) throws Exception;
public int add(UserRole userrole) throws Exception;
public void modify(UserRole userrole) throws Exception;
public void delete(int id) throws Exception;
}

View File

@ -1,69 +1,69 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.UserInfo;
import luckyweb.seagull.spring.entity.UserRole;
@Repository("userroleDao")
public class UserRoleDaoImpl extends HibernateDaoSupport implements UserRoleDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public UserRole load(int id) throws Exception {
//return (UserInfo)this.getSession().get(UserInfo.class, id);
return (UserRole) this.getHibernateTemplate().get(UserRole.class, id);
}
@SuppressWarnings("unchecked")
@Override
public List<UserRole> listall() throws Exception {
// TODO Auto-generated method stub
return this.getHibernateTemplate().loadAll(UserRole.class);
}
@Override
public List<Object[]> get(String sql) throws Exception {
Session session = this.getSession(true);
@SuppressWarnings("unchecked")
List<Object[]> ob = session.createSQLQuery(sql).list();
session.close();
return ob;
}
@Override
public int add(UserRole userrole) throws Exception {
this.getHibernateTemplate().save(userrole);
return userrole.getId();
}
@Override
public void modify(UserRole userrole) throws Exception {
this.getHibernateTemplate().update(userrole);
}
@Override
public void delete(int id) throws Exception {
try{
UserRole userrole = this.load(id);
this.getHibernateTemplate().delete(userrole);
}catch(Exception e){
e.printStackTrace();
}
}
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.UserInfo;
import luckyweb.seagull.spring.entity.UserRole;
@Repository("userroleDao")
public class UserRoleDaoImpl extends HibernateDaoSupport implements UserRoleDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public UserRole load(int id) throws Exception {
//return (UserInfo)this.getSession().get(UserInfo.class, id);
return (UserRole) this.getHibernateTemplate().get(UserRole.class, id);
}
@SuppressWarnings("unchecked")
@Override
public List<UserRole> listall() throws Exception {
// TODO Auto-generated method stub
return this.getHibernateTemplate().loadAll(UserRole.class);
}
@Override
public List<Object[]> get(String sql) throws Exception {
Session session = this.getSession(true);
@SuppressWarnings("unchecked")
List<Object[]> ob = session.createSQLQuery(sql).list();
session.close();
return ob;
}
@Override
public int add(UserRole userrole) throws Exception {
this.getHibernateTemplate().save(userrole);
return userrole.getId();
}
@Override
public void modify(UserRole userrole) throws Exception {
this.getHibernateTemplate().update(userrole);
}
@Override
public void delete(int id) throws Exception {
try{
UserRole userrole = this.load(id);
this.getHibernateTemplate().delete(userrole);
}catch(Exception e){
e.printStackTrace();
}
}
}

View File

@ -1,26 +1,26 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.ZtTask;
@Transactional
public interface ZtTaskDao {
public ZtTask load(int id) throws Exception;
public int add(ZtTask zt) throws Exception;
public void delete(String hql) throws Exception;
public List findByPage(final String hql, final Object value, final int offset, final int pageSize);
public int findRows(ZtTask zt, String hql);
public int findRowsreport(String hql);
public List findByPagereport(final String hql,final int offset, final int pageSize);
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import luckyweb.seagull.spring.entity.ZtTask;
@Transactional
public interface ZtTaskDao {
public ZtTask load(int id) throws Exception;
public int add(ZtTask zt) throws Exception;
public void delete(String hql) throws Exception;
public List findByPage(final String hql, final Object value, final int offset, final int pageSize);
public int findRows(ZtTask zt, String hql);
public int findRowsreport(String hql);
public List findByPagereport(final String hql,final int offset, final int pageSize);
}

View File

@ -1,154 +1,154 @@
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.Accident;
import luckyweb.seagull.spring.entity.ProjectVersion;
import luckyweb.seagull.spring.entity.TestJobs;
import luckyweb.seagull.spring.entity.ZtTask;
@Repository("zttaskDao")
public class ZtTaskDaoImpl extends HibernateDaoSupport implements ZtTaskDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public ZtTask load(int id) throws Exception {
return (ZtTask) this.getHibernateTemplate().get(ZtTask.class, id);
}
@Override
public int add(ZtTask zt) throws Exception {
this.getHibernateTemplate().save(zt);
return zt.getId();
}
@Override
public void delete(String sql) throws Exception {
Session session=this.getSession(true);
session.beginTransaction();
Query query =session.createSQLQuery(sql);
query.executeUpdate();
session.getTransaction().commit();
session.close();
}
private void whereParameter(ZtTask zt, Query query) {
if (zt.getVersionid()!=0) {
query.setParameter("versionid", zt.getVersionid());
}
if (zt.getDelaystatus()!=0&&!"".equals(zt.getDelaystatus())) {
query.setParameter("delaystatus", zt.getDelaystatus());
}
if (zt.getVersionname()!=null&&!"".equals(zt.getVersionname())) {
query.setParameter("versionname", "%"+zt.getVersionname()+"%");
}
if (zt.getFinishedname()!=null&&!"".equals(zt.getFinishedname())) {
query.setParameter("finishedname", "%"+zt.getFinishedname()+"%");
}
if (zt.getAssstartDate()!=null&&!"".equals(zt.getAssstartDate())) {
query.setParameter("assstartDate", zt.getAssstartDate()+" 00:00:00.0");
}
if (zt.getAssendDate()!=null&&!"".equals(zt.getAssendDate())) {
query.setParameter("assendDate", zt.getAssendDate()+" 24:59:59.59");
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((ZtTask)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(ZtTask zt, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(zt, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int findRowsreport(String hql) {
int s=0;
Session session=this.getSession(true);
try {
/*Query query=session.createQuery(hql);*/
Query query= session.createSQLQuery(hql);
s= Integer.valueOf(
query.list().size());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public List findByPagereport(final String hql,final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
//Query query= session.createQuery(hql);
Query query= session.createSQLQuery(hql);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
}
package luckyweb.seagull.spring.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.Accident;
import luckyweb.seagull.spring.entity.ProjectVersion;
import luckyweb.seagull.spring.entity.TestJobs;
import luckyweb.seagull.spring.entity.ZtTask;
@Repository("zttaskDao")
public class ZtTaskDaoImpl extends HibernateDaoSupport implements ZtTaskDao{
@Resource(name = "sessionFactory")
public void setSuperSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
@Override
public ZtTask load(int id) throws Exception {
return (ZtTask) this.getHibernateTemplate().get(ZtTask.class, id);
}
@Override
public int add(ZtTask zt) throws Exception {
this.getHibernateTemplate().save(zt);
return zt.getId();
}
@Override
public void delete(String sql) throws Exception {
Session session=this.getSession(true);
session.beginTransaction();
Query query =session.createSQLQuery(sql);
query.executeUpdate();
session.getTransaction().commit();
session.close();
}
private void whereParameter(ZtTask zt, Query query) {
if (zt.getVersionid()!=0) {
query.setParameter("versionid", zt.getVersionid());
}
if (zt.getDelaystatus()!=0&&!"".equals(zt.getDelaystatus())) {
query.setParameter("delaystatus", zt.getDelaystatus());
}
if (zt.getVersionname()!=null&&!"".equals(zt.getVersionname())) {
query.setParameter("versionname", "%"+zt.getVersionname()+"%");
}
if (zt.getFinishedname()!=null&&!"".equals(zt.getFinishedname())) {
query.setParameter("finishedname", "%"+zt.getFinishedname()+"%");
}
if (zt.getAssstartDate()!=null&&!"".equals(zt.getAssstartDate())) {
query.setParameter("assstartDate", zt.getAssstartDate()+" 00:00:00.0");
}
if (zt.getAssendDate()!=null&&!"".equals(zt.getAssendDate())) {
query.setParameter("assendDate", zt.getAssendDate()+" 24:59:59.59");
}
}
@Override
public List findByPage(final String hql, final Object value, final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
Query query= session.createQuery(hql);
whereParameter((ZtTask)value, query);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
@Override
public int findRows(ZtTask zt, String hql) {
int s=0;
Session session=this.getSession(true);
try {
Query query=session.createQuery(hql);
whereParameter(zt, query);
s= Integer.valueOf(
query
.list().get(0)
.toString());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public int findRowsreport(String hql) {
int s=0;
Session session=this.getSession(true);
try {
/*Query query=session.createQuery(hql);*/
Query query= session.createSQLQuery(hql);
s= Integer.valueOf(
query.list().size());
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
return s;
}
@Override
public List findByPagereport(final String hql,final int offset, final int pageSize) {
// TODO Auto-generated method stub
// 通过一个HibernateCallback 对象来执行查询
//System.out.println(hql);
List list = getHibernateTemplate().executeFind(new HibernateCallback() {
// 实现hibernateCallback接口必须实现的方法
public Object doInHibernate(Session session)
throws HibernateException {
// 执行hibernate 分页查询
//Query query= session.createQuery(hql);
Query query= session.createSQLQuery(hql);
List result =query
.setFirstResult(offset).setMaxResults(pageSize).list();
session.close();
return result;
}
});
return list;
}
}

View File

@ -1,198 +1,198 @@
package luckyweb.seagull.spring.entity;
import javax.persistence.Entity;
@Entity(name="accident")
public class Accident implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private int id;
private int projectid;
private String accstatus;
private String eventtime;
private String reporter;
private String reporttime;
private String accdescription;
private String acclevel;
private String causalanalysis;
private String causaltype;
private String consequenceanalysis;
private SectorProjects sectorProjects;
private String correctiveaction;
private String resolutiontime;
private String resolutioner;
private String preventiveaction;
private String preventiver;
private String preventiveplandate;
private String preventiveaccdate;
private String accstarttime;
private String accendtime;
private Long trouble_duration;
private Long impact_time;
private String strtrouble_duration;
private String strimpact_time;
private String filename;
public String getFilename() {
return filename;
}
public void setFilename(String filename) {
this.filename = filename;
}
public String getStrtrouble_duration() {
return strtrouble_duration;
}
public void setStrtrouble_duration(String strtrouble_duration) {
this.strtrouble_duration = strtrouble_duration;
}
public String getStrimpact_time() {
return strimpact_time;
}
public void setStrimpact_time(String strimpact_time) {
this.strimpact_time = strimpact_time;
}
public Long getTrouble_duration() {
return trouble_duration;
}
public void setTrouble_duration(Long trouble_duration) {
this.trouble_duration = trouble_duration;
}
public Long getImpact_time() {
return impact_time;
}
public void setImpact_time(Long impact_time) {
this.impact_time = impact_time;
}
public String getAccstarttime() {
return accstarttime;
}
public void setAccstarttime(String accstarttime) {
this.accstarttime = accstarttime;
}
public String getAccendtime() {
return accendtime;
}
public void setAccendtime(String accendtime) {
this.accendtime = accendtime;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getProjectid() {
return projectid;
}
public void setProjectid(int projectid) {
this.projectid = projectid;
}
public String getAccstatus() {
return accstatus;
}
public void setAccstatus(String accstatus) {
this.accstatus = accstatus;
}
public String getEventtime() {
return eventtime;
}
public void setEventtime(String eventtime) {
this.eventtime = eventtime;
}
public String getReporter() {
return reporter;
}
public void setReporter(String reporter) {
this.reporter = reporter;
}
public String getReporttime() {
return reporttime;
}
public void setReporttime(String reporttime) {
this.reporttime = reporttime;
}
public String getAccdescription() {
return accdescription;
}
public void setAccdescription(String accdescription) {
this.accdescription = accdescription;
}
public String getAcclevel() {
return acclevel;
}
public void setAcclevel(String acclevel) {
this.acclevel = acclevel;
}
public String getCausalanalysis() {
return causalanalysis;
}
public void setCausalanalysis(String causalanalysis) {
this.causalanalysis = causalanalysis;
}
public String getCausaltype() {
return causaltype;
}
public void setCausaltype(String causaltype) {
this.causaltype = causaltype;
}
public String getConsequenceanalysis() {
return consequenceanalysis;
}
public void setConsequenceanalysis(String consequenceanalysis) {
this.consequenceanalysis = consequenceanalysis;
}
public SectorProjects getSectorProjects() {
return sectorProjects;
}
public void setSectorProjects(SectorProjects sectorProjects) {
this.sectorProjects = sectorProjects;
}
public String getCorrectiveaction() {
return correctiveaction;
}
public void setCorrectiveaction(String correctiveaction) {
this.correctiveaction = correctiveaction;
}
public String getResolutiontime() {
return resolutiontime;
}
public void setResolutiontime(String resolutiontime) {
this.resolutiontime = resolutiontime;
}
public String getResolutioner() {
return resolutioner;
}
public void setResolutioner(String resolutioner) {
this.resolutioner = resolutioner;
}
public String getPreventiveaction() {
return preventiveaction;
}
public void setPreventiveaction(String preventiveaction) {
this.preventiveaction = preventiveaction;
}
public String getPreventiver() {
return preventiver;
}
public void setPreventiver(String preventiver) {
this.preventiver = preventiver;
}
public String getPreventiveplandate() {
return preventiveplandate;
}
public void setPreventiveplandate(String preventiveplandate) {
this.preventiveplandate = preventiveplandate;
}
public String getPreventiveaccdate() {
return preventiveaccdate;
}
public void setPreventiveaccdate(String preventiveaccdate) {
this.preventiveaccdate = preventiveaccdate;
}
}
package luckyweb.seagull.spring.entity;
import javax.persistence.Entity;
@Entity(name="accident")
public class Accident implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private int id;
private int projectid;
private String accstatus;
private String eventtime;
private String reporter;
private String reporttime;
private String accdescription;
private String acclevel;
private String causalanalysis;
private String causaltype;
private String consequenceanalysis;
private SectorProjects sectorProjects;
private String correctiveaction;
private String resolutiontime;
private String resolutioner;
private String preventiveaction;
private String preventiver;
private String preventiveplandate;
private String preventiveaccdate;
private String accstarttime;
private String accendtime;
private Long trouble_duration;
private Long impact_time;
private String strtrouble_duration;
private String strimpact_time;
private String filename;
public String getFilename() {
return filename;
}
public void setFilename(String filename) {
this.filename = filename;
}
public String getStrtrouble_duration() {
return strtrouble_duration;
}
public void setStrtrouble_duration(String strtrouble_duration) {
this.strtrouble_duration = strtrouble_duration;
}
public String getStrimpact_time() {
return strimpact_time;
}
public void setStrimpact_time(String strimpact_time) {
this.strimpact_time = strimpact_time;
}
public Long getTrouble_duration() {
return trouble_duration;
}
public void setTrouble_duration(Long trouble_duration) {
this.trouble_duration = trouble_duration;
}
public Long getImpact_time() {
return impact_time;
}
public void setImpact_time(Long impact_time) {
this.impact_time = impact_time;
}
public String getAccstarttime() {
return accstarttime;
}
public void setAccstarttime(String accstarttime) {
this.accstarttime = accstarttime;
}
public String getAccendtime() {
return accendtime;
}
public void setAccendtime(String accendtime) {
this.accendtime = accendtime;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getProjectid() {
return projectid;
}
public void setProjectid(int projectid) {
this.projectid = projectid;
}
public String getAccstatus() {
return accstatus;
}
public void setAccstatus(String accstatus) {
this.accstatus = accstatus;
}
public String getEventtime() {
return eventtime;
}
public void setEventtime(String eventtime) {
this.eventtime = eventtime;
}
public String getReporter() {
return reporter;
}
public void setReporter(String reporter) {
this.reporter = reporter;
}
public String getReporttime() {
return reporttime;
}
public void setReporttime(String reporttime) {
this.reporttime = reporttime;
}
public String getAccdescription() {
return accdescription;
}
public void setAccdescription(String accdescription) {
this.accdescription = accdescription;
}
public String getAcclevel() {
return acclevel;
}
public void setAcclevel(String acclevel) {
this.acclevel = acclevel;
}
public String getCausalanalysis() {
return causalanalysis;
}
public void setCausalanalysis(String causalanalysis) {
this.causalanalysis = causalanalysis;
}
public String getCausaltype() {
return causaltype;
}
public void setCausaltype(String causaltype) {
this.causaltype = causaltype;
}
public String getConsequenceanalysis() {
return consequenceanalysis;
}
public void setConsequenceanalysis(String consequenceanalysis) {
this.consequenceanalysis = consequenceanalysis;
}
public SectorProjects getSectorProjects() {
return sectorProjects;
}
public void setSectorProjects(SectorProjects sectorProjects) {
this.sectorProjects = sectorProjects;
}
public String getCorrectiveaction() {
return correctiveaction;
}
public void setCorrectiveaction(String correctiveaction) {
this.correctiveaction = correctiveaction;
}
public String getResolutiontime() {
return resolutiontime;
}
public void setResolutiontime(String resolutiontime) {
this.resolutiontime = resolutiontime;
}
public String getResolutioner() {
return resolutioner;
}
public void setResolutioner(String resolutioner) {
this.resolutioner = resolutioner;
}
public String getPreventiveaction() {
return preventiveaction;
}
public void setPreventiveaction(String preventiveaction) {
this.preventiveaction = preventiveaction;
}
public String getPreventiver() {
return preventiver;
}
public void setPreventiver(String preventiver) {
this.preventiver = preventiver;
}
public String getPreventiveplandate() {
return preventiveplandate;
}
public void setPreventiveplandate(String preventiveplandate) {
this.preventiveplandate = preventiveplandate;
}
public String getPreventiveaccdate() {
return preventiveaccdate;
}
public void setPreventiveaccdate(String preventiveaccdate) {
this.preventiveaccdate = preventiveaccdate;
}
}

View File

@ -1,46 +1,46 @@
package luckyweb.seagull.spring.entity;
import java.util.Map;
import javax.persistence.Entity;
@Entity(name="barchart3")
public class Barchart3 implements java.io.Serializable{
private static final long serialVersionUID = 1L;
private String type;
private Map markPoint;
private Map markLine;
private String name;
private double[] data;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double[] getData() {
return data;
}
public void setData(double[] data) {
this.data = data;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Map getMarkPoint() {
return markPoint;
}
public void setMarkPoint(Map markPoint) {
this.markPoint = markPoint;
}
public Map getMarkLine() {
return markLine;
}
public void setMarkLine(Map markLine) {
this.markLine = markLine;
}
}
package luckyweb.seagull.spring.entity;
import java.util.Map;
import javax.persistence.Entity;
@Entity(name="barchart3")
public class Barchart3 implements java.io.Serializable{
private static final long serialVersionUID = 1L;
private String type;
private Map markPoint;
private Map markLine;
private String name;
private double[] data;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double[] getData() {
return data;
}
public void setData(double[] data) {
this.data = data;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Map getMarkPoint() {
return markPoint;
}
public void setMarkPoint(Map markPoint) {
this.markPoint = markPoint;
}
public Map getMarkLine() {
return markLine;
}
public void setMarkLine(Map markLine) {
this.markLine = markLine;
}
}

View File

@ -1,47 +1,47 @@
package luckyweb.seagull.spring.entity;
import java.util.Map;
import javax.persistence.Entity;
@Entity(name="barchart3")
public class Barchart4 implements java.io.Serializable{
private static final long serialVersionUID = 1L;
private String type;
private String stack;
private Map itemStyle;
private String name;
private double[] data;
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getStack() {
return stack;
}
public void setStack(String stack) {
this.stack = stack;
}
public Map getItemStyle() {
return itemStyle;
}
public void setItemStyle(Map itemStyle) {
this.itemStyle = itemStyle;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double[] getData() {
return data;
}
public void setData(double[] data) {
this.data = data;
}
}
package luckyweb.seagull.spring.entity;
import java.util.Map;
import javax.persistence.Entity;
@Entity(name="barchart3")
public class Barchart4 implements java.io.Serializable{
private static final long serialVersionUID = 1L;
private String type;
private String stack;
private Map itemStyle;
private String name;
private double[] data;
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getStack() {
return stack;
}
public void setStack(String stack) {
this.stack = stack;
}
public Map getItemStyle() {
return itemStyle;
}
public void setItemStyle(Map itemStyle) {
this.itemStyle = itemStyle;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double[] getData() {
return data;
}
public void setData(double[] data) {
this.data = data;
}
}

View File

@ -1,126 +1,126 @@
package luckyweb.seagull.spring.entity;
import javax.persistence.Entity;
@Entity(name="flowCheck")
public class FlowCheck implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private int id;
private int checkid;
private int projectid;
private String projectphase;
private String phasenode;
private String checkentry;
private String checkresult;
private String checkdate;
private String checkdescriptions;
private String stateupdate;
private String updatedate;
private String remark;
private SectorProjects sectorProjects;
private String checkstartdate;
private String checkenddate;
private String versionnum;
public String getVersionnum() {
return versionnum;
}
public void setVersionnum(String versionnum) {
this.versionnum = versionnum;
}
public String getCheckstartdate() {
return checkstartdate;
}
public void setCheckstartdate(String checkstartdate) {
this.checkstartdate = checkstartdate;
}
public String getCheckenddate() {
return checkenddate;
}
public void setCheckenddate(String checkenddate) {
this.checkenddate = checkenddate;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getCheckid() {
return checkid;
}
public void setCheckid(int checkid) {
this.checkid = checkid;
}
public int getProjectid() {
return projectid;
}
public void setProjectid(int projectid) {
this.projectid = projectid;
}
public String getProjectphase() {
return projectphase;
}
public void setProjectphase(String projectphase) {
this.projectphase = projectphase;
}
public String getPhasenode() {
return phasenode;
}
public void setPhasenode(String phasenode) {
this.phasenode = phasenode;
}
public String getCheckentry() {
return checkentry;
}
public void setCheckentry(String checkentry) {
this.checkentry = checkentry;
}
public String getCheckresult() {
return checkresult;
}
public void setCheckresult(String checkresult) {
this.checkresult = checkresult;
}
public String getCheckdate() {
return checkdate;
}
public void setCheckdate(String checkdate) {
this.checkdate = checkdate;
}
public String getCheckdescriptions() {
return checkdescriptions;
}
public void setCheckdescriptions(String checkdescriptions) {
this.checkdescriptions = checkdescriptions;
}
public String getStateupdate() {
return stateupdate;
}
public void setStateupdate(String stateupdate) {
this.stateupdate = stateupdate;
}
public String getUpdatedate() {
return updatedate;
}
public void setUpdatedate(String updatedate) {
this.updatedate = updatedate;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public SectorProjects getSectorProjects() {
return sectorProjects;
}
public void setSectorProjects(SectorProjects sectorProjects) {
this.sectorProjects = sectorProjects;
}
}
package luckyweb.seagull.spring.entity;
import javax.persistence.Entity;
@Entity(name="flowCheck")
public class FlowCheck implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private int id;
private int checkid;
private int projectid;
private String projectphase;
private String phasenode;
private String checkentry;
private String checkresult;
private String checkdate;
private String checkdescriptions;
private String stateupdate;
private String updatedate;
private String remark;
private SectorProjects sectorProjects;
private String checkstartdate;
private String checkenddate;
private String versionnum;
public String getVersionnum() {
return versionnum;
}
public void setVersionnum(String versionnum) {
this.versionnum = versionnum;
}
public String getCheckstartdate() {
return checkstartdate;
}
public void setCheckstartdate(String checkstartdate) {
this.checkstartdate = checkstartdate;
}
public String getCheckenddate() {
return checkenddate;
}
public void setCheckenddate(String checkenddate) {
this.checkenddate = checkenddate;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getCheckid() {
return checkid;
}
public void setCheckid(int checkid) {
this.checkid = checkid;
}
public int getProjectid() {
return projectid;
}
public void setProjectid(int projectid) {
this.projectid = projectid;
}
public String getProjectphase() {
return projectphase;
}
public void setProjectphase(String projectphase) {
this.projectphase = projectphase;
}
public String getPhasenode() {
return phasenode;
}
public void setPhasenode(String phasenode) {
this.phasenode = phasenode;
}
public String getCheckentry() {
return checkentry;
}
public void setCheckentry(String checkentry) {
this.checkentry = checkentry;
}
public String getCheckresult() {
return checkresult;
}
public void setCheckresult(String checkresult) {
this.checkresult = checkresult;
}
public String getCheckdate() {
return checkdate;
}
public void setCheckdate(String checkdate) {
this.checkdate = checkdate;
}
public String getCheckdescriptions() {
return checkdescriptions;
}
public void setCheckdescriptions(String checkdescriptions) {
this.checkdescriptions = checkdescriptions;
}
public String getStateupdate() {
return stateupdate;
}
public void setStateupdate(String stateupdate) {
this.stateupdate = stateupdate;
}
public String getUpdatedate() {
return updatedate;
}
public void setUpdatedate(String updatedate) {
this.updatedate = updatedate;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public SectorProjects getSectorProjects() {
return sectorProjects;
}
public void setSectorProjects(SectorProjects sectorProjects) {
this.sectorProjects = sectorProjects;
}
}

View File

@ -1,70 +1,70 @@
package luckyweb.seagull.spring.entity;
import javax.persistence.Entity;
@Entity(name="flowInfo")
public class FlowInfo implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private int id;
private int phaseid;
private String phasename;
private int phasenodeid;
private String phasenodename;
private int checkentryid;
private String checkentry;
private String remark;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getPhaseid() {
return phaseid;
}
public void setPhaseid(int phaseid) {
this.phaseid = phaseid;
}
public String getPhasename() {
return phasename;
}
public void setPhasename(String phasename) {
this.phasename = phasename;
}
public int getPhasenodeid() {
return phasenodeid;
}
public void setPhasenodeid(int phasenodeid) {
this.phasenodeid = phasenodeid;
}
public String getPhasenodename() {
return phasenodename;
}
public void setPhasenodename(String phasenodename) {
this.phasenodename = phasenodename;
}
public int getCheckentryid() {
return checkentryid;
}
public void setCheckentryid(int checkentryid) {
this.checkentryid = checkentryid;
}
public String getCheckentry() {
return checkentry;
}
public void setCheckentry(String checkentry) {
this.checkentry = checkentry;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}
package luckyweb.seagull.spring.entity;
import javax.persistence.Entity;
@Entity(name="flowInfo")
public class FlowInfo implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private int id;
private int phaseid;
private String phasename;
private int phasenodeid;
private String phasenodename;
private int checkentryid;
private String checkentry;
private String remark;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getPhaseid() {
return phaseid;
}
public void setPhaseid(int phaseid) {
this.phaseid = phaseid;
}
public String getPhasename() {
return phasename;
}
public void setPhasename(String phasename) {
this.phasename = phasename;
}
public int getPhasenodeid() {
return phasenodeid;
}
public void setPhasenodeid(int phasenodeid) {
this.phasenodeid = phasenodeid;
}
public String getPhasenodename() {
return phasenodename;
}
public void setPhasenodename(String phasenodename) {
this.phasenodename = phasenodename;
}
public int getCheckentryid() {
return checkentryid;
}
public void setCheckentryid(int checkentryid) {
this.checkentryid = checkentryid;
}
public String getCheckentry() {
return checkentry;
}
public void setCheckentry(String checkentry) {
this.checkentry = checkentry;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}

View File

@ -1,85 +1,85 @@
package luckyweb.seagull.spring.entity;
import javax.persistence.Entity;
@Entity(name="operationLog")
public class OperationLog implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private int id = 0;
private String tablename;
private int tableid;
private int projectid;
private String operation_time;
private String operationer;
private String operation_description;
private String starttime;
private String endtime;
private SectorProjects sectorProjects;
public SectorProjects getSectorProjects() {
return sectorProjects;
}
public void setSectorProjects(SectorProjects sectorProjects) {
this.sectorProjects = sectorProjects;
}
public String getStarttime() {
return starttime;
}
public void setStarttime(String starttime) {
this.starttime = starttime;
}
public String getEndtime() {
return endtime;
}
public void setEndtime(String endtime) {
this.endtime = endtime;
}
public int getProjectid() {
return projectid;
}
public void setProjectid(int projectid) {
this.projectid = projectid;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTablename() {
return tablename;
}
public void setTablename(String tablename) {
this.tablename = tablename;
}
public int getTableid() {
return tableid;
}
public void setTableid(int tableid) {
this.tableid = tableid;
}
public String getOperation_time() {
return operation_time;
}
public void setOperation_time(String operation_time) {
this.operation_time = operation_time;
}
public String getOperationer() {
return operationer;
}
public void setOperationer(String operationer) {
this.operationer = operationer;
}
public String getOperation_description() {
return operation_description;
}
public void setOperation_description(String operation_description) {
this.operation_description = operation_description;
}
}
package luckyweb.seagull.spring.entity;
import javax.persistence.Entity;
@Entity(name="operationLog")
public class OperationLog implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private int id = 0;
private String tablename;
private int tableid;
private int projectid;
private String operation_time;
private String operationer;
private String operation_description;
private String starttime;
private String endtime;
private SectorProjects sectorProjects;
public SectorProjects getSectorProjects() {
return sectorProjects;
}
public void setSectorProjects(SectorProjects sectorProjects) {
this.sectorProjects = sectorProjects;
}
public String getStarttime() {
return starttime;
}
public void setStarttime(String starttime) {
this.starttime = starttime;
}
public String getEndtime() {
return endtime;
}
public void setEndtime(String endtime) {
this.endtime = endtime;
}
public int getProjectid() {
return projectid;
}
public void setProjectid(int projectid) {
this.projectid = projectid;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTablename() {
return tablename;
}
public void setTablename(String tablename) {
this.tablename = tablename;
}
public int getTableid() {
return tableid;
}
public void setTableid(int tableid) {
this.tableid = tableid;
}
public String getOperation_time() {
return operation_time;
}
public void setOperation_time(String operation_time) {
this.operation_time = operation_time;
}
public String getOperationer() {
return operationer;
}
public void setOperationer(String operationer) {
this.operationer = operationer;
}
public String getOperation_description() {
return operation_description;
}
public void setOperation_description(String operation_description) {
this.operation_description = operation_description;
}
}

View File

@ -1,25 +1,25 @@
package luckyweb.seagull.spring.entity;
import javax.persistence.Entity;
@Entity(name="pielasagna")
public class PieLasagna implements java.io.Serializable{
private static final long serialVersionUID = 1L;
private String name;
private double value;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getValue() {
return value;
}
public void setValue(double value) {
this.value = value;
}
}
package luckyweb.seagull.spring.entity;
import javax.persistence.Entity;
@Entity(name="pielasagna")
public class PieLasagna implements java.io.Serializable{
private static final long serialVersionUID = 1L;
private String name;
private double value;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getValue() {
return value;
}
public void setValue(double value) {
this.value = value;
}
}

View File

@ -1,21 +1,21 @@
package luckyweb.seagull.spring.entity;
import java.util.Map;
import javax.persistence.Entity;
@Entity(name="barchart3")
public class Piechart5 implements java.io.Serializable{
private static final long serialVersionUID = 1L;
private String type;
private String center[];
private String radius;
private String x;
private String itemStyle;
private Map markPoint;
private Map markLine;
private String name;
private double[] data;
}
package luckyweb.seagull.spring.entity;
import java.util.Map;
import javax.persistence.Entity;
@Entity(name="barchart3")
public class Piechart5 implements java.io.Serializable{
private static final long serialVersionUID = 1L;
private String type;
private String center[];
private String radius;
private String x;
private String itemStyle;
private Map markPoint;
private Map markLine;
private String name;
private double[] data;
}

View File

@ -1,77 +1,77 @@
package luckyweb.seagull.spring.entity;
import javax.persistence.Entity;
@Entity(name="planflowCheck")
public class PlanFlowCheck implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private int id;
private int projectid;
private String versionnum;
private String checkentryid;
private String plandate;
private int status;
private String checkphase;
private String checknode;
public String getCheckphase() {
return checkphase;
}
public void setCheckphase(String checkphase) {
this.checkphase = checkphase;
}
public String getChecknode() {
return checknode;
}
public void setChecknode(String checknode) {
this.checknode = checknode;
}
private SectorProjects sectorProjects;
public SectorProjects getSectorProjects() {
return sectorProjects;
}
public void setSectorProjects(SectorProjects sectorProjects) {
this.sectorProjects = sectorProjects;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getProjectid() {
return projectid;
}
public void setProjectid(int projectid) {
this.projectid = projectid;
}
public String getVersionnum() {
return versionnum;
}
public void setVersionnum(String versionnum) {
this.versionnum = versionnum;
}
public String getCheckentryid() {
return checkentryid;
}
public void setCheckentryid(String checkentryid) {
this.checkentryid = checkentryid;
}
public String getPlandate() {
return plandate;
}
public void setPlandate(String plandate) {
this.plandate = plandate;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
}
package luckyweb.seagull.spring.entity;
import javax.persistence.Entity;
@Entity(name="planflowCheck")
public class PlanFlowCheck implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private int id;
private int projectid;
private String versionnum;
private String checkentryid;
private String plandate;
private int status;
private String checkphase;
private String checknode;
public String getCheckphase() {
return checkphase;
}
public void setCheckphase(String checkphase) {
this.checkphase = checkphase;
}
public String getChecknode() {
return checknode;
}
public void setChecknode(String checknode) {
this.checknode = checknode;
}
private SectorProjects sectorProjects;
public SectorProjects getSectorProjects() {
return sectorProjects;
}
public void setSectorProjects(SectorProjects sectorProjects) {
this.sectorProjects = sectorProjects;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getProjectid() {
return projectid;
}
public void setProjectid(int projectid) {
this.projectid = projectid;
}
public String getVersionnum() {
return versionnum;
}
public void setVersionnum(String versionnum) {
this.versionnum = versionnum;
}
public String getCheckentryid() {
return checkentryid;
}
public void setCheckentryid(String checkentryid) {
this.checkentryid = checkentryid;
}
public String getPlandate() {
return plandate;
}
public void setPlandate(String plandate) {
this.plandate = plandate;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
}

View File

@ -1,120 +1,120 @@
package luckyweb.seagull.spring.entity;
import javax.persistence.Entity;
@Entity(name="projectCase")
public class ProjectCase implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private int id;
private String sign;
private String name;
private int projectid;
private int moduleid;
private Integer[] moduleidarr;
private String modulename;
private int projectindex;
private String projectname;
private String remark;
private int casetype;
private String time;
private String operationer;
private int priority;
private int checktype;
public Integer[] getModuleidarr() {
return moduleidarr;
}
public void setModuleidarr(Integer[] moduleidarr) {
this.moduleidarr = moduleidarr;
}
public String getModulename() {
return modulename;
}
public void setModulename(String modulename) {
this.modulename = modulename;
}
public int getModuleid() {
return moduleid;
}
public void setModuleid(int moduleid) {
this.moduleid = moduleid;
}
public int getProjectindex() {
return projectindex;
}
public void setProjectindex(int projectindex) {
this.projectindex = projectindex;
}
public int getChecktype() {
return checktype;
}
public void setChecktype(int checktype) {
this.checktype = checktype;
}
public int getPriority() {
return priority;
}
public void setPriority(int priority) {
this.priority = priority;
}
public String getProjectname() {
return projectname;
}
public void setProjectname(String projectname) {
this.projectname = projectname;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getSign() {
return sign;
}
public void setSign(String sign) {
this.sign = sign;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getProjectid() {
return projectid;
}
public void setProjectid(int projectid) {
this.projectid = projectid;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public int getCasetype() {
return casetype;
}
public void setCasetype(int casetype) {
this.casetype = casetype;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getOperationer() {
return operationer;
}
public void setOperationer(String operationer) {
this.operationer = operationer;
}
}
package luckyweb.seagull.spring.entity;
import javax.persistence.Entity;
@Entity(name="projectCase")
public class ProjectCase implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private int id;
private String sign;
private String name;
private int projectid;
private int moduleid;
private Integer[] moduleidarr;
private String modulename;
private int projectindex;
private String projectname;
private String remark;
private int casetype;
private String time;
private String operationer;
private int priority;
private int checktype;
public Integer[] getModuleidarr() {
return moduleidarr;
}
public void setModuleidarr(Integer[] moduleidarr) {
this.moduleidarr = moduleidarr;
}
public String getModulename() {
return modulename;
}
public void setModulename(String modulename) {
this.modulename = modulename;
}
public int getModuleid() {
return moduleid;
}
public void setModuleid(int moduleid) {
this.moduleid = moduleid;
}
public int getProjectindex() {
return projectindex;
}
public void setProjectindex(int projectindex) {
this.projectindex = projectindex;
}
public int getChecktype() {
return checktype;
}
public void setChecktype(int checktype) {
this.checktype = checktype;
}
public int getPriority() {
return priority;
}
public void setPriority(int priority) {
this.priority = priority;
}
public String getProjectname() {
return projectname;
}
public void setProjectname(String projectname) {
this.projectname = projectname;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getSign() {
return sign;
}
public void setSign(String sign) {
this.sign = sign;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getProjectid() {
return projectid;
}
public void setProjectid(int projectid) {
this.projectid = projectid;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public int getCasetype() {
return casetype;
}
public void setCasetype(int casetype) {
this.casetype = casetype;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getOperationer() {
return operationer;
}
public void setOperationer(String operationer) {
this.operationer = operationer;
}
}

View File

@ -1,104 +1,104 @@
package luckyweb.seagull.spring.entity;
import javax.persistence.Entity;
@Entity(name="projectCasesteps")
public class ProjectCasesteps implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private int id;
private String path;
private String operation;
private String parameters;
private String action;
private int caseid;
private int stepnum;
private String expectedresult;
private int projectid;
private int steptype;
private String time;
private String operationer;
private String remark;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public String getOperation() {
return operation;
}
public void setOperation(String operation) {
this.operation = operation;
}
public String getParameters() {
return parameters;
}
public void setParameters(String parameters) {
this.parameters = parameters;
}
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public int getCaseid() {
return caseid;
}
public void setCaseid(int caseid) {
this.caseid = caseid;
}
public int getStepnum() {
return stepnum;
}
public void setStepnum(int stepnum) {
this.stepnum = stepnum;
}
public String getExpectedresult() {
return expectedresult;
}
public void setExpectedresult(String expectedresult) {
this.expectedresult = expectedresult;
}
public int getProjectid() {
return projectid;
}
public void setProjectid(int projectid) {
this.projectid = projectid;
}
public int getSteptype() {
return steptype;
}
public void setSteptype(int steptype) {
this.steptype = steptype;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getOperationer() {
return operationer;
}
public void setOperationer(String operationer) {
this.operationer = operationer;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}
package luckyweb.seagull.spring.entity;
import javax.persistence.Entity;
@Entity(name="projectCasesteps")
public class ProjectCasesteps implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private int id;
private String path;
private String operation;
private String parameters;
private String action;
private int caseid;
private int stepnum;
private String expectedresult;
private int projectid;
private int steptype;
private String time;
private String operationer;
private String remark;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public String getOperation() {
return operation;
}
public void setOperation(String operation) {
this.operation = operation;
}
public String getParameters() {
return parameters;
}
public void setParameters(String parameters) {
this.parameters = parameters;
}
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public int getCaseid() {
return caseid;
}
public void setCaseid(int caseid) {
this.caseid = caseid;
}
public int getStepnum() {
return stepnum;
}
public void setStepnum(int stepnum) {
this.stepnum = stepnum;
}
public String getExpectedresult() {
return expectedresult;
}
public void setExpectedresult(String expectedresult) {
this.expectedresult = expectedresult;
}
public int getProjectid() {
return projectid;
}
public void setProjectid(int projectid) {
this.projectid = projectid;
}
public int getSteptype() {
return steptype;
}
public void setSteptype(int steptype) {
this.steptype = steptype;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getOperationer() {
return operationer;
}
public void setOperationer(String operationer) {
this.operationer = operationer;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}

View File

@ -1,48 +1,48 @@
package luckyweb.seagull.spring.entity;
import javax.persistence.Entity;
@Entity(name="projectModule")
public class ProjectModule implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private int id;
private int projectid;
private int mprojectid;
private String modulename;
private int pid;
public int getMprojectid() {
return mprojectid;
}
public void setMprojectid(int mprojectid) {
this.mprojectid = mprojectid;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getProjectid() {
return projectid;
}
public void setProjectid(int projectid) {
this.projectid = projectid;
}
public String getModulename() {
return modulename;
}
public void setModulename(String modulename) {
this.modulename = modulename;
}
public int getPid() {
return pid;
}
public void setPid(int pid) {
this.pid = pid;
}
}
package luckyweb.seagull.spring.entity;
import javax.persistence.Entity;
@Entity(name="projectModule")
public class ProjectModule implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private int id;
private int projectid;
private int mprojectid;
private String modulename;
private int pid;
public int getMprojectid() {
return mprojectid;
}
public void setMprojectid(int mprojectid) {
this.mprojectid = mprojectid;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getProjectid() {
return projectid;
}
public void setProjectid(int projectid) {
this.projectid = projectid;
}
public String getModulename() {
return modulename;
}
public void setModulename(String modulename) {
this.modulename = modulename;
}
public int getPid() {
return pid;
}
public void setPid(int pid) {
this.pid = pid;
}
}

View File

@ -1,33 +1,33 @@
package luckyweb.seagull.spring.entity;
import javax.persistence.Entity;
@Entity(name="projectModuleJson")
public class ProjectModuleJson implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private int id;
private String name;
private boolean isParent;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public boolean isParent() {
return isParent;
}
public void setisParent(boolean isParent) {
this.isParent = isParent;
}
}
package luckyweb.seagull.spring.entity;
import javax.persistence.Entity;
@Entity(name="projectModuleJson")
public class ProjectModuleJson implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private int id;
private String name;
private boolean isParent;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public boolean isParent() {
return isParent;
}
public void setisParent(boolean isParent) {
this.isParent = isParent;
}
}

View File

@ -1,69 +1,69 @@
package luckyweb.seagull.spring.entity;
import javax.persistence.Entity;
@Entity(name="projectPlan")
public class ProjectPlan implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private int id;
private int projectid;
private String name;
private int casecount;
private String remark;
private String time;
private String operationer;
private String projectname;
public String getProjectname() {
return projectname;
}
public void setProjectname(String projectname) {
this.projectname = projectname;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getProjectid() {
return projectid;
}
public void setProjectid(int projectid) {
this.projectid = projectid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getCasecount() {
return casecount;
}
public void setCasecount(int casecount) {
this.casecount = casecount;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getOperationer() {
return operationer;
}
public void setOperationer(String operationer) {
this.operationer = operationer;
}
}
package luckyweb.seagull.spring.entity;
import javax.persistence.Entity;
@Entity(name="projectPlan")
public class ProjectPlan implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private int id;
private int projectid;
private String name;
private int casecount;
private String remark;
private String time;
private String operationer;
private String projectname;
public String getProjectname() {
return projectname;
}
public void setProjectname(String projectname) {
this.projectname = projectname;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getProjectid() {
return projectid;
}
public void setProjectid(int projectid) {
this.projectid = projectid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getCasecount() {
return casecount;
}
public void setCasecount(int casecount) {
this.casecount = casecount;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getOperationer() {
return operationer;
}
public void setOperationer(String operationer) {
this.operationer = operationer;
}
}

View File

@ -1,42 +1,42 @@
package luckyweb.seagull.spring.entity;
import javax.persistence.Entity;
@Entity(name="projectPlanCase")
public class ProjectPlanCase implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private int id;
private int caseid;
private int planid;
private int priority;
public int getPriority() {
return priority;
}
public void setPriority(int priority) {
this.priority = priority;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getCaseid() {
return caseid;
}
public void setCaseid(int caseid) {
this.caseid = caseid;
}
public int getPlanid() {
return planid;
}
public void setPlanid(int planid) {
this.planid = planid;
}
}
package luckyweb.seagull.spring.entity;
import javax.persistence.Entity;
@Entity(name="projectPlanCase")
public class ProjectPlanCase implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private int id;
private int caseid;
private int planid;
private int priority;
public int getPriority() {
return priority;
}
public void setPriority(int priority) {
this.priority = priority;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getCaseid() {
return caseid;
}
public void setCaseid(int caseid) {
this.caseid = caseid;
}
public int getPlanid() {
return planid;
}
public void setPlanid(int planid) {
this.planid = planid;
}
}

View File

@ -1,85 +1,85 @@
package luckyweb.seagull.spring.entity;
import javax.persistence.Entity;
@Entity(name="projectProtocolTemplate")
public class ProjectProtocolTemplate implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private int id;
private int projectid;
private String name;
private String protocoltype;
private String contentencoding;
private int connecttimeout;
private String time;
private String operationer;
private String remark;
private String projectname;
public String getProjectname() {
return projectname;
}
public void setProjectname(String projectname) {
this.projectname = projectname;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getProjectid() {
return projectid;
}
public void setProjectid(int projectid) {
this.projectid = projectid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getProtocoltype() {
return protocoltype;
}
public void setProtocoltype(String protocoltype) {
this.protocoltype = protocoltype;
}
public String getContentencoding() {
return contentencoding;
}
public void setContentencoding(String contentencoding) {
this.contentencoding = contentencoding;
}
public int getConnecttimeout() {
return connecttimeout;
}
public void setConnecttimeout(int connecttimeout) {
this.connecttimeout = connecttimeout;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getOperationer() {
return operationer;
}
public void setOperationer(String operationer) {
this.operationer = operationer;
}
}
package luckyweb.seagull.spring.entity;
import javax.persistence.Entity;
@Entity(name="projectProtocolTemplate")
public class ProjectProtocolTemplate implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private int id;
private int projectid;
private String name;
private String protocoltype;
private String contentencoding;
private int connecttimeout;
private String time;
private String operationer;
private String remark;
private String projectname;
public String getProjectname() {
return projectname;
}
public void setProjectname(String projectname) {
this.projectname = projectname;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getProjectid() {
return projectid;
}
public void setProjectid(int projectid) {
this.projectid = projectid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getProtocoltype() {
return protocoltype;
}
public void setProtocoltype(String protocoltype) {
this.protocoltype = protocoltype;
}
public String getContentencoding() {
return contentencoding;
}
public void setContentencoding(String contentencoding) {
this.contentencoding = contentencoding;
}
public int getConnecttimeout() {
return connecttimeout;
}
public void setConnecttimeout(int connecttimeout) {
this.connecttimeout = connecttimeout;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getOperationer() {
return operationer;
}
public void setOperationer(String operationer) {
this.operationer = operationer;
}
}

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