Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
patzn-cloud-service-hmhj
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
wangweidong
patzn-cloud-service-hmhj
Commits
18aad91a
Commit
18aad91a
authored
Aug 25, 2022
by
lijingjing
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
1aac188f
d4625fd7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
EntrustSampleItemIndexMapper.xml
...in/resources/mapper/hmhj/EntrustSampleItemIndexMapper.xml
+11
-4
No files found.
src/main/resources/mapper/hmhj/EntrustSampleItemIndexMapper.xml
View file @
18aad91a
...
@@ -102,8 +102,8 @@
...
@@ -102,8 +102,8 @@
<select
id=
"selectSampleItemIndex"
resultType=
"java.util.Map"
>
<select
id=
"selectSampleItemIndex"
resultType=
"java.util.Map"
>
with sample_item as (
with sample_item as (
SELECT DISTINCT ON ( s.slot_no, ii.NAME )
SELECT DISTINCT ON ( s.slot_no, ii.NAME )
(case when REPLACE(s.NAME, '重取', '') = '原铝' then '原铝' else '铝成品' end)
"sample_name",
s.NAME
"sample_name",
(CASE WHEN strpos(s.code, '-') > 0 THEN s.code ELSE substr(s.code, 0, 8) || '-' || substr(s.code, 8, 4) END)
"sample_code",
s.code
"sample_code",
s.slot_no,
s.slot_no,
s.sample_from,
s.sample_from,
s.sample_grading "brand",
s.sample_grading "brand",
...
@@ -112,10 +112,17 @@
...
@@ -112,10 +112,17 @@
i.tester,
i.tester,
i.test_time,
i.test_time,
ii.NAME,
ii.NAME,
ii.test_value
coalesce(cq.test_value,ii.test_value) "test_value"
FROM entrust_sample_item_index ii
FROM entrust_sample_item_index ii
JOIN entrust_sample_item i ON i.ID = ii.entrust_sample_item_id AND i.deleted = 0
JOIN entrust_sample_item i ON i.ID = ii.entrust_sample_item_id AND i.deleted = 0
JOIN entrust_sample s ON s.ID = i.entrust_sample_id AND s.deleted = 0
JOIN entrust_sample s ON s.ID = i.entrust_sample_id AND s.deleted = 0
LEFT JOIN (
select es.slot_no, esi.period, esii.name ,esii.test_value,to_char(esii.ctime,'yyyy-MM-dd') "ctime" from entrust_sample_item_index esii
join entrust_sample_item esi on esi.id = esii.entrust_sample_item_id and esi.deleted = 0
join entrust_sample es on es.id = esi.entrust_sample_id and es.deleted = 0
where esii.deleted = 0 and es.name = '原铝重取' and esi.name in ('原铝Fe','原铝Si')
order by esii.ctime desc
) cq on cq.slot_no = s.slot_no and cq.period = i.period and cq.name = ii.name and cq.ctime = to_char(ii.ctime,'yyyy-MM-dd')
WHERE ii.deleted = 0
WHERE ii.deleted = 0
<if
test=
"null != entrustIds"
>
<if
test=
"null != entrustIds"
>
<foreach
collection=
"entrustIds"
index=
"index"
item=
"entrustId"
open=
" and s.entrust_id in ("
separator=
","
close=
")"
>
<foreach
collection=
"entrustIds"
index=
"index"
item=
"entrustId"
open=
" and s.entrust_id in ("
separator=
","
close=
")"
>
...
@@ -139,7 +146,7 @@
...
@@ -139,7 +146,7 @@
max(si.tester) "tester",
max(si.tester) "tester",
to_char(max(si.test_time), 'YYYY-MM-DD HH24:MI:SS') "test_time",
to_char(max(si.test_time), 'YYYY-MM-DD HH24:MI:SS') "test_time",
max(r.report_checker) "report_checker",
max(r.report_checker) "report_checker",
max(CASE WHEN si.
NAME
= '原铝' then e.assignor else r.report_issuer end) "report_issuer",
max(CASE WHEN si.
sample_name
= '原铝' then e.assignor else r.report_issuer end) "report_issuer",
max(r.quality_inspector) "quality_inspector",
max(r.quality_inspector) "quality_inspector",
max(case when si.name = '原铝Fe' then trim(si.test_value) end) "fe",
max(case when si.name = '原铝Fe' then trim(si.test_value) end) "fe",
max(case when si.name = '原铝Si' then trim(si.test_value) end) "si",
max(case when si.name = '原铝Si' then trim(si.test_value) end) "si",
...
...
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