Browse Source

修改工作端项目列表加载慢的问题

feature/syp_points
liuchuang 5 years ago
parent
commit
07e5822207
  1. 35
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml

35
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml

@ -152,25 +152,40 @@
LEFT JOIN epdc_item_handle_process hp ON item.ID = hp.ITEM_ID
AND hp.DEL_FLAG = '0'
AND hp.CREATED_TIME = ( SELECT MAX( a.CREATED_TIME ) FROM epdc_item_handle_process a WHERE a.DEL_FLAG = '0' AND a.ITEM_ID = hp.ITEM_ID )
LEFT JOIN epdc_item_dept dept ON item.Id = dept.ITEM_ID AND dept.DEL_FLAG = '0'
WHERE
item.DEL_FLAG = '0'
<if test="formDto.timestamp != null">
<![CDATA[ AND DATE_FORMAT(item.CREATED_TIME,'%Y-%m-%d %H:%i:%s') <= ]]> #{formDto.timestamp}
</if>
AND dept.DEPT_ID IN
item.ID IN (
SELECT
tmp.ITEM_ID
FROM
(
SELECT DISTINCT
d.ITEM_ID
FROM
epdc_item_dept d
LEFT JOIN epdc_item it ON d.ITEM_ID = it.ID
WHERE
d.DEL_FLAG = '0'
AND it.DEL_FLAG = '0'
AND d.DEPT_ID IN
<foreach item="deptIdItem" collection="deptIdList" open="(" separator="," close=")">
#{deptIdItem}
</foreach>
<if test='formDto.deptId != null and formDto.deptId != ""'>
AND dept.DEPT_ID = #{formDto.deptId}
<if test="formDto.timestamp != null">
<![CDATA[ AND DATE_FORMAT(it.CREATED_TIME,'%Y-%m-%d %H:%i:%s') <= ]]> #{formDto.timestamp}
</if>
<if test='formDto.itemState != null '>
AND item.ITEM_STATE = #{formDto.itemState}
AND it.ITEM_STATE = #{formDto.itemState}
</if>
<if test='formDto.deptId != null and formDto.deptId != ""'>
AND d.DEPT_ID = #{formDto.deptId}
</if>
ORDER BY
item.CREATED_TIME DESC
it.CREATED_TIME DESC
LIMIT #{formDto.pageIndex},#{formDto.pageSize}
) tmp
)
ORDER BY
item.CREATED_TIME DESC
</select>
<select id="selectListItemsOfMine" resultMap="itemsMap">

Loading…
Cancel
Save