Commit 8a679bff authored by 332784038@qq.com's avatar 332784038@qq.com

sql格式修正

parent 496ebadb
...@@ -121,65 +121,63 @@ public interface ProductMapper extends BaseMapperX<ProductDO> { ...@@ -121,65 +121,63 @@ public interface ProductMapper extends BaseMapperX<ProductDO> {
"AND t.`type_id` = #{query.typeId}", "AND t.`type_id` = #{query.typeId}",
"</when>",*/ "</when>",*/
"<when test=\"query.typeId != null and query.typeId.size()>0\">" + "<when test='query.typeId != null and query.typeId.size()>0'>",
" <when test=\"query.typeId != null and query.typeId != '' and query.typeId.size()==1 \">" + " <when test=' query.typeId.size()==1 '>",
" AND t.`type_id` =\n" + " AND t.`type_id` = ",
" <foreach item='typeId' index='index' collection='query.typeId' >\n" + " <foreach item='typeId' index='index' collection='query.typeId' >",
" #{typeId}" + " #{typeId}",
" </foreach>" + " </foreach>" ,
" </when>" + " </when>",
" <when test=\"query.typeId != null and query.typeId != '' and query.typeId.size()>1 \">" + " <when test=' query.typeId.size()>1 '>",
" AND t.`type_id` in " + " AND t.`type_id` in ",
" <foreach item='typeId' index='index' collection='query.typeId' open='(' separator=',' close=')'>" + " <foreach item='typeId' index='index' collection='query.typeId' open='(' separator=',' close=')'>" ,
" #{typeId}" + " #{typeId}" ,
" </foreach>" + " </foreach>" ,
" </when>" + " </when>" ,
"</when>", "</when>",
"<when test = 'query.status != null'>", "<when test = 'query.status != null'>",
"AND t.`status` = #{query.status}", "AND t.`status` = #{query.status}",
"</when>", "</when>",
"<when test = 'query.auditStatus != null'>", "<when test = 'query.auditStatus != null'>",
"AND t.`audit_status` = #{query.auditStatus}", "AND t.`audit_status` = #{query.auditStatus}",
"</when>", "</when>",
"<when test='query.auditStatusList != null and query.auditStatusList.size()>0 '>" , "<when test='query.auditStatusList != null and query.auditStatusList.size()>0 '>" ,
"<when test='query.auditStatusList.size()==1 '>" + "<when test='query.auditStatusList.size()==1 '>",
"<foreach item='auditStatus' index=\"index\" collection='query.auditStatusList' >" + "<foreach item='auditStatus' index='index' collection='query.auditStatusList' >",
"AND t.`audit_status` = #{auditStatus}" + "AND t.`audit_status` = #{auditStatus}",
"</foreach>" + "</foreach>",
"</when>", "</when>",
"<when test='query.auditStatusList.size()>1 '>", "<when test='query.auditStatusList.size()>1 '>",
" AND t.`audit_status` in ", " AND t.`audit_status` in ",
" <foreach item='auditStatus' index='index' collection='query.auditStatusList' open='(' separator=',' close=')'>", " <foreach item='auditStatus' index='index' collection='query.auditStatusList' open='(' separator=',' close=')'>",
" #{auditStatus}", "#{auditStatus}",
" </foreach>" , "</foreach>" ,
"</when>" , "</when>" ,
"</when>", "</when>",
"<when test = 'query.packaging != null'>", "<when test = 'query.packaging != null'>",
"AND t.`packaging` = #{query.packaging}", "AND t.`packaging` = #{query.packaging}",
"</when>", "</when>",
"<when test = 'query.titleZh != null and query.titleZh != \"\"'>", "<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>",
// "<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.size()>0'>" ,
"<when test='query.attrId != null and query.attrId != '' and query.attrId.size()==1 '>" , "<when test=' query.attrId.size()==1 '>" ,
"<foreach item='attrId' index=\"index\" collection='query.attrId' >" , "<foreach item='attrId' index='index' collection='query.attrId' >" ,
"AND t.`attr_id` = #{attrId}" , "AND t.`attr_id` = #{attrId}" ,
"</foreach>", "</foreach>",
"</when>", "</when>",
"<when test='query.attrId != null and query.attrId != '' and query.attrId.size()>1 '>" , "<when test='and query.attrId.size()>1 '>" ,
"AND (1!=1 " + "AND (1!=1 " ,
" <foreach item='attrId' index='index' collection='query.attrId'>" , " <foreach item='attrId' index='index' collection='query.attrId'>" ,
" OR FIND_IN_SET(t.`attr_id`, #{attrId})", " OR FIND_IN_SET(t.`attr_id`, #{attrId})",
"</foreach>" , "</foreach>" ,
" )" , " )" ,
"</when>", "</when>",
// "AND FIND_IN_SET(t.`attr_id`, #{query.attrId})",
"</when>", "</when>",
"<when test='query.materialTypes != null and query.materialTypes.size()>0'>" , "<when test='query.materialTypes != null and query.materialTypes.size()>0'>" ,
...@@ -187,13 +185,13 @@ public interface ProductMapper extends BaseMapperX<ProductDO> { ...@@ -187,13 +185,13 @@ public interface ProductMapper extends BaseMapperX<ProductDO> {
"<foreach item='materialType' index=\"index\" collection='query.materialTypes' >" , "<foreach item='materialType' index=\"index\" collection='query.materialTypes' >" ,
"AND t.`material_type` = #{materialType}" , "AND t.`material_type` = #{materialType}" ,
"</foreach>" , "</foreach>" ,
"</when>", "</when>",
"<when test= 'query.materialTypes != null and query.materialTypes.size()>1 '>", "<when test= 'query.materialTypes != null and query.materialTypes.size()>1 '>",
" AND t.`material_type` in " , " AND t.`material_type` in " ,
" <foreach item='materialType' index='index' collection='query.materialTypes' open='(' separator=',' close=')'>", "<foreach item='materialType' index='index' collection='query.materialTypes' open='(' separator=',' close=')'>",
" #{materialType}" , " #{materialType}" ,
" </foreach>" , " </foreach>" ,
"</when>" , "</when>" ,
"</when>", "</when>",
" <when test='query.beginCreateTime != null' >", " <when test='query.beginCreateTime != null' >",
...@@ -203,23 +201,23 @@ public interface ProductMapper extends BaseMapperX<ProductDO> { ...@@ -203,23 +201,23 @@ public interface ProductMapper extends BaseMapperX<ProductDO> {
"AND <![CDATA[ t.create_time <= #{query.endCreateTime} ]]> ", "AND <![CDATA[ t.create_time <= #{query.endCreateTime} ]]> ",
"</when>", "</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},'%'))", "AND c.`nickname` like concat('%',concat(#{query.creator},'%'))",
"</when>", "</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},'%'))", "AND t.`title_zh` like concat('%',concat(#{query.titleZhKey},'%'))",
"</when>", "</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},'%'))", "AND t.`title_zh` not like concat('%',concat(#{query.notTitleZhKey},'%'))",
"</when>", "</when>",
"<when test=\"query.eqTitleZhKey != null and query.eqTitleZhKey != '' \">" + "<when test='query.eqTitleZhKey != null and query.eqTitleZhKey != \"\" '>" +
"AND t.`title_zh` = #{query.eqTitleZhKey} ", "AND t.`title_zh` = #{query.eqTitleZhKey} ",
"</when>", "</when>",
"<when test=\"query.notEqTitleZhKey != null and query.notEqTitleZhKey != '' \">" + "<when test='query.notEqTitleZhKey != null and query.notEqTitleZhKey != \"\" '>" +
"AND t.`title_zh` != #{query.notEqTitleZhKey} ", "AND t.`title_zh` != #{query.notEqTitleZhKey} ",
"</when>", "</when>",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment