Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sunac_report
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
java-sunac-report
sunac_report
Commits
f18e2721
Commit
f18e2721
authored
Aug 26, 2019
by
sunxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
业务类型可用范围 关联修改 删除
parent
f4520004
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
5 deletions
+39
-5
CtBbtcTypeAreaDao.java
src/main/java/com/ejweb/modules/report/dao/CtBbtcTypeAreaDao.java
+6
-0
CtBbtcBusTypeService.java
src/main/java/com/ejweb/modules/report/service/CtBbtcBusTypeService.java
+18
-4
CtBbtcBusTypeDao.xml
src/main/resources/mappings/modules/report/CtBbtcBusTypeDao.xml
+1
-1
CtBbtcTypeAreaDao.xml
src/main/resources/mappings/modules/report/CtBbtcTypeAreaDao.xml
+14
-0
No files found.
src/main/java/com/ejweb/modules/report/dao/CtBbtcTypeAreaDao.java
View file @
f18e2721
...
@@ -20,5 +20,10 @@ public interface CtBbtcTypeAreaDao extends CrudDao<CtBbtcTypeArea> {
...
@@ -20,5 +20,10 @@ public interface CtBbtcTypeAreaDao extends CrudDao<CtBbtcTypeArea> {
public
List
<
CtBbtcTypeArea
>
getByAreaId
(
CtBbtcTypeArea
area
);
public
List
<
CtBbtcTypeArea
>
getByAreaId
(
CtBbtcTypeArea
area
);
public
List
<
CtBbtcTypeArea
>
getByParentId
(
CtBbtcTypeArea
area
);
/*跟据parentId 删除*/
public
int
deleteByParentId
(
CtBbtcTypeArea
area
);
}
}
\ No newline at end of file
src/main/java/com/ejweb/modules/report/service/CtBbtcBusTypeService.java
View file @
f18e2721
...
@@ -6,6 +6,7 @@ package com.ejweb.modules.report.service;
...
@@ -6,6 +6,7 @@ package com.ejweb.modules.report.service;
import
java.util.List
;
import
java.util.List
;
import
java.util.UUID
;
import
java.util.UUID
;
import
com.ejweb.core.utils.StringUtils
;
import
com.ejweb.modules.report.dao.CtBbtcRegionDao
;
import
com.ejweb.modules.report.dao.CtBbtcRegionDao
;
import
com.ejweb.modules.report.dao.CtBbtcTypeAreaDao
;
import
com.ejweb.modules.report.dao.CtBbtcTypeAreaDao
;
import
com.ejweb.modules.report.entity.CtBbtcRegion
;
import
com.ejweb.modules.report.entity.CtBbtcRegion
;
...
@@ -51,12 +52,20 @@ public class CtBbtcBusTypeService extends CrudService<CtBbtcBusTypeDao, CtBbtcBu
...
@@ -51,12 +52,20 @@ public class CtBbtcBusTypeService extends CrudService<CtBbtcBusTypeDao, CtBbtcBu
super
.
save
(
ctBbtcBusType
);
super
.
save
(
ctBbtcBusType
);
/*将可用范围存到 typearea表中*/
/*将可用范围存到 typearea表中*/
System
.
out
.
println
(
ctBbtcBusType
.
getGroup
()+
"=========================="
);
System
.
out
.
println
(
ctBbtcBusType
.
getArea
()+
"========================="
);
String
[]
groups
=
ctBbtcBusType
.
getGroup
().
split
(
","
);
String
[]
groups
=
ctBbtcBusType
.
getGroup
().
split
(
","
);
String
[]
areas
=
ctBbtcBusType
.
getArea
().
split
(
","
);
String
[]
areas
=
ctBbtcBusType
.
getArea
().
split
(
","
);
/*判断是新增还是修改*/
CtBbtcTypeArea
ctBbtcTypeArea0
=
new
CtBbtcTypeArea
();
ctBbtcTypeArea0
.
setParentId
(
ctBbtcBusType
.
getId
());
List
<
CtBbtcTypeArea
>
listParentId
=
ctBbtcTypeAreaDao
.
getByParentId
(
ctBbtcTypeArea0
);
//修改
if
(
listParentId
.
size
()!=
0
&&
listParentId
!=
null
){
//删除前面所有parentid的信息 重新存
ctBbtcTypeAreaDao
.
deleteByParentId
(
ctBbtcTypeArea0
);
}
int
i
=
0
;
int
i
=
0
;
for
(
String
typeArea:
groups
)
{
for
(
String
typeArea:
groups
)
{
CtBbtcTypeArea
ctBbtcTypeArea
=
new
CtBbtcTypeArea
();
CtBbtcTypeArea
ctBbtcTypeArea
=
new
CtBbtcTypeArea
();
...
@@ -80,6 +89,10 @@ public class CtBbtcBusTypeService extends CrudService<CtBbtcBusTypeDao, CtBbtcBu
...
@@ -80,6 +89,10 @@ public class CtBbtcBusTypeService extends CrudService<CtBbtcBusTypeDao, CtBbtcBu
@Transactional
(
readOnly
=
false
)
@Transactional
(
readOnly
=
false
)
public
void
delete
(
CtBbtcBusType
ctBbtcBusType
)
{
public
void
delete
(
CtBbtcBusType
ctBbtcBusType
)
{
super
.
delete
(
ctBbtcBusType
);
super
.
delete
(
ctBbtcBusType
);
//删除关联表中 parentid为id的数据
CtBbtcTypeArea
ctBbtcTypeArea
=
new
CtBbtcTypeArea
();
ctBbtcTypeArea
.
setParentId
(
ctBbtcBusType
.
getId
());
ctBbtcTypeAreaDao
.
deleteByParentId
(
ctBbtcTypeArea
);
}
}
}
}
\ No newline at end of file
src/main/resources/mappings/modules/report/CtBbtcBusTypeDao.xml
View file @
f18e2721
...
@@ -72,7 +72,7 @@
...
@@ -72,7 +72,7 @@
<update
id=
"update"
>
<update
id=
"update"
>
UPDATE ct_bbtc_bus_type SET
UPDATE ct_bbtc_bus_type SET
fnumber = #{number},
fnumber = #{number},
name = #{name}
,
name = #{name}
WHERE id = #{id}
WHERE id = #{id}
</update>
</update>
...
...
src/main/resources/mappings/modules/report/CtBbtcTypeAreaDao.xml
View file @
f18e2721
...
@@ -24,6 +24,14 @@
...
@@ -24,6 +24,14 @@
WHERE a.id = #{id}
WHERE a.id = #{id}
</select>
</select>
<select
id=
"getByParentId"
resultType=
"com.ejweb.modules.report.entity.CtBbtcTypeArea"
>
SELECT
<include
refid=
"ctBbtcTypeAreaColumns"
/>
FROM CT_BBTC_TYPE_AREA a
<include
refid=
"ctBbtcTypeAreaJoins"
/>
WHERE a.parent_id = #{parentId}
</select>
<select
id=
"getByAreaId"
resultType=
"com.ejweb.modules.report.entity.CtBbtcTypeArea"
>
<select
id=
"getByAreaId"
resultType=
"com.ejweb.modules.report.entity.CtBbtcTypeArea"
>
SELECT
SELECT
<include
refid=
"ctBbtcTypeAreaColumns"
/>
<include
refid=
"ctBbtcTypeAreaColumns"
/>
...
@@ -75,5 +83,10 @@
...
@@ -75,5 +83,10 @@
DELETE FROM CT_BBTC_TYPE_AREA
DELETE FROM CT_BBTC_TYPE_AREA
WHERE id = #{id}
WHERE id = #{id}
</update>
</update>
<update
id=
"deleteByParentId"
>
DELETE FROM CT_BBTC_TYPE_AREA
WHERE parent_id = #{parentId}
</update>
</mapper>
</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