Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dankal-data-view
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
仲光辉
dankal-data-view
Commits
745fbca9
Commit
745fbca9
authored
Mar 29, 2023
by
仲光辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add sql.
parent
2146b5f2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
4 deletions
+31
-4
常用SQL备份.sql
常用SQL备份.sql
+24
-3
线上数据修正SQL记录.sql
线上数据修正SQL记录.sql
+7
-1
No files found.
常用SQL备份.sql
View file @
745fbca9
###
到
访人数据查询
###
到
访人数据查询
...
@@ -8,4 +8,25 @@ FROM company_contacts cc
...
@@ -8,4 +8,25 @@ FROM company_contacts cc
JOIN
opportunity
o
ON
cc
.
opportunity_uuid
=
o
.
uuid
AND
o
.
is_delete
=
0
JOIN
opportunity
o
ON
cc
.
opportunity_uuid
=
o
.
uuid
AND
o
.
is_delete
=
0
WHERE
cc
.
is_delete
=
0
WHERE
cc
.
is_delete
=
0
AND
cc
.
phone
=
'18516698042'
AND
cc
.
phone
=
'18516698042'
ORDER
BY
cc
.
sort
,
cc
.
uuid
ORDER
BY
cc
.
sort
,
cc
.
uuid
;
\ No newline at end of file
##
合同单价和合同单元租金不一致的新建待修改合同信息
SELECT
c
.
contract_code
AS
`合同编号`
,
SUM
(
cu
.
rent
)
AS
`合同单元租金总和`
,
ccprs
.
unit_price
AS
`合同单价`
FROM
contract_unit
AS
cu
INNER
JOIN
contract
AS
c
ON
c
.
uuid
=
cu
.
contract_uuid
AND
c
.
is_draft
=
0
INNER
JOIN
contract_clause_pay_rent_setting
AS
ccprs
ON
ccprs
.
contract_uuid
=
c
.
uuid
AND
ccprs
.
type
=
1
WHERE
ccprs
.
is_delete
=
0
AND
cu
.
is_delete
=
0
AND
c
.
contract_status
IN
(
2
)
AND
c
.
project_uuid
NOT
IN
(
'31cf853be4424e239dd4748637965ad6'
,
'3936309d0ed14bf7a324d22b0475dfcb'
,
'50bd66a25dfe4489a5d51b9a3dc030e6'
,
'50e593d2093b4a179e8a1aac2d8294f6'
,
'767f8ca2152c42fba8c425241609028a'
,
'8f906e20ce0f4d10b2b0d8c95436fe61'
)
GROUP
BY
c
.
uuid
HAVING
SUM
(
cu
.
rent
)
<>
`合同单价`
;
\ No newline at end of file
线上数据修正SQL记录.sql
View file @
745fbca9
UPDAT
E
project_floor_sub_item
UPDAT
E
project_floor_sub_item
...
@@ -371,6 +371,12 @@ WHERE t.uuid = 1620607853716373505;
...
@@ -371,6 +371,12 @@ WHERE t.uuid = 1620607853716373505;
##
approval_status
=
4
UPDATE
mfg
.
contract
t
SET
t
.
approval_status
=
null
WHERE
t
.
uuid
=
1584927368992124930
;
alter
table
expense_project_type
add
`expense_name`
varchar
(
80
)
DEFAULT
NULL
COMMENT
'费用类型'
;
...
...
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