Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
indicators
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhangkb
indicators
Commits
4c2dbb08
Commit
4c2dbb08
authored
Jun 19, 2020
by
zhangkb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加短板单元目录和短板单元crud接口
parent
a2822fac
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
445 additions
and
7 deletions
+445
-7
ShortboardRuleCtrl.java
...eymobile/indicators/api/hytobacco/ShortboardRuleCtrl.java
+0
-7
ShortboardUnitCtrl.java
...eymobile/indicators/api/hytobacco/ShortboardUnitCtrl.java
+92
-0
ShortboardUnit.java
...le/indicators/model/entity/shortboard/ShortboardUnit.java
+36
-0
ShortboardUnitCatalog.java
...cators/model/entity/shortboard/ShortboardUnitCatalog.java
+31
-0
ShortboardUnitCatalogMapper.java
...s/model/mapper/indmapper/ShortboardUnitCatalogMapper.java
+20
-0
ShortboardUnitMapper.java
...dicators/model/mapper/indmapper/ShortboardUnitMapper.java
+20
-0
ShortboardUnitCatalogService.java
...ators/service/hytobacco/ShortboardUnitCatalogService.java
+84
-0
ShortboardUnitService.java
...e/indicators/service/hytobacco/ShortboardUnitService.java
+106
-0
ShortboardUnitCatalogMapper.xml
...resources/mybatis/mapping/ShortboardUnitCatalogMapper.xml
+30
-0
ShortboardUnitMapper.xml
src/main/resources/mybatis/mapping/ShortboardUnitMapper.xml
+26
-0
No files found.
src/main/java/com/keymobile/indicators/api/hytobacco/ShortboardRuleCtrl.java
View file @
4c2dbb08
...
@@ -80,11 +80,4 @@ public class ShortboardRuleCtrl {
...
@@ -80,11 +80,4 @@ public class ShortboardRuleCtrl {
@RequestParam
List
<
String
>
compareObjs
,
@RequestParam
List
<
String
>
driveIds
)
throws
Exception
{
@RequestParam
List
<
String
>
compareObjs
,
@RequestParam
List
<
String
>
driveIds
)
throws
Exception
{
return
shortboardRuleService
.
getObjShortboard
(
compareId
,
date
,
compareObjs
,
driveIds
);
return
shortboardRuleService
.
getObjShortboard
(
compareId
,
date
,
compareObjs
,
driveIds
);
}
}
@ApiOperation
(
value
=
"根据给定的短板规则筛选短板单位"
,
notes
=
"根据给定的短板规则筛选短板单位"
)
@PostMapping
(
value
=
"/getObjFromShortboardRule"
)
public
List
<
Map
<
String
,
Object
>>
getObjFromShortboardRule
(
@RequestParam
int
date
,
@RequestParam
List
<
String
>
compareObjs
,
@RequestParam
List
<
String
>
driveIds
,
@RequestParam
List
<
Integer
>
shortboardRuleIds
)
throws
Exception
{
return
shortboardRuleService
.
getObjFromShortboardRule
(
date
,
compareObjs
,
driveIds
,
shortboardRuleIds
);
}
}
}
src/main/java/com/keymobile/indicators/api/hytobacco/ShortboardUnitCtrl.java
0 → 100644
View file @
4c2dbb08
package
com
.
keymobile
.
indicators
.
api
.
hytobacco
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.keymobile.indicators.model.entity.shortboard.ShortboardUnit
;
import
com.keymobile.indicators.model.entity.shortboard.ShortboardUnitCatalog
;
import
com.keymobile.indicators.service.hytobacco.ShortboardRuleService
;
import
com.keymobile.indicators.service.hytobacco.ShortboardUnitCatalogService
;
import
com.keymobile.indicators.service.hytobacco.ShortboardUnitService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
@Api
(
tags
={
"短板筛选单元CRUD"
})
@RestController
@RequestMapping
(
value
=
"/shortboardUnit"
)
public
class
ShortboardUnitCtrl
{
@Autowired
private
ShortboardUnitCatalogService
shortboardUnitCatalogService
;
@Autowired
private
ShortboardUnitService
shortboardUnitService
;
@Autowired
private
ShortboardRuleService
shortboardRuleService
;
@ApiOperation
(
value
=
"新增/修改短板筛选单元目录"
,
notes
=
"新增/修改短板筛选单元目录"
)
@PostMapping
(
value
=
"/saveOrUpdateCatalog"
)
public
Integer
saveOrUpdateCatalog
(
@RequestBody
ShortboardUnitCatalog
shortboardUnitCatalog
)
throws
Exception
{
shortboardUnitCatalog
=
shortboardUnitCatalogService
.
saveOrUpdate
(
shortboardUnitCatalog
);
return
shortboardUnitCatalog
.
getId
();
}
@ApiOperation
(
value
=
"批量级联删除短板筛选单元目录"
,
notes
=
"批量级联删除短板筛选规则目录"
)
@PostMapping
(
value
=
"/deleteCatalog"
)
public
void
deleteCatalog
(
@RequestParam
List
<
Integer
>
ids
)
throws
Exception
{
shortboardUnitCatalogService
.
recursionDelete
(
ids
);
}
@ApiOperation
(
value
=
"获取短板筛选规则目录"
,
notes
=
"获取短板筛选规则目录"
)
@PostMapping
(
value
=
"/getCatalog"
)
public
List
<
ShortboardUnitCatalog
>
getCatalog
(
@RequestParam
(
required
=
false
)
Integer
parentId
,
@RequestParam
List
<
String
>
codes
){
return
shortboardUnitCatalogService
.
getCatalog
(
parentId
,
codes
);
}
@ApiOperation
(
value
=
"新增/修改"
,
notes
=
"新增/修改"
)
@PostMapping
(
value
=
"/saveOrUpdate"
)
public
Integer
saveOrUpdate
(
@RequestBody
ShortboardUnit
shortboardUnit
,
@RequestParam
Integer
catalogId
,
@RequestParam
String
catalogIdPath
,
@RequestParam
String
user
)
{
return
shortboardUnitService
.
saveOrUpdate
(
shortboardUnit
,
catalogId
,
catalogIdPath
,
user
);
}
@ApiOperation
(
value
=
"删除"
,
notes
=
"删除"
)
@PostMapping
(
value
=
"/delete"
)
public
void
delete
(
@RequestParam
Integer
id
)
{
shortboardUnitService
.
delete
(
id
);
}
@ApiOperation
(
value
=
"根据短板筛选单元目录获取短板筛选单元"
,
notes
=
"根据短板筛选单元目录获取短板筛选单元"
)
@PostMapping
(
value
=
"/getByCatalogId"
)
public
Map
<
String
,
Object
>
getByCatalogId
(
@RequestParam
Integer
catalogId
,
@RequestParam
(
value
=
"page"
,
required
=
false
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"rows"
,
required
=
false
,
defaultValue
=
"10"
)
int
rows
){
return
shortboardUnitService
.
getByCatalogId
(
catalogId
,
page
,
rows
);
}
@ApiOperation
(
value
=
"根据id获取短板筛选单元"
,
notes
=
"根据id获取短板筛选单元"
)
@PostMapping
(
value
=
"/findById"
)
public
ShortboardUnit
findById
(
@RequestParam
Integer
id
)
{
return
shortboardUnitService
.
getById
(
id
);
}
@ApiOperation
(
value
=
"根据给定的短板规则筛选短板单位(预览)"
,
notes
=
"根据给定的短板规则筛选短板单位(预览)"
)
@PostMapping
(
value
=
"/getObjFromShortboardRule"
)
public
List
<
Map
<
String
,
Object
>>
getObjFromShortboardRule
(
@RequestParam
int
date
,
@RequestParam
List
<
String
>
compareObjs
,
@RequestParam
List
<
String
>
driveIds
,
@RequestParam
List
<
Integer
>
shortboardRuleIds
)
throws
Exception
{
return
shortboardRuleService
.
getObjFromShortboardRule
(
date
,
compareObjs
,
driveIds
,
shortboardRuleIds
);
}
@ApiOperation
(
value
=
"根据给定的短板单元id计算短板对象"
,
notes
=
"根据给定的短板单元id计算短板对象"
)
@PostMapping
(
value
=
"/getShortboardFromUnitId"
)
public
List
<
Map
<
String
,
Object
>>
getShortboardFromUnitId
(
@RequestParam
Integer
unitId
)
throws
Exception
{
return
shortboardUnitService
.
getShortboardObjFromUnit
(
unitId
);
}
}
src/main/java/com/keymobile/indicators/model/entity/shortboard/ShortboardUnit.java
0 → 100644
View file @
4c2dbb08
package
com
.
keymobile
.
indicators
.
model
.
entity
.
shortboard
;
import
java.util.Date
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
com.keymobile.indicators.utils.DateUtils
;
import
lombok.Data
;
/**
*author:zhangkb time:2020-6-19 desc:短板筛选单元实体
*/
@Data
@Table
(
name
=
"short_board_unit"
)
public
class
ShortboardUnit
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Integer
id
;
private
String
unitName
;
private
String
unitDesc
;
private
String
commpareObjs
;
//短板对象,多个用分号隔开
private
String
driveIndIds
;
//考核指标id,多个用分号隔开
private
String
shortboardIds
;
//短板规则id,多个用分号隔开
private
Integer
date
;
//考核时间
private
Integer
catalogId
;
private
String
catalogIdPath
;
private
String
creater
;
private
String
createTime
=
DateUtils
.
formatDate
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
);
private
String
updater
;
private
String
updateTime
=
DateUtils
.
formatDate
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
);
}
src/main/java/com/keymobile/indicators/model/entity/shortboard/ShortboardUnitCatalog.java
0 → 100644
View file @
4c2dbb08
package
com
.
keymobile
.
indicators
.
model
.
entity
.
shortboard
;
import
java.util.Date
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
com.keymobile.indicators.utils.DateUtils
;
import
lombok.Data
;
/**
*author:zhangkb time:2020-6-19 desc:短板筛选单元目录实体
*/
@Data
@Table
(
name
=
"short_board_unit_catalog"
)
public
class
ShortboardUnitCatalog
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Integer
id
;
private
String
catalogName
;
private
String
catalogType
;
private
Integer
parentId
;
//顶层节点parentId为0
private
String
idPath
;
private
String
code
;
//目录编码
private
String
lastUpdater
;
private
String
lastUpdateTime
=
DateUtils
.
formatDate
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
);
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/ShortboardUnitCatalogMapper.java
0 → 100644
View file @
4c2dbb08
package
com
.
keymobile
.
indicators
.
model
.
mapper
.
indmapper
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.keymobile.indicators.model.entity.shortboard.ShortboardUnitCatalog
;
import
feign.Param
;
import
tk.mybatis.mapper.common.BaseMapper
;
@Mapper
public
interface
ShortboardUnitCatalogMapper
extends
BaseMapper
<
ShortboardUnitCatalog
>{
public
void
deleteByIdIn
(
List
<
Integer
>
ids
);
public
List
<
ShortboardUnitCatalog
>
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
Map
<
String
,
Object
>
params
);
public
List
<
ShortboardUnitCatalog
>
findByParentId
(
@Param
(
"pid"
)
Integer
pid
);
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/ShortboardUnitMapper.java
0 → 100644
View file @
4c2dbb08
package
com
.
keymobile
.
indicators
.
model
.
mapper
.
indmapper
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.keymobile.indicators.model.entity.shortboard.ShortboardUnit
;
import
feign.Param
;
import
tk.mybatis.mapper.common.BaseMapper
;
@Mapper
public
interface
ShortboardUnitMapper
extends
BaseMapper
<
ShortboardUnit
>{
public
void
deleteByCatalogIdIn
(
List
<
Integer
>
ids
);
public
List
<
ShortboardUnit
>
findByCatalogId
(
@Param
(
"catalogId"
)
Integer
catalogId
,
@Param
(
"start"
)
int
start
,
@Param
(
"end"
)
int
end
);
public
int
countByCatalogId
(
@Param
(
"catalogId"
)
Integer
catalogId
);
}
src/main/java/com/keymobile/indicators/service/hytobacco/ShortboardUnitCatalogService.java
0 → 100644
View file @
4c2dbb08
package
com
.
keymobile
.
indicators
.
service
.
hytobacco
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.keymobile.indicators.model.entity.shortboard.ShortboardUnitCatalog
;
import
com.keymobile.indicators.model.mapper.indmapper.ShortboardUnitCatalogMapper
;
import
com.keymobile.indicators.model.mapper.indmapper.ShortboardUnitMapper
;
@Service
public
class
ShortboardUnitCatalogService
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
ShortboardUnitCatalogService
.
class
);
@Autowired
private
ShortboardUnitCatalogMapper
shortboardUnitCatalogMapper
;
@Autowired
private
ShortboardUnitMapper
shortboardUnitMapper
;
public
ShortboardUnitCatalog
saveOrUpdate
(
ShortboardUnitCatalog
shortboardUnitCatalog
)
throws
Exception
{
if
(
shortboardUnitCatalog
.
getId
()==
null
)
{
//新增
//保存
shortboardUnitCatalogMapper
.
insert
(
shortboardUnitCatalog
);
}
//获取parentId拼接idPath
Integer
parentId
=
shortboardUnitCatalog
.
getParentId
();
if
(
parentId
==
0
)
{
//顶层节点
shortboardUnitCatalog
.
setIdPath
(
String
.
valueOf
(
shortboardUnitCatalog
.
getId
()));
}
else
{
ShortboardUnitCatalog
parentShortboardUnitCatalog
=
shortboardUnitCatalogMapper
.
selectByPrimaryKey
(
shortboardUnitCatalog
.
getParentId
());
if
(
parentShortboardUnitCatalog
==
null
)
{
throw
new
Exception
(
"父节点不存在:parent catalog is not exist"
);
}
else
{
shortboardUnitCatalog
.
setIdPath
(
parentShortboardUnitCatalog
.
getIdPath
()+
";"
+
shortboardUnitCatalog
.
getId
());
}
}
//保存
shortboardUnitCatalogMapper
.
updateByPrimaryKey
(
shortboardUnitCatalog
);
return
shortboardUnitCatalog
;
}
public
void
delete
(
List
<
Integer
>
ids
)
{
shortboardUnitCatalogMapper
.
deleteByIdIn
(
ids
);
}
//递归查找父目录下的子目录
public
List
<
Integer
>
getDeleteCatalogId
(
Integer
id
){
List
<
Integer
>
result
=
new
ArrayList
<>();
result
.
add
(
id
);
//根据id获取子节点
List
<
ShortboardUnitCatalog
>
children
=
shortboardUnitCatalogMapper
.
findByParentId
(
id
);
if
(!
children
.
isEmpty
())
{
for
(
ShortboardUnitCatalog
child
:
children
)
{
result
.
addAll
(
getDeleteCatalogId
(
child
.
getId
()));
}
}
return
result
;
}
//递归删除
public
void
recursionDelete
(
List
<
Integer
>
ids
)
{
for
(
Integer
id
:
ids
)
{
List
<
Integer
>
result
=
this
.
getDeleteCatalogId
(
id
);
this
.
delete
(
result
);
//删除目录关联的短板筛选规则
shortboardUnitMapper
.
deleteByCatalogIdIn
(
result
);
}
}
//获取目录树
public
List
<
ShortboardUnitCatalog
>
getCatalog
(
Integer
parentId
,
List
<
String
>
codes
){
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"pid"
,
parentId
);
paramMap
.
put
(
"codes"
,
codes
);
return
shortboardUnitCatalogMapper
.
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
paramMap
);
}
}
src/main/java/com/keymobile/indicators/service/hytobacco/ShortboardUnitService.java
0 → 100644
View file @
4c2dbb08
package
com
.
keymobile
.
indicators
.
service
.
hytobacco
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.keymobile.indicators.model.entity.shortboard.ShortboardUnit
;
import
com.keymobile.indicators.model.mapper.indmapper.ShortboardUnitMapper
;
import
com.keymobile.indicators.utils.DateUtils
;
@Service
public
class
ShortboardUnitService
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
ShortboardUnitService
.
class
);
@Autowired
private
ShortboardUnitMapper
shortboardUnitMapper
;
@Autowired
private
ShortboardRuleService
shortboardRuleService
;
public
Integer
saveOrUpdate
(
ShortboardUnit
shortboardUnit
,
Integer
catalogId
,
String
catalogIdPath
,
String
user
)
{
shortboardUnit
.
setCatalogId
(
catalogId
);
shortboardUnit
.
setCatalogIdPath
(
catalogIdPath
);
if
(
shortboardUnit
.
getId
()==
null
)
{
//新增
shortboardUnit
.
setCreater
(
user
);
shortboardUnit
.
setCreateTime
(
DateUtils
.
formatDate
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
));
shortboardUnit
.
setUpdater
(
user
);
shortboardUnit
.
setUpdateTime
(
DateUtils
.
formatDate
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
));
shortboardUnitMapper
.
insert
(
shortboardUnit
);
}
else
{
//修改
shortboardUnit
.
setUpdater
(
user
);
shortboardUnit
.
setUpdateTime
(
DateUtils
.
formatDate
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
));
shortboardUnitMapper
.
updateByPrimaryKey
(
shortboardUnit
);
}
return
shortboardUnit
.
getId
();
}
public
void
delete
(
Integer
id
)
{
shortboardUnitMapper
.
deleteByPrimaryKey
(
id
);
}
public
Map
<
String
,
Object
>
getByCatalogId
(
Integer
catalogId
,
int
page
,
int
rows
){
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
int
count
=
0
;
//计算start
int
start
=
(
page
-
1
)*
rows
;
count
=
shortboardUnitMapper
.
countByCatalogId
(
catalogId
);
List
<
ShortboardUnit
>
datas
=
shortboardUnitMapper
.
findByCatalogId
(
catalogId
,
start
,
rows
);
result
.
put
(
"count"
,
count
);
result
.
put
(
"data"
,
datas
);
return
result
;
}
public
ShortboardUnit
getById
(
Integer
id
)
{
ShortboardUnit
shortboardUnit
=
shortboardUnitMapper
.
selectByPrimaryKey
(
id
);
if
(
shortboardUnit
!=
null
)
{
return
shortboardUnit
;
}
return
null
;
}
//根据短板规则单元获取
public
List
<
Map
<
String
,
Object
>>
getShortboardObjFromUnit
(
Integer
id
)
throws
Exception
{
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<>();
ShortboardUnit
shortboardUnit
=
this
.
getById
(
id
);
if
(
shortboardUnit
!=
null
)
{
List
<
String
>
compareObjList
=
new
ArrayList
<>();
List
<
String
>
driveIndIdList
=
new
ArrayList
<>();
List
<
Integer
>
shortboardIdList
=
new
ArrayList
<>();
//转换短板对象
String
compareObjsString
=
shortboardUnit
.
getCommpareObjs
();
if
(
StringUtils
.
isNotBlank
(
compareObjsString
))
{
String
[]
compareObjs
=
compareObjsString
.
split
(
";"
);
compareObjList
=
Arrays
.
asList
(
compareObjs
);
}
//转换考核指标id
String
driveIndIdsString
=
shortboardUnit
.
getDriveIndIds
();
if
(
StringUtils
.
isNotBlank
(
driveIndIdsString
))
{
String
[]
driveIndIds
=
driveIndIdsString
.
split
(
";"
);
driveIndIdList
=
Arrays
.
asList
(
driveIndIds
);
}
//转换短板规则id
String
shortboardIdsString
=
shortboardUnit
.
getShortboardIds
();
if
(
StringUtils
.
isNotBlank
(
shortboardIdsString
))
{
String
[]
shortboardIds
=
shortboardIdsString
.
split
(
";"
);
for
(
String
shortboardId
:
shortboardIds
)
{
shortboardIdList
.
add
(
Integer
.
parseInt
(
shortboardId
));
}
}
if
(!
compareObjList
.
isEmpty
()
&&
!
driveIndIdList
.
isEmpty
()
&&
!
shortboardIdList
.
isEmpty
())
{
result
=
shortboardRuleService
.
getObjFromShortboardRule
(
shortboardUnit
.
getDate
(),
compareObjList
,
driveIndIdList
,
shortboardIdList
);
}
}
return
result
;
}
}
src/main/resources/mybatis/mapping/ShortboardUnitCatalogMapper.xml
0 → 100644
View file @
4c2dbb08
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.keymobile.indicators.model.mapper.indmapper.ShortboardUnitCatalogMapper"
>
<delete
id=
"deleteByIdIn"
parameterType=
"java.util.List"
>
delete
from short_board_unit_catalog
where id in
<foreach
item=
"id"
collection=
"ids"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</delete>
<select
id=
"findByParentIdAndCodeInOrderByLastUpdateTimeDesc"
parameterType=
"map"
resultType=
"com.keymobile.indicators.model.entity.shortboard.ShortboardUnitCatalog"
>
select *
from short_board_unit_catalog
where parent_id = #{pid} and
code in
<foreach
item=
"id"
collection=
"codes"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
order by last_update_time desc
</select>
<select
id=
"findByParentId"
resultType=
"com.keymobile.indicators.model.entity.shortboard.ShortboardUnitCatalog"
>
select *
from short_board_unit_catalog
where parent_id = #{pid}
</select>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/ShortboardUnitMapper.xml
0 → 100644
View file @
4c2dbb08
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.keymobile.indicators.model.mapper.indmapper.ShortboardUnitMapper"
>
<select
id=
"findByCatalogId"
resultType=
"com.keymobile.indicators.model.entity.shortboard.ShortboardUnit"
>
select *
from short_board_unit
where catalog_id = #{catalogId}
limit #{start},#{end}
</select>
<select
id=
"countByCatalogId"
resultType=
"java.lang.Integer"
>
select count(1)
from short_board_unit
where catalog_id = #{catalogId}
</select>
<delete
id=
"deleteByCatalogIdIn"
parameterType=
"java.util.List"
>
delete
from short_board_unit
where catalog_id in
<foreach
item=
"id"
collection=
"catalogIds"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment