Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
wangming
/
kzy-oss
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d8d793ad
authored
Mar 13, 2020
by
wangming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
banner
1 parent
54cb8f5d
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
408 additions
and
166 deletions
src/main/java/com/server/web/common/model/TKzyRelationClass.java
src/main/java/com/server/web/common/model/TKzyRelationClassExample.java
src/main/java/com/server/web/common/service/CourseService.java
src/main/java/com/server/web/common/service/Impl/CourseServiceImpl.java
src/main/java/com/server/web/controller/CourseController.java
src/main/resources/generatorConfig.xml
src/main/resources/mybatis/mapper/TKzyRelationClassMapper.xml
src/main/resources/mybatis/mapping/queryModel.xml
src/main/java/com/server/web/common/model/TKzyRelationClass.java
View file @
d8d793a
...
...
@@ -13,12 +13,15 @@ public class TKzyRelationClass extends BaseModel {
private
Date
createDt
;
public
TKzyRelationClass
(
Long
id
,
Long
relationId
,
Long
firstClassId
,
Long
secondClassId
,
Date
createDt
)
{
private
Integer
type
;
public
TKzyRelationClass
(
Long
id
,
Long
relationId
,
Long
firstClassId
,
Long
secondClassId
,
Date
createDt
,
Integer
type
)
{
this
.
id
=
id
;
this
.
relationId
=
relationId
;
this
.
firstClassId
=
firstClassId
;
this
.
secondClassId
=
secondClassId
;
this
.
createDt
=
createDt
;
this
.
type
=
type
;
}
public
TKzyRelationClass
()
{
...
...
@@ -64,4 +67,12 @@ public class TKzyRelationClass extends BaseModel {
public
void
setCreateDt
(
Date
createDt
)
{
this
.
createDt
=
createDt
;
}
public
Integer
getType
()
{
return
type
;
}
public
void
setType
(
Integer
type
)
{
this
.
type
=
type
;
}
}
\ No newline at end of file
src/main/java/com/server/web/common/model/TKzyRelationClassExample.java
View file @
d8d793a
...
...
@@ -404,6 +404,66 @@ public class TKzyRelationClassExample {
addCriterion
(
"create_dt not between"
,
value1
,
value2
,
"createDt"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeIsNull
()
{
addCriterion
(
"type is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeIsNotNull
()
{
addCriterion
(
"type is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeEqualTo
(
Integer
value
)
{
addCriterion
(
"type ="
,
value
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeNotEqualTo
(
Integer
value
)
{
addCriterion
(
"type <>"
,
value
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeGreaterThan
(
Integer
value
)
{
addCriterion
(
"type >"
,
value
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeGreaterThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"type >="
,
value
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeLessThan
(
Integer
value
)
{
addCriterion
(
"type <"
,
value
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeLessThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"type <="
,
value
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"type in"
,
values
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeNotIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"type not in"
,
values
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"type between"
,
value1
,
value2
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeNotBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"type not between"
,
value1
,
value2
,
"type"
);
return
(
Criteria
)
this
;
}
}
public
static
class
Criteria
extends
GeneratedCriteria
{
...
...
src/main/java/com/server/web/common/service/CourseService.java
0 → 100644
View file @
d8d793a
package
com
.
server
.
web
.
common
.
service
;
import
com.server.web.common.model.TKzyCourse
;
import
org.springframework.transaction.annotation.Transactional
;
/**
* Created by yinbin on 2018/1/15.
*/
public
interface
CourseService
{
@Transactional
void
insertCourse
(
TKzyCourse
course
,
String
classIds
);
@Transactional
void
updateCourse
(
TKzyCourse
course
,
String
classIds
);
}
src/main/java/com/server/web/common/service/Impl/CourseServiceImpl.java
0 → 100644
View file @
d8d793a
package
com
.
server
.
web
.
common
.
service
.
Impl
;
import
com.server.web.common.mapper.TBaseSecondClassMapper
;
import
com.server.web.common.mapper.TKzyCourseMapper
;
import
com.server.web.common.mapper.TKzyRelationClassMapper
;
import
com.server.web.common.model.TBaseSecondClass
;
import
com.server.web.common.model.TKzyCourse
;
import
com.server.web.common.model.TKzyRelationClass
;
import
com.server.web.common.model.TKzyRelationClassExample
;
import
com.server.web.common.service.CourseService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
@Service
public
class
CourseServiceImpl
implements
CourseService
{
@Autowired
private
TKzyCourseMapper
courseMapper
;
@Autowired
private
TKzyRelationClassMapper
relationClassMapper
;
@Autowired
private
TBaseSecondClassMapper
secondClassMapper
;
@Override
public
void
insertCourse
(
TKzyCourse
course
,
String
classIds
)
{
courseMapper
.
insertSelective
(
course
);
if
(!(
""
).
equals
(
classIds
)){
String
[]
id
=
classIds
.
split
(
","
);
TKzyRelationClass
relationClass
=
null
;
for
(
int
i
=
0
;
i
<
id
.
length
;
i
++){
TBaseSecondClass
secondClass
=
secondClassMapper
.
selectByPrimaryKey
(
Long
.
valueOf
(
id
[
i
]));
relationClass
=
new
TKzyRelationClass
();
relationClass
.
setRelationId
(
course
.
getId
());
relationClass
.
setFirstClassId
(
secondClass
.
getFirstId
());
relationClass
.
setSecondClassId
(
secondClass
.
getId
());
relationClass
.
setCreateDt
(
new
Date
());
relationClass
.
setType
(
1
);
relationClassMapper
.
insertSelective
(
relationClass
);
}
}
}
@Override
public
void
updateCourse
(
TKzyCourse
course
,
String
classIds
)
{
courseMapper
.
updateByPrimaryKeySelective
(
course
);
TKzyRelationClassExample
example
=
new
TKzyRelationClassExample
();
example
.
createCriteria
().
andRelationIdEqualTo
(
course
.
getId
()).
andTypeEqualTo
(
1
);
relationClassMapper
.
deleteByExample
(
example
);
if
(!(
""
).
equals
(
classIds
)){
String
[]
id
=
classIds
.
split
(
","
);
TKzyRelationClass
relationClass
=
null
;
for
(
int
i
=
0
;
i
<
id
.
length
;
i
++){
TBaseSecondClass
secondClass
=
secondClassMapper
.
selectByPrimaryKey
(
Long
.
valueOf
(
id
[
i
]));
relationClass
=
new
TKzyRelationClass
();
relationClass
.
setRelationId
(
course
.
getId
());
relationClass
.
setFirstClassId
(
secondClass
.
getFirstId
());
relationClass
.
setSecondClassId
(
secondClass
.
getId
());
relationClass
.
setCreateDt
(
new
Date
());
relationClass
.
setType
(
1
);
relationClassMapper
.
insertSelective
(
relationClass
);
}
}
}
}
src/main/java/com/server/web/controller/CourseController.java
View file @
d8d793a
...
...
@@ -4,9 +4,12 @@ import com.github.pagehelper.PageHelper;
import
com.github.pagehelper.PageInfo
;
import
com.server.shiro.persistent.bean.SysUser
;
import
com.server.utils.DateUtils
;
import
com.server.web.common.mapper.TBaseSecondClassMapper
;
import
com.server.web.common.mapper.TKzyCourseMapper
;
import
com.server.web.common.model.PageModel
;
import
com.server.web.common.model.TBaseSecondClass
;
import
com.server.web.common.model.TKzyCourse
;
import
com.server.web.common.service.CourseService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -25,6 +28,11 @@ public class CourseController extends BaseController {
@Autowired
private
TKzyCourseMapper
courseMapper
;
@Autowired
private
CourseService
courseService
;
@Autowired
private
TBaseSecondClassMapper
secondClassMapper
;
/**
* 直播列表
...
...
@@ -141,148 +149,162 @@ public class CourseController extends BaseController {
// /**
// * 添加修改直播课
// * @param id
// * @param courseName
// * @param dateRange
// * @param picUrl
// * @param courseIntroduce
// * @param liveUrl
// * @return
// */
// @ResponseBody
// @RequestMapping(path = "/saveZbCourse", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// public Map saveZbCourse(@RequestParam(defaultValue = "-1") long id,@RequestParam String courseName,@RequestParam String dateRange,
// @RequestParam String picUrl,@RequestParam String courseIntroduce,@RequestParam String liveUrl,@RequestParam(defaultValue = "") String classIds,
// @RequestParam String startDt,@RequestParam String endDt) {
// try {
// SysUser user =getSysUser();
// TKzyCourse course = new TKzyCourse();
// course.setCourseName(courseName);
// course.setPicUrl(picUrl);
// course.setCourseIntroduce(courseIntroduce);
// course.setLiveUrl(liveUrl);
// course.setEditorId(user.getId());
// course.setEditorName(user.getRealname());
// Date start = DateUtils.parse("yyyy-MM-dd HH:mm:ss",startDt);
// Date end = DateUtils.parse("yyyy-MM-dd HH:mm:ss", endDt);
// course.setStartDt(start);
// course.setEndDt(end);
// if(id != -1){ //修改
// course.setId(id);
// course.setUpdateDt(new Date());
// courseService.updateCourse(course,classIds);
// }else{ //添加
// course.setCreateDt(new Date());
// course.setIsDelete(0);
// course.setIsUp(1);
// course.setCourseType(1);
// courseService.insertCourse(course,classIds);
// }
// return success("操作成功");
// } catch (Exception e) {
// e.printStackTrace();
// return error("0","系统异常",null);
// }
// }
/**
* 添加修改直播课
* @param id
* @param courseName
* @param picUrl
* @param courseIntroduce
* @param liveUrl
* @return
*/
@ResponseBody
@RequestMapping
(
path
=
"/saveZbCourse"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
},
produces
=
"application/json"
)
public
Map
saveZbCourse
(
@RequestParam
(
defaultValue
=
"-1"
)
long
id
,
@RequestParam
String
courseName
,
@RequestParam
String
picUrl
,
@RequestParam
String
courseIntroduce
,
@RequestParam
String
liveUrl
,
@RequestParam
(
defaultValue
=
""
)
String
classIds
,
@RequestParam
String
startDt
,
@RequestParam
String
endDt
)
{
try
{
String
[]
ids
=
classIds
.
split
(
","
);
boolean
flag
=
true
;
for
(
int
i
=
0
;
i
<
ids
.
length
;
i
++){
TBaseSecondClass
secondClass
=
secondClassMapper
.
selectByPrimaryKey
(
Long
.
valueOf
(
ids
[
i
]));
if
(
secondClass
.
getType
()!=
3
){
flag
=
false
;
break
;
}
}
if
(!
flag
){
return
error
(
"0"
,
"分类类型不匹配"
,
"分类类型不匹配"
);
}
SysUser
user
=
getSysUser
();
TKzyCourse
course
=
new
TKzyCourse
();
course
.
setCourseName
(
courseName
);
course
.
setPicUrl
(
picUrl
);
course
.
setCourseIntroduce
(
courseIntroduce
);
course
.
setLiveUrl
(
liveUrl
);
course
.
setEditorId
(
user
.
getId
());
course
.
setEditorName
(
user
.
getRealname
());
Date
start
=
DateUtils
.
parse
(
"yyyy-MM-dd HH:mm:ss"
,
startDt
);
Date
end
=
DateUtils
.
parse
(
"yyyy-MM-dd HH:mm:ss"
,
endDt
);
course
.
setStartDt
(
start
);
course
.
setEndDt
(
end
);
if
(
id
!=
-
1
){
//修改
course
.
setId
(
id
);
course
.
setUpdateDt
(
new
Date
());
courseService
.
updateCourse
(
course
,
classIds
);
}
else
{
//添加
course
.
setCreateDt
(
new
Date
());
course
.
setIsDelete
(
0
);
course
.
setIsUp
(
1
);
course
.
setCourseType
(
1
);
courseService
.
insertCourse
(
course
,
classIds
);
}
return
success
(
"操作成功"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
error
(
"0"
,
"系统异常"
,
null
);
}
}
/**
* 添加修改录播课
* @param id
* @param courseName
* @param picUrl
* @param courseIntroduce
* @param liveUrl
* @return
*/
@ResponseBody
@RequestMapping
(
path
=
"/saveLbCourse"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
},
produces
=
"application/json"
)
public
Map
saveLbCourse
(
@RequestParam
(
defaultValue
=
"-1"
)
long
id
,
@RequestParam
String
courseName
,
@RequestParam
String
picUrl
,
@RequestParam
String
courseIntroduce
,
@RequestParam
(
defaultValue
=
""
)
String
liveUrl
,
@RequestParam
(
defaultValue
=
""
)
String
classIds
)
{
try
{
String
[]
ids
=
classIds
.
split
(
","
);
boolean
flag
=
true
;
for
(
int
i
=
0
;
i
<
ids
.
length
;
i
++){
TBaseSecondClass
secondClass
=
secondClassMapper
.
selectByPrimaryKey
(
Long
.
valueOf
(
ids
[
i
]));
if
(
secondClass
.
getType
()!=
2
){
flag
=
false
;
break
;
}
}
if
(!
flag
){
return
error
(
"0"
,
"分类类型不匹配"
,
"分类类型不匹配"
);
}
SysUser
user
=
getSysUser
();
TKzyCourse
course
=
new
TKzyCourse
();
course
.
setCourseName
(
courseName
);
course
.
setPicUrl
(
picUrl
);
course
.
setCourseIntroduce
(
courseIntroduce
);
if
(!(
""
).
equals
(
liveUrl
))
{
course
.
setLiveUrl
(
liveUrl
);
}
course
.
setEditorId
(
user
.
getId
());
course
.
setEditorName
(
user
.
getRealname
());
if
(
id
!=
-
1
){
//修改
course
.
setId
(
id
);
course
.
setUpdateDt
(
new
Date
());
courseService
.
updateCourse
(
course
,
classIds
);
}
else
{
//添加
course
.
setCreateDt
(
new
Date
());
course
.
setIsDelete
(
0
);
course
.
setIsUp
(
2
);
course
.
setCourseType
(
2
);
courseService
.
insertCourse
(
course
,
classIds
);
}
return
success
(
"操作成功"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
error
(
"0"
,
"系统异常"
,
null
);
}
}
//
// @Autowired
// CourseService courseService;
//
//
//
/**
* 直播详情
* @param id
* @return
*/
@ResponseBody
@RequestMapping
(
path
=
"/zbCourseInfo"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
},
produces
=
"application/json"
)
public
Map
zbCourseInfo
(
@RequestParam
long
id
)
{
try
{
Map
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"id"
,
id
);
Map
map
=
(
Map
)
openSqlRingsService
.
selectOne_Rings
(
"com.mapping.queryModel.queryCourseZbInfo"
,
paramMap
);
List
classList
=
openSqlRingsService
.
selectList_Rings
(
"com.mapping.queryModel.queryCourseClass"
,
paramMap
);
map
.
put
(
"classList"
,
classList
);
return
success
(
map
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
error
(
"0"
,
"系统异常"
,
null
);
}
}
//
//
// /**
// * 添加修改录播课
// * @param id
// * @param courseName
// * @param picUrl
// * @param courseIntroduce
// * @param liveUrl
// * @return
// */
// @ResponseBody
// @RequestMapping(path = "/saveLbCourse", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// public Map saveLbCourse(@RequestParam(defaultValue = "-1") long id,@RequestParam String courseName,
// @RequestParam String picUrl,@RequestParam String courseIntroduce,@RequestParam(defaultValue = "") String liveUrl,@RequestParam(defaultValue = "") String classIds) {
// try {
// SysUser user =getSysUser();
// TSjCourse course = new TSjCourse();
// course.setCourseName(courseName);
// course.setPicUrl(picUrl);
// course.setCourseIntroduce(courseIntroduce);
// if(!("").equals(liveUrl)) {
// course.setLiveUrl(liveUrl);
// }
// course.setEditorId(user.getId());
// course.setEditorName(user.getRealname());
// if(id != -1){ //修改
// course.setId(id);
// course.setUpdateDt(new Date());
// courseService.updateCourse(course,classIds);
// }else{ //添加
// course.setCreateDt(new Date());
// course.setIsDelete(0);
// course.setIsUp(2);
// course.setCourseType(2);
// courseService.insertCourse(course,classIds);
// }
// return success("操作成功");
// } catch (Exception e) {
// e.printStackTrace();
// return error("0","系统异常",null);
// }
// }
//
// /**
// * 直播详情
// * @param id
// * @return
// */
// @ResponseBody
// @RequestMapping(path = "/zbCourseInfo", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// public Map zbCourseInfo(@RequestParam long id) {
// try {
// Map paramMap = new HashMap<>();
// paramMap.put("id",id);
// Map map = (Map)openSqlRingsService.selectOne_Rings("com.mapping.queryModel.queryCourseZbInfo",paramMap);
// List classList = openSqlRingsService.selectList_Rings("com.mapping.queryModel.queryCourseClass",paramMap);
// map.put("classList",classList);
// return success(map);
// } catch (Exception e) {
// e.printStackTrace();
// return error("0","系统异常",null);
// }
// }
//
// /**
// * 录播详情
// * @param id
// * @return
// */
// @ResponseBody
// @RequestMapping(path = "/lbCourseInfo", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// public Map lbCourseInfo(@RequestParam long id) {
// try {
// Map paramMap = new HashMap<>();
// paramMap.put("id",id);
// Map map = (Map)openSqlRingsService.selectOne_Rings("com.mapping.queryModel.queryCourseLbInfo",paramMap);
// List classList = openSqlRingsService.selectList_Rings("com.mapping.queryModel.queryCourseClass",paramMap);
// map.put("classList",classList);
// return success(map);
// } catch (Exception e) {
// e.printStackTrace();
// return error("0","系统异常",null);
// }
// }
/**
* 录播详情
* @param id
* @return
*/
@ResponseBody
@RequestMapping
(
path
=
"/lbCourseInfo"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
},
produces
=
"application/json"
)
public
Map
lbCourseInfo
(
@RequestParam
long
id
)
{
try
{
Map
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"id"
,
id
);
Map
map
=
(
Map
)
openSqlRingsService
.
selectOne_Rings
(
"com.mapping.queryModel.queryCourseLbInfo"
,
paramMap
);
List
classList
=
openSqlRingsService
.
selectList_Rings
(
"com.mapping.queryModel.queryCourseClass"
,
paramMap
);
map
.
put
(
"classList"
,
classList
);
return
success
(
map
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
error
(
"0"
,
"系统异常"
,
null
);
}
}
}
src/main/resources/generatorConfig.xml
View file @
d8d793a
...
...
@@ -68,33 +68,33 @@
<javaClientGenerator
targetPackage=
"com.server.web.common.mapper"
targetProject=
"src/main/java"
type=
"XMLMAPPER"
>
<property
name=
"exampleMethodVisibility"
value=
"public"
/>
</javaClientGenerator>
<
table
tableName=
"t_base_banner"
schema=
"kzy_db_test"
>
<
generatedKey
column=
"ID"
sqlStatement=
"JDBC"
identity=
"true"
/
>
<
/table
>
<
table
tableName=
"t_base_first_class"
schema=
"kzy_db_test"
>
<
generatedKey
column=
"ID"
sqlStatement=
"JDBC"
identity=
"true"
/
>
<
/table
>
<
table
tableName=
"t_base_second_class"
schema=
"kzy_db_test"
>
<
generatedKey
column=
"ID"
sqlStatement=
"JDBC"
identity=
"true"
/
>
<
/table
>
<
table
tableName=
"t_kzy_comment"
schema=
"kzy_db_test"
>
<
generatedKey
column=
"ID"
sqlStatement=
"JDBC"
identity=
"true"
/
>
<
/table
>
<
table
tableName=
"t_kzy_course"
schema=
"kzy_db_test"
>
<
generatedKey
column=
"ID"
sqlStatement=
"JDBC"
identity=
"true"
/
>
<
/table
>
<
table
tableName=
"t_kzy_information"
schema=
"kzy_db_test"
>
<
generatedKey
column=
"ID"
sqlStatement=
"JDBC"
identity=
"true"
/
>
<
/table
>
<
!--<table tableName="t_base_banner" schema="kzy_db_test">--
>
<
!--<generatedKey column="ID" sqlStatement="JDBC" identity="true"/>--
>
<
!--</table>--
>
<
!--<table tableName="t_base_first_class" schema="kzy_db_test">--
>
<
!--<generatedKey column="ID" sqlStatement="JDBC" identity="true"/>--
>
<
!--</table>--
>
<
!--<table tableName="t_base_second_class" schema="kzy_db_test">--
>
<
!--<generatedKey column="ID" sqlStatement="JDBC" identity="true"/>--
>
<
!--</table>--
>
<
!--<table tableName="t_kzy_comment" schema="kzy_db_test">--
>
<
!--<generatedKey column="ID" sqlStatement="JDBC" identity="true"/>--
>
<
!--</table>--
>
<
!--<table tableName="t_kzy_course" schema="kzy_db_test">--
>
<
!--<generatedKey column="ID" sqlStatement="JDBC" identity="true"/>--
>
<
!--</table>--
>
<
!--<table tableName="t_kzy_information" schema="kzy_db_test">--
>
<
!--<generatedKey column="ID" sqlStatement="JDBC" identity="true"/>--
>
<
!--</table>--
>
<table
tableName=
"t_kzy_relation_class"
schema=
"kzy_db_test"
>
<generatedKey
column=
"ID"
sqlStatement=
"JDBC"
identity=
"true"
/>
</table>
<
table
tableName=
"t_kzy_user"
schema=
"kzy_db_test"
>
<
generatedKey
column=
"ID"
sqlStatement=
"JDBC"
identity=
"true"
/
>
<
/table
>
<
table
tableName=
"t_kzy_user_integral_flowing"
schema=
"kzy_db_test"
>
<
generatedKey
column=
"ID"
sqlStatement=
"JDBC"
identity=
"true"
/
>
</table
>
<
!--<table tableName="t_kzy_user" schema="kzy_db_test">--
>
<
!--<generatedKey column="ID" sqlStatement="JDBC" identity="true"/>--
>
<
!--</table>--
>
<
!--<table tableName="t_kzy_user_integral_flowing" schema="kzy_db_test">--
>
<
!--<generatedKey column="ID" sqlStatement="JDBC" identity="true"/>--
>
<!--</table>--
>
</context>
</generatorConfiguration>
\ No newline at end of file
src/main/resources/mybatis/mapper/TKzyRelationClassMapper.xml
View file @
d8d793a
...
...
@@ -8,6 +8,7 @@
<arg
column=
"first_class_id"
javaType=
"java.lang.Long"
jdbcType=
"BIGINT"
/>
<arg
column=
"second_class_id"
javaType=
"java.lang.Long"
jdbcType=
"BIGINT"
/>
<arg
column=
"create_dt"
javaType=
"java.util.Date"
jdbcType=
"TIMESTAMP"
/>
<arg
column=
"type"
javaType=
"java.lang.Integer"
jdbcType=
"INTEGER"
/>
</constructor>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
...
...
@@ -69,7 +70,7 @@
</where>
</sql>
<sql
id=
"Base_Column_List"
>
id, relation_id, first_class_id, second_class_id, create_dt
id, relation_id, first_class_id, second_class_id, create_dt
, type
</sql>
<select
id=
"selectByExample"
parameterType=
"com.server.web.common.model.TKzyRelationClassExample"
resultMap=
"BaseResultMap"
>
select
...
...
@@ -103,9 +104,9 @@
</delete>
<insert
id=
"insert"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.server.web.common.model.TKzyRelationClass"
useGeneratedKeys=
"true"
>
insert into t_kzy_relation_class (relation_id, first_class_id, second_class_id,
create_dt)
create_dt
, type
)
values (#{relationId,jdbcType=BIGINT}, #{firstClassId,jdbcType=BIGINT}, #{secondClassId,jdbcType=BIGINT},
#{createDt,jdbcType=TIMESTAMP})
#{createDt,jdbcType=TIMESTAMP}
, #{type,jdbcType=INTEGER}
)
</insert>
<insert
id=
"insertSelective"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.server.web.common.model.TKzyRelationClass"
useGeneratedKeys=
"true"
>
insert into t_kzy_relation_class
...
...
@@ -122,6 +123,9 @@
<if
test=
"createDt != null"
>
create_dt,
</if>
<if
test=
"type != null"
>
type,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"relationId != null"
>
...
...
@@ -136,6 +140,9 @@
<if
test=
"createDt != null"
>
#{createDt,jdbcType=TIMESTAMP},
</if>
<if
test=
"type != null"
>
#{type,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"com.server.web.common.model.TKzyRelationClassExample"
resultType=
"java.lang.Long"
>
...
...
@@ -162,6 +169,9 @@
<if
test=
"record.createDt != null"
>
create_dt = #{record.createDt,jdbcType=TIMESTAMP},
</if>
<if
test=
"record.type != null"
>
type = #{record.type,jdbcType=INTEGER},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
...
...
@@ -173,7 +183,8 @@
relation_id = #{record.relationId,jdbcType=BIGINT},
first_class_id = #{record.firstClassId,jdbcType=BIGINT},
second_class_id = #{record.secondClassId,jdbcType=BIGINT},
create_dt = #{record.createDt,jdbcType=TIMESTAMP}
create_dt = #{record.createDt,jdbcType=TIMESTAMP},
type = #{record.type,jdbcType=INTEGER}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
...
...
@@ -193,6 +204,9 @@
<if
test=
"createDt != null"
>
create_dt = #{createDt,jdbcType=TIMESTAMP},
</if>
<if
test=
"type != null"
>
type = #{type,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
...
...
@@ -201,7 +215,8 @@
set relation_id = #{relationId,jdbcType=BIGINT},
first_class_id = #{firstClassId,jdbcType=BIGINT},
second_class_id = #{secondClassId,jdbcType=BIGINT},
create_dt = #{createDt,jdbcType=TIMESTAMP}
create_dt = #{createDt,jdbcType=TIMESTAMP},
type = #{type,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/queryModel.xml
View file @
d8d793a
...
...
@@ -160,4 +160,48 @@
</select>
<select
id=
"queryCourseZbInfo"
resultType=
"java.util.HashMap"
parameterType=
"java.util.HashMap"
>
SELECT
c.id,
c.course_name AS courseName,
c.pic_url AS picUrl,
c.live_url AS liveUrl,
c.course_introduce AS courseIntroduce,
date_format(c.start_dt,'%Y-%m-%d %H:%i:%S') startDt,
date_format(c.end_dt,'%Y-%m-%d %H:%i:%S') endDt
FROM
t_kzy_course c
WHERE c.course_type = 1
AND c.id = #{id,jdbcType=BIGINT}
</select>
<select
id=
"queryCourseClass"
resultType=
"java.util.HashMap"
parameterType=
"java.util.HashMap"
>
SELECT
t.first_class_id as firstClassId,
t1.class_name as firstName,
t.second_class_id as secondClassId,
t2.class_name as secondName
FROM
t_kzy_relation_class t
LEFT JOIN t_base_first_class t1 ON t1.id= t.first_class_id
LEFT JOIN t_base_second_class t2 ON t2.id = t.second_class_id
where t.type =1
AND t.relation_id = #{id,jdbcType=BIGINT}
ORDER BY t.create_dt ASC
</select>
<select
id=
"queryCourseLbInfo"
resultType=
"java.util.HashMap"
parameterType=
"java.util.HashMap"
>
SELECT
c.id,
c.course_name AS courseName,
c.pic_url AS picUrl,
c.live_url AS liveUrl,
c.course_introduce AS courseIntroduce
FROM
t_kzy_course c
WHERE c.course_type = 2
AND c.id = #{id,jdbcType=BIGINT}
</select>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment