Bladeren bron

sql查询优化

anderx 4 jaren geleden
bovenliggende
commit
160767aa43

+ 23 - 6
.idea/workspace.xml

@@ -9,11 +9,9 @@
     <option name="autoReloadType" value="SELECTIVE" />
   </component>
   <component name="ChangeListManager">
-    <list default="true" id="03bdfc55-71bf-4741-8c4c-e1a0c2a3c3ba" name="Default Changelist" comment="1、发送邮件BUG修复&#10;2、部门列表新增后未显示BUG修复&#10;3、新增转交客户时转交资料">
+    <list default="true" id="03bdfc55-71bf-4741-8c4c-e1a0c2a3c3ba" name="Default Changelist" comment="1、资料列表修改">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/main/java/com/goafanti/common/mapper/UserMapper.xml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/goafanti/common/mapper/UserMapper.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/goafanti/common/mapper/UserMapperExt.xml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/goafanti/common/mapper/UserMapperExt.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/main/resources/props/config_local.properties" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/props/config_local.properties" afterDir="false" />
     </list>
     <list id="571ad643-3e7d-4437-aedf-999fc56d0449" name="updateBusinessScope" comment="" />
@@ -92,6 +90,17 @@
     </key>
   </component>
   <component name="RunManager">
+    <configuration default="true" type="ArquillianJUnit" factoryName="" nameIsGenerated="true">
+      <option name="arquillianRunConfiguration">
+        <value>
+          <option name="containerStateName" value="" />
+        </value>
+      </option>
+      <option name="TEST_OBJECT" value="class" />
+      <method v="2">
+        <option name="Make" enabled="true" />
+      </method>
+    </configuration>
     <configuration name="Tomcat 8.5.59" type="#com.intellij.j2ee.web.tomcat.TomcatRunConfigurationFactory" factoryName="Local" APPLICATION_SERVER_NAME="Tomcat 8.5.59" ALTERNATIVE_JRE_ENABLED="false" nameIsGenerated="true">
       <option name="OPEN_IN_BROWSER" value="false" />
       <option name="COMMON_VM_ARGUMENTS" value="-Dprofiles.activation=&quot;local&quot; -Djdbc.worker.id=&quot;1001&quot;" />
@@ -226,7 +235,7 @@
       <workItem from="1630888067668" duration="852000" />
       <workItem from="1630893291690" duration="11740000" />
       <workItem from="1630976664603" duration="14614000" />
-      <workItem from="1631062478856" duration="3480000" />
+      <workItem from="1631062478856" duration="7084000" />
     </task>
     <task id="LOCAL-00001" summary="修改客户跟进列表">
       <created>1630486551669</created>
@@ -382,7 +391,14 @@
       <option name="project" value="LOCAL" />
       <updated>1631004412303</updated>
     </task>
-    <option name="localTasksCounter" value="23" />
+    <task id="LOCAL-00023" summary="1、资料列表修改">
+      <created>1631066579124</created>
+      <option name="number" value="00023" />
+      <option name="presentableId" value="LOCAL-00023" />
+      <option name="project" value="LOCAL" />
+      <updated>1631066579124</updated>
+    </task>
+    <option name="localTasksCounter" value="24" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
@@ -422,7 +438,8 @@
     <MESSAGE value="1、发送邮件BUG修复&#10;2、部门列表新增后未显示BUG修复" />
     <MESSAGE value="1、发送邮件BUG修复&#10;2、部门列表新增后未显示BUG修复&#10;3、转交客户修改" />
     <MESSAGE value="1、发送邮件BUG修复&#10;2、部门列表新增后未显示BUG修复&#10;3、新增转交客户时转交资料" />
-    <option name="LAST_COMMIT_MESSAGE" value="1、发送邮件BUG修复&#10;2、部门列表新增后未显示BUG修复&#10;3、新增转交客户时转交资料" />
+    <MESSAGE value="1、资料列表修改" />
+    <option name="LAST_COMMIT_MESSAGE" value="1、资料列表修改" />
     <option name="MAKE_NEW_CHANGELIST_ACTIVE" value="true" />
   </component>
   <component name="XDebuggerManager">

+ 3 - 0
src/main/java/com/goafanti/common/mapper/UserMapper.xml

@@ -1824,7 +1824,10 @@
   </if>
   left join organization_identity oi on u.id = oi.uid
     <if test="shiroType==2">
+      /*处理空查询很慢的问题*/
+      <if test="adminName !=null or depId !=null">
       left join admin a on u.aid=a.id left join department d on a.department_id =d.id
+      </if>
     </if>
   where  u.`type` =1 and u.status=0
     <if test="shiroType==1">

+ 6 - 6
src/main/resources/props/config_local.properties

@@ -2,13 +2,13 @@ dev.name=local
 #Driver
 jdbc.driverClassName=com.mysql.jdbc.Driver
 #本地
-#jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-#jdbc.username=root
-#jdbc.password=123456
-#•#
-jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+jdbc.url=jdbc\:mysql://localhost:3306/aft20210820?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 jdbc.username=root
-jdbc.password=aftdev
+jdbc.password=123456
+#•#
+#jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+#jdbc.username=root
+#jdbc.password=aftdev
 #\u68c0\u6d4b\u6570\u636e\u5e93\u94fe\u63a5\u662f\u5426\u6709\u6548\uff0c\u5fc5\u987b\u914d\u7f6e
 jdbc.validationQuery=SELECT 'x'
 #\u521d\u59cb\u8fde\u63a5\u6570