Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
huang.tao
/
jmai-platform
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
24c71c79
authored
Jan 23, 2026
by
zhu.zewen
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复专账部门数据隔离
parent
373eac38
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
7 deletions
jmai-physic/src/main/java/com/jmai/physic/mapper/PhysicBillMapper.java
jmai-physic/src/main/java/com/jmai/physic/service/impl/PhysicBillServiceImpl.java
jmai-physic/src/main/resources/mapper/PhysicBillMapper.xml
jmai-physic/src/main/java/com/jmai/physic/mapper/PhysicBillMapper.java
View file @
24c71c79
...
...
@@ -9,6 +9,7 @@ import com.jmai.physic.vo.BillQueryVO;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
javax.annotation.Nullable
;
import
java.util.List
;
...
...
@@ -19,7 +20,7 @@ public interface PhysicBillMapper extends BaseMapper<PhysicBill> {
Integer
selectSumByName
(
@Param
(
"name"
)
String
name
,
@Param
(
"spec"
)
String
spec
,
@Param
(
"factoryName"
)
String
factoryName
,
@Param
(
"deptId"
)
Long
deptId
);
List
<
BillInfoVO
>
selectByGroup
(
@Param
(
"physicName"
)
String
physicName
);
List
<
BillInfoVO
>
selectByGroup
(
@Param
(
"physicName"
)
String
physicName
,
@Param
(
"deptId"
)
@Nullable
Long
deptId
);
Page
<
BillQueryVO
>
selectBillPage
(
Page
<
BillQueryVO
>
page
,
@Param
(
"req"
)
PhysicBillQueryReq
req
);
}
jmai-physic/src/main/java/com/jmai/physic/service/impl/PhysicBillServiceImpl.java
View file @
24c71c79
...
...
@@ -84,8 +84,8 @@ public class PhysicBillServiceImpl extends AbstractService implements PhysicBill
@Override
public
List
<
BillInfoVO
>
listBill
(
String
physicName
)
{
List
<
BillInfoVO
>
billInfoVOS
=
physicBillMapper
.
selectByGroup
(
physicName
);
Long
deptId
=
SpringContextUtils
.
getDeptId
();
List
<
BillInfoVO
>
billInfoVOS
=
physicBillMapper
.
selectByGroup
(
physicName
,
deptId
);
return
billInfoVOS
;
}
...
...
jmai-physic/src/main/resources/mapper/PhysicBillMapper.xml
View file @
24c71c79
...
...
@@ -13,12 +13,23 @@
physic_name=#{name} and physic_spec=#{spec} and factory_name =#{factoryName} and dept_id =#{deptId}
</select>
<select
id=
"selectByGroup"
resultType=
"com.jmai.physic.vo.BillInfoVO"
>
select physic_name,physic_spec,factory_name from physic_bill
where physic_name LIKE CONCAT('%', #{physicName}, '%') group by physic_name,physic_spec,factory_name,dept_id
SELECT physic_name,physic_spec,factory_name
FROM physic_bill
WHERE del_flag = 0
AND physic_name LIKE CONCAT('%', #{physicName}, '%')
<if
test=
"deptId != null"
>
AND dept_id = #{deptId}
</if>
GROUP BY physic_name,physic_spec,factory_name,dept_id
</select>
<select
id=
"selectBillPage"
resultType=
"com.jmai.physic.vo.BillQueryVO"
>
select *,b.dept_name from physic_bill a left join sys_dept b on a.dept_id =b.id where a.physic_name =#{req.physicName} and
a.physic_spec =#{req.physicSpec} and a.factory_name =#{req.factoryName} order by a.create_time desc
SELECT *, b.dept_name
FROM physic_bill a
LEFT JOIN sys_dept b ON a.dept_id =b.id
WHERE a.physic_name =#{req.physicName}
AND a.physic_spec =#{req.physicSpec}
AND a.factory_name =#{req.factoryName}
ORDER BY a.create_time DESC
</select>
...
...
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