Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
lanbaoming
jiedao-api-boot-master
Commits
8a679bff
Commit
8a679bff
authored
Nov 04, 2024
by
332784038@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sql格式修正
parent
496ebadb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
45 deletions
+43
-45
ProductMapper.java
...yudao/module/product/dal/mysql/product/ProductMapper.java
+43
-45
No files found.
yudao-module-product/yudao-module-product-core/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/product/ProductMapper.java
View file @
8a679bff
...
...
@@ -121,65 +121,63 @@ public interface ProductMapper extends BaseMapperX<ProductDO> {
"AND t.`type_id` = #{query.typeId}",
"</when>",*/
"<when test=
\"query.typeId != null and query.typeId.size()>0\">"
+
" <when test=\"query.typeId != null and query.typeId != '' and query.typeId.size()==1 \">"
+
"
AND t.`type_id` =\n"
+
"
<foreach item='typeId' index='index' collection='query.typeId' >\n"
+
"
#{typeId}"
+
"
</foreach>"
+
" </when>"
+
" <when test=\"query.typeId != null and query.typeId != '' and query.typeId.size()>1 \">"
+
"
AND t.`type_id` in "
+
"
<foreach item='typeId' index='index' collection='query.typeId' open='(' separator=',' close=')'>"
+
"
#{typeId}"
+
"
</foreach>"
+
" </when>"
+
"</when>"
,
"<when test=
'query.typeId != null and query.typeId.size()>0'>"
,
" <when test=' query.typeId.size()==1 '>"
,
"
AND t.`type_id` = "
,
"
<foreach item='typeId' index='index' collection='query.typeId' >"
,
"
#{typeId}"
,
"
</foreach>"
,
" </when>"
,
" <when test=' query.typeId.size()>1 '>"
,
"
AND t.`type_id` in "
,
"
<foreach item='typeId' index='index' collection='query.typeId' open='(' separator=',' close=')'>"
,
"
#{typeId}"
,
"
</foreach>"
,
" </when>"
,
"</when>"
,
"<when test = 'query.status != null'>"
,
"AND t.`status` = #{query.status}"
,
"</when>"
,
"<when test = 'query.auditStatus != null'>"
,
"AND t.`audit_status` = #{query.auditStatus}"
,
"AND t.`audit_status` = #{query.auditStatus}"
,
"</when>"
,
"<when test='query.auditStatusList != null and query.auditStatusList.size()>0 '>"
,
"<when test='query.auditStatusList.size()==1 '>"
+
"<foreach item='auditStatus' index=
\"index\" collection='query.auditStatusList' >"
+
"AND t.`audit_status` = #{auditStatus}"
+
"</foreach>"
+
"</when>"
,
"<when test='query.auditStatusList.size()>1 '>"
,
" AND t.`audit_status` in "
,
" <foreach item='auditStatus' index='index' collection='query.auditStatusList' open='(' separator=',' close=')'>"
,
"
#{auditStatus}"
,
"
</foreach>"
,
"</when>"
,
"<when test='query.auditStatusList.size()==1 '>"
,
"<foreach item='auditStatus' index=
'index' collection='query.auditStatusList' >"
,
"AND t.`audit_status` = #{auditStatus}"
,
"</foreach>"
,
"</when>"
,
"<when test='query.auditStatusList.size()>1 '>"
,
" AND t.`audit_status` in "
,
" <foreach item='auditStatus' index='index' collection='query.auditStatusList' open='(' separator=',' close=')'>"
,
"
#{auditStatus}"
,
"
</foreach>"
,
"</when>"
,
"</when>"
,
"<when test = 'query.packaging != null'>"
,
"AND t.`packaging` = #{query.packaging}"
,
"AND t.`packaging` = #{query.packaging}"
,
"</when>"
,
"<when test = 'query.titleZh != null and query.titleZh != \"\"'>"
,
"AND (t.`title_zh` like concat('%',concat(#{query.titleZh},'%')) or t.`title_en` like concat('%',concat(#{query.titleZh},'%')))"
,
"AND (t.`title_zh` like concat('%',concat(#{query.titleZh},'%')) or t.`title_en` like concat('%',concat(#{query.titleZh},'%')))"
,
"</when>"
,
// "<when test = 'query.attrId != null and query.attrId != \"\" '>",
"<when test='query.attrId != null and query.attrId.size()>0'>"
,
"<when test='query.attrId != null and query.attrId != '' and
query.attrId.size()==1 '>"
,
"<foreach item='attrId' index=
\"index\"
collection='query.attrId' >"
,
"<when test='
query.attrId.size()==1 '>"
,
"<foreach item='attrId' index=
'index'
collection='query.attrId' >"
,
"AND t.`attr_id` = #{attrId}"
,
"</foreach>"
,
"</when>"
,
"<when test='
query.attrId != null and query.attrId != ''
and query.attrId.size()>1 '>"
,
"AND (1!=1 "
+
"<when test='and query.attrId.size()>1 '>"
,
"AND (1!=1 "
,
" <foreach item='attrId' index='index' collection='query.attrId'>"
,
" OR FIND_IN_SET(t.`attr_id`, #{attrId})"
,
"</foreach>"
,
" )"
,
"</when>"
,
// "AND FIND_IN_SET(t.`attr_id`, #{query.attrId})",
"</when>"
,
"<when test='query.materialTypes != null and query.materialTypes.size()>0'>"
,
...
...
@@ -187,13 +185,13 @@ public interface ProductMapper extends BaseMapperX<ProductDO> {
"<foreach item='materialType' index=\"index\" collection='query.materialTypes' >"
,
"AND t.`material_type` = #{materialType}"
,
"</foreach>"
,
"</when>"
,
"</when>"
,
"<when test= 'query.materialTypes != null and query.materialTypes.size()>1 '>"
,
"
AND t.`material_type` in "
,
"
<foreach item='materialType' index='index' collection='query.materialTypes' open='(' separator=',' close=')'>"
,
"
#{materialType}"
,
"
</foreach>"
,
"</when>"
,
" AND t.`material_type` in "
,
"<foreach item='materialType' index='index' collection='query.materialTypes' open='(' separator=',' close=')'>"
,
" #{materialType}"
,
" </foreach>"
,
"</when>"
,
"</when>"
,
" <when test='query.beginCreateTime != null' >"
,
...
...
@@ -203,23 +201,23 @@ public interface ProductMapper extends BaseMapperX<ProductDO> {
"AND <![CDATA[ t.create_time <= #{query.endCreateTime} ]]> "
,
"</when>"
,
"<when test=
\"query.creator != null and query.creator != '' \"
>"
+
"<when test=
'query.creator != null and query.creator != \"\" '
>"
+
"AND c.`nickname` like concat('%',concat(#{query.creator},'%'))"
,
"</when>"
,
"<when test=
\"query.titleZhKey != null and query.titleZhKey != '' \"
>"
+
"<when test=
'query.titleZhKey != null and query.titleZhKey != \"\" '
>"
+
"AND t.`title_zh` like concat('%',concat(#{query.titleZhKey},'%'))"
,
"</when>"
,
"<when test=
\"query.notTitleZhKey != null and query.notTitleZhKey != '' \"
>"
+
"<when test=
'query.notTitleZhKey != null and query.notTitleZhKey != \"\" '
>"
+
"AND t.`title_zh` not like concat('%',concat(#{query.notTitleZhKey},'%'))"
,
"</when>"
,
"<when test=
\"query.eqTitleZhKey != null and query.eqTitleZhKey != '' \"
>"
+
"<when test=
'query.eqTitleZhKey != null and query.eqTitleZhKey != \"\" '
>"
+
"AND t.`title_zh` = #{query.eqTitleZhKey} "
,
"</when>"
,
"<when test=
\"query.notEqTitleZhKey != null and query.notEqTitleZhKey != '' \"
>"
+
"<when test=
'query.notEqTitleZhKey != null and query.notEqTitleZhKey != \"\" '
>"
+
"AND t.`title_zh` != #{query.notEqTitleZhKey} "
,
"</when>"
,
...
...
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