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
Show 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 {
...
@@ -13,12 +13,15 @@ public class TKzyRelationClass extends BaseModel {
private
Date
createDt
;
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
.
id
=
id
;
this
.
relationId
=
relationId
;
this
.
relationId
=
relationId
;
this
.
firstClassId
=
firstClassId
;
this
.
firstClassId
=
firstClassId
;
this
.
secondClassId
=
secondClassId
;
this
.
secondClassId
=
secondClassId
;
this
.
createDt
=
createDt
;
this
.
createDt
=
createDt
;
this
.
type
=
type
;
}
}
public
TKzyRelationClass
()
{
public
TKzyRelationClass
()
{
...
@@ -64,4 +67,12 @@ public class TKzyRelationClass extends BaseModel {
...
@@ -64,4 +67,12 @@ public class TKzyRelationClass extends BaseModel {
public
void
setCreateDt
(
Date
createDt
)
{
public
void
setCreateDt
(
Date
createDt
)
{
this
.
createDt
=
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 {
...
@@ -404,6 +404,66 @@ public class TKzyRelationClassExample {
addCriterion
(
"create_dt not between"
,
value1
,
value2
,
"createDt"
);
addCriterion
(
"create_dt not between"
,
value1
,
value2
,
"createDt"
);
return
(
Criteria
)
this
;
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
{
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;
...
@@ -4,9 +4,12 @@ import com.github.pagehelper.PageHelper;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.server.shiro.persistent.bean.SysUser
;
import
com.server.shiro.persistent.bean.SysUser
;
import
com.server.utils.DateUtils
;
import
com.server.utils.DateUtils
;
import
com.server.web.common.mapper.TBaseSecondClassMapper
;
import
com.server.web.common.mapper.TKzyCourseMapper
;
import
com.server.web.common.mapper.TKzyCourseMapper
;
import
com.server.web.common.model.PageModel
;
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.model.TKzyCourse
;
import
com.server.web.common.service.CourseService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -25,6 +28,11 @@ public class CourseController extends BaseController {
...
@@ -25,6 +28,11 @@ public class CourseController extends BaseController {
@Autowired
@Autowired
private
TKzyCourseMapper
courseMapper
;
private
TKzyCourseMapper
courseMapper
;
@Autowired
private
CourseService
courseService
;
@Autowired
private
TBaseSecondClassMapper
secondClassMapper
;
/**
/**
* 直播列表
* 直播列表
...
@@ -141,148 +149,162 @@ public class CourseController extends BaseController {
...
@@ -141,148 +149,162 @@ public class CourseController extends BaseController {
// /**
/**
// * 添加修改直播课
* 添加修改直播课
// * @param id
* @param id
// * @param courseName
* @param courseName
// * @param dateRange
* @param picUrl
// * @param picUrl
* @param courseIntroduce
// * @param courseIntroduce
* @param liveUrl
// * @param liveUrl
* @return
// * @return
*/
// */
@ResponseBody
// @ResponseBody
@RequestMapping
(
path
=
"/saveZbCourse"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
},
produces
=
"application/json"
)
// @RequestMapping(path = "/saveZbCourse", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
public
Map
saveZbCourse
(
@RequestParam
(
defaultValue
=
"-1"
)
long
id
,
@RequestParam
String
courseName
,
// 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 picUrl,@RequestParam String courseIntroduce,@RequestParam String liveUrl,@RequestParam(defaultValue = "") String classIds,
@RequestParam
String
startDt
,
@RequestParam
String
endDt
)
{
// @RequestParam String startDt,@RequestParam String endDt) {
try
{
// try {
String
[]
ids
=
classIds
.
split
(
","
);
// SysUser user =getSysUser();
boolean
flag
=
true
;
// TKzyCourse course = new TKzyCourse();
for
(
int
i
=
0
;
i
<
ids
.
length
;
i
++){
// course.setCourseName(courseName);
TBaseSecondClass
secondClass
=
secondClassMapper
.
selectByPrimaryKey
(
Long
.
valueOf
(
ids
[
i
]));
// course.setPicUrl(picUrl);
if
(
secondClass
.
getType
()!=
3
){
// course.setCourseIntroduce(courseIntroduce);
flag
=
false
;
// course.setLiveUrl(liveUrl);
break
;
// course.setEditorId(user.getId());
}
// course.setEditorName(user.getRealname());
}
// Date start = DateUtils.parse("yyyy-MM-dd HH:mm:ss",startDt);
if
(!
flag
){
// Date end = DateUtils.parse("yyyy-MM-dd HH:mm:ss", endDt);
return
error
(
"0"
,
"分类类型不匹配"
,
"分类类型不匹配"
);
// course.setStartDt(start);
}
// course.setEndDt(end);
SysUser
user
=
getSysUser
();
// if(id != -1){ //修改
TKzyCourse
course
=
new
TKzyCourse
();
// course.setId(id);
course
.
setCourseName
(
courseName
);
// course.setUpdateDt(new Date());
course
.
setPicUrl
(
picUrl
);
// courseService.updateCourse(course,classIds);
course
.
setCourseIntroduce
(
courseIntroduce
);
// }else{ //添加
course
.
setLiveUrl
(
liveUrl
);
// course.setCreateDt(new Date());
course
.
setEditorId
(
user
.
getId
());
// course.setIsDelete(0);
course
.
setEditorName
(
user
.
getRealname
());
// course.setIsUp(1);
Date
start
=
DateUtils
.
parse
(
"yyyy-MM-dd HH:mm:ss"
,
startDt
);
// course.setCourseType(1);
Date
end
=
DateUtils
.
parse
(
"yyyy-MM-dd HH:mm:ss"
,
endDt
);
// courseService.insertCourse(course,classIds);
course
.
setStartDt
(
start
);
// }
course
.
setEndDt
(
end
);
// return success("操作成功");
if
(
id
!=
-
1
){
//修改
// } catch (Exception e) {
course
.
setId
(
id
);
// e.printStackTrace();
course
.
setUpdateDt
(
new
Date
());
// return error("0","系统异常",null);
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 id
* @return
// * @param courseName
*/
// * @param picUrl
@ResponseBody
// * @param courseIntroduce
@RequestMapping
(
path
=
"/lbCourseInfo"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
},
produces
=
"application/json"
)
// * @param liveUrl
public
Map
lbCourseInfo
(
@RequestParam
long
id
)
{
// * @return
try
{
// */
Map
paramMap
=
new
HashMap
<>();
// @ResponseBody
paramMap
.
put
(
"id"
,
id
);
// @RequestMapping(path = "/saveLbCourse", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
Map
map
=
(
Map
)
openSqlRingsService
.
selectOne_Rings
(
"com.mapping.queryModel.queryCourseLbInfo"
,
paramMap
);
// public Map saveLbCourse(@RequestParam(defaultValue = "-1") long id,@RequestParam String courseName,
List
classList
=
openSqlRingsService
.
selectList_Rings
(
"com.mapping.queryModel.queryCourseClass"
,
paramMap
);
// @RequestParam String picUrl,@RequestParam String courseIntroduce,@RequestParam(defaultValue = "") String liveUrl,@RequestParam(defaultValue = "") String classIds) {
map
.
put
(
"classList"
,
classList
);
// try {
return
success
(
map
);
// SysUser user =getSysUser();
}
catch
(
Exception
e
)
{
// TSjCourse course = new TSjCourse();
e
.
printStackTrace
();
// course.setCourseName(courseName);
return
error
(
"0"
,
"系统异常"
,
null
);
// 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);
// }
// }
}
}
src/main/resources/generatorConfig.xml
View file @
d8d793a
...
@@ -68,33 +68,33 @@
...
@@ -68,33 +68,33 @@
<javaClientGenerator
targetPackage=
"com.server.web.common.mapper"
targetProject=
"src/main/java"
type=
"XMLMAPPER"
>
<javaClientGenerator
targetPackage=
"com.server.web.common.mapper"
targetProject=
"src/main/java"
type=
"XMLMAPPER"
>
<property
name=
"exampleMethodVisibility"
value=
"public"
/>
<property
name=
"exampleMethodVisibility"
value=
"public"
/>
</javaClientGenerator>
</javaClientGenerator>
<
table
tableName=
"t_base_banner"
schema=
"kzy_db_test"
>
<
!--<table tableName="t_base_banner" schema="kzy_db_test">--
>
<
generatedKey
column=
"ID"
sqlStatement=
"JDBC"
identity=
"true"
/
>
<
!--<generatedKey column="ID" sqlStatement="JDBC" identity="true"/>--
>
<
/table
>
<
!--</table>--
>
<
table
tableName=
"t_base_first_class"
schema=
"kzy_db_test"
>
<
!--<table tableName="t_base_first_class" schema="kzy_db_test">--
>
<
generatedKey
column=
"ID"
sqlStatement=
"JDBC"
identity=
"true"
/
>
<
!--<generatedKey column="ID" sqlStatement="JDBC" identity="true"/>--
>
<
/table
>
<
!--</table>--
>
<
table
tableName=
"t_base_second_class"
schema=
"kzy_db_test"
>
<
!--<table tableName="t_base_second_class" schema="kzy_db_test">--
>
<
generatedKey
column=
"ID"
sqlStatement=
"JDBC"
identity=
"true"
/
>
<
!--<generatedKey column="ID" sqlStatement="JDBC" identity="true"/>--
>
<
/table
>
<
!--</table>--
>
<
table
tableName=
"t_kzy_comment"
schema=
"kzy_db_test"
>
<
!--<table tableName="t_kzy_comment" schema="kzy_db_test">--
>
<
generatedKey
column=
"ID"
sqlStatement=
"JDBC"
identity=
"true"
/
>
<
!--<generatedKey column="ID" sqlStatement="JDBC" identity="true"/>--
>
<
/table
>
<
!--</table>--
>
<
table
tableName=
"t_kzy_course"
schema=
"kzy_db_test"
>
<
!--<table tableName="t_kzy_course" schema="kzy_db_test">--
>
<
generatedKey
column=
"ID"
sqlStatement=
"JDBC"
identity=
"true"
/
>
<
!--<generatedKey column="ID" sqlStatement="JDBC" identity="true"/>--
>
<
/table
>
<
!--</table>--
>
<
table
tableName=
"t_kzy_information"
schema=
"kzy_db_test"
>
<
!--<table tableName="t_kzy_information" schema="kzy_db_test">--
>
<
generatedKey
column=
"ID"
sqlStatement=
"JDBC"
identity=
"true"
/
>
<
!--<generatedKey column="ID" sqlStatement="JDBC" identity="true"/>--
>
<
/table
>
<
!--</table>--
>
<table
tableName=
"t_kzy_relation_class"
schema=
"kzy_db_test"
>
<table
tableName=
"t_kzy_relation_class"
schema=
"kzy_db_test"
>
<generatedKey
column=
"ID"
sqlStatement=
"JDBC"
identity=
"true"
/>
<generatedKey
column=
"ID"
sqlStatement=
"JDBC"
identity=
"true"
/>
</table>
</table>
<
table
tableName=
"t_kzy_user"
schema=
"kzy_db_test"
>
<
!--<table tableName="t_kzy_user" schema="kzy_db_test">--
>
<
generatedKey
column=
"ID"
sqlStatement=
"JDBC"
identity=
"true"
/
>
<
!--<generatedKey column="ID" sqlStatement="JDBC" identity="true"/>--
>
<
/table
>
<
!--</table>--
>
<
table
tableName=
"t_kzy_user_integral_flowing"
schema=
"kzy_db_test"
>
<
!--<table tableName="t_kzy_user_integral_flowing" schema="kzy_db_test">--
>
<
generatedKey
column=
"ID"
sqlStatement=
"JDBC"
identity=
"true"
/
>
<
!--<generatedKey column="ID" sqlStatement="JDBC" identity="true"/>--
>
</table
>
<!--</table>--
>
</context>
</context>
</generatorConfiguration>
</generatorConfiguration>
\ No newline at end of file
src/main/resources/mybatis/mapper/TKzyRelationClassMapper.xml
View file @
d8d793a
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
<arg
column=
"first_class_id"
javaType=
"java.lang.Long"
jdbcType=
"BIGINT"
/>
<arg
column=
"first_class_id"
javaType=
"java.lang.Long"
jdbcType=
"BIGINT"
/>
<arg
column=
"second_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=
"create_dt"
javaType=
"java.util.Date"
jdbcType=
"TIMESTAMP"
/>
<arg
column=
"type"
javaType=
"java.lang.Integer"
jdbcType=
"INTEGER"
/>
</constructor>
</constructor>
</resultMap>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<sql
id=
"Example_Where_Clause"
>
...
@@ -69,7 +70,7 @@
...
@@ -69,7 +70,7 @@
</where>
</where>
</sql>
</sql>
<sql
id=
"Base_Column_List"
>
<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>
</sql>
<select
id=
"selectByExample"
parameterType=
"com.server.web.common.model.TKzyRelationClassExample"
resultMap=
"BaseResultMap"
>
<select
id=
"selectByExample"
parameterType=
"com.server.web.common.model.TKzyRelationClassExample"
resultMap=
"BaseResultMap"
>
select
select
...
@@ -103,9 +104,9 @@
...
@@ -103,9 +104,9 @@
</delete>
</delete>
<insert
id=
"insert"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.server.web.common.model.TKzyRelationClass"
useGeneratedKeys=
"true"
>
<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,
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},
values (#{relationId,jdbcType=BIGINT}, #{firstClassId,jdbcType=BIGINT}, #{secondClassId,jdbcType=BIGINT},
#{createDt,jdbcType=TIMESTAMP})
#{createDt,jdbcType=TIMESTAMP}
, #{type,jdbcType=INTEGER}
)
</insert>
</insert>
<insert
id=
"insertSelective"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.server.web.common.model.TKzyRelationClass"
useGeneratedKeys=
"true"
>
<insert
id=
"insertSelective"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.server.web.common.model.TKzyRelationClass"
useGeneratedKeys=
"true"
>
insert into t_kzy_relation_class
insert into t_kzy_relation_class
...
@@ -122,6 +123,9 @@
...
@@ -122,6 +123,9 @@
<if
test=
"createDt != null"
>
<if
test=
"createDt != null"
>
create_dt,
create_dt,
</if>
</if>
<if
test=
"type != null"
>
type,
</if>
</trim>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"relationId != null"
>
<if
test=
"relationId != null"
>
...
@@ -136,6 +140,9 @@
...
@@ -136,6 +140,9 @@
<if
test=
"createDt != null"
>
<if
test=
"createDt != null"
>
#{createDt,jdbcType=TIMESTAMP},
#{createDt,jdbcType=TIMESTAMP},
</if>
</if>
<if
test=
"type != null"
>
#{type,jdbcType=INTEGER},
</if>
</trim>
</trim>
</insert>
</insert>
<select
id=
"countByExample"
parameterType=
"com.server.web.common.model.TKzyRelationClassExample"
resultType=
"java.lang.Long"
>
<select
id=
"countByExample"
parameterType=
"com.server.web.common.model.TKzyRelationClassExample"
resultType=
"java.lang.Long"
>
...
@@ -162,6 +169,9 @@
...
@@ -162,6 +169,9 @@
<if
test=
"record.createDt != null"
>
<if
test=
"record.createDt != null"
>
create_dt = #{record.createDt,jdbcType=TIMESTAMP},
create_dt = #{record.createDt,jdbcType=TIMESTAMP},
</if>
</if>
<if
test=
"record.type != null"
>
type = #{record.type,jdbcType=INTEGER},
</if>
</set>
</set>
<if
test=
"_parameter != null"
>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
<include
refid=
"Update_By_Example_Where_Clause"
/>
...
@@ -173,7 +183,8 @@
...
@@ -173,7 +183,8 @@
relation_id = #{record.relationId,jdbcType=BIGINT},
relation_id = #{record.relationId,jdbcType=BIGINT},
first_class_id = #{record.firstClassId,jdbcType=BIGINT},
first_class_id = #{record.firstClassId,jdbcType=BIGINT},
second_class_id = #{record.secondClassId,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"
>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</if>
...
@@ -193,6 +204,9 @@
...
@@ -193,6 +204,9 @@
<if
test=
"createDt != null"
>
<if
test=
"createDt != null"
>
create_dt = #{createDt,jdbcType=TIMESTAMP},
create_dt = #{createDt,jdbcType=TIMESTAMP},
</if>
</if>
<if
test=
"type != null"
>
type = #{type,jdbcType=INTEGER},
</if>
</set>
</set>
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</update>
...
@@ -201,7 +215,8 @@
...
@@ -201,7 +215,8 @@
set relation_id = #{relationId,jdbcType=BIGINT},
set relation_id = #{relationId,jdbcType=BIGINT},
first_class_id = #{firstClassId,jdbcType=BIGINT},
first_class_id = #{firstClassId,jdbcType=BIGINT},
second_class_id = #{secondClassId,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}
where id = #{id,jdbcType=BIGINT}
</update>
</update>
</mapper>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/queryModel.xml
View file @
d8d793a
...
@@ -160,4 +160,48 @@
...
@@ -160,4 +160,48 @@
</select>
</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>
</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