Browse Source

sz 导出 添加查询全部方法

xiao547607 5 years ago
parent
commit
24458f06c9

+ 2 - 0
common/src/main/java/com/jpsoft/smart/modules/base/dao/PersonDeviceLogDAO.java

@@ -25,6 +25,8 @@ public interface PersonDeviceLogDAO {
 
     List<PersonDeviceLog> search(Map<String, Object> searchParams, List<Sort> sortList);
 
+    List<PersonDeviceLog> pageList(Map<String, Object> searchParams, List<Sort> sortList);
+
     List<PersonDeviceLog> simpleSearch(Map<String, Object> searchParams, List<Sort> sortList);
 
     List<PersonDeviceLog> findByPersonAndDate(@Param("personId") Long personId, @Param("startDate")Date startDate, @Param("endDate")Date endDate);

+ 1 - 0
common/src/main/java/com/jpsoft/smart/modules/base/service/PersonDeviceLogService.java

@@ -31,6 +31,7 @@ public interface PersonDeviceLogService {
      */
     void deviceInsertLog(String deviceNo, BigDecimal temperature, JSONObject faceImageJson, JSONObject libMatInfoListJson, JSONObject matchPersonInfo, Date date,Integer maskFlag,String faceImageUrl);
     Page<PersonDeviceLog> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize,boolean count, List<Sort> sortList);
+    List<PersonDeviceLog> pageList(Map<String, Object> searchParams, List<Sort> sortList);
     List<PersonDeviceLog> findByPersonAndDate(Long personId,Date startDate,Date endDate);
     Page<PersonDeviceLog> simplePageSearch(Map<String, Object> searchParams, int pageNum, int pageSize,boolean count, List<Sort> sortList);
     PersonDeviceLog get(String id);

+ 5 - 0
common/src/main/java/com/jpsoft/smart/modules/base/service/impl/PersonDeviceLogServiceImpl.java

@@ -166,6 +166,11 @@ public class PersonDeviceLogServiceImpl implements PersonDeviceLogService {
         return page;
     }
 
+    @Override
+    public List<PersonDeviceLog> pageList(Map<String, Object> searchParams, List<Sort> sortList){
+        return personDeviceLogDAO.pageList(searchParams, sortList);
+    }
+
 
     @Override
     public Page<PersonDeviceLog> simplePageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize, boolean count, List<Sort> sortList) {

+ 86 - 0
common/src/main/resources/mapper/base/PersonDeviceLog.xml

@@ -433,4 +433,90 @@
         </foreach>
         and a.del_flag = 0
     </select>
+
+    <select id="pageList" parameterType="hashmap" resultMap="PersonDeviceLogMap">
+        <![CDATA[
+			select a.* from base_person_device_log a left join base_device_info b
+			on  a.device_no = b.device_no left join base_person_info c
+			on a.person_id = c.id_
+		]]>
+        <where>
+            and a.del_flag = false
+            <if test="searchParams.deviceIdList != null">
+                and b.id_ in
+                <foreach item="item" collection="searchParams.deviceIdList"  open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="searchParams.companyCode != null">
+                and exists (
+                select t1.id_ from base_person_info t1,base_company_info t2
+                where t1.company_id =t2.id_
+                and t2.code_ like #{searchParams.companyCode}
+                and t1.del_flag=0 and t1.id_ = a.person_id
+                )
+            </if>
+            <if test="searchParams.personId != null">
+                and a.person_id = #{searchParams.personId}
+            </if>
+            <if test="searchParams.deviceNo != null">
+                and a.device_no like #{searchParams.deviceNo}
+            </if>
+            <if test="searchParams.aliasName != null">
+                and b.alias_name like #{searchParams.aliasName}
+            </if>
+            <if test="searchParams.personName != null">
+                and c.name_ like #{searchParams.personName}
+            </if>
+            <if test="searchParams.matchStatus != null">
+                and a.match_status = #{searchParams.matchStatus}
+            </if>
+            <if test="searchParams.beginTime != null">
+                <![CDATA[
+                  and a.record_time >= #{searchParams.beginTime}
+                ]]>
+            </if>
+            <if test="searchParams.endTime != null">
+                <![CDATA[
+                  and a.record_time <= #{searchParams.endTime}
+                ]]>
+            </if>
+            <if test="searchParams.minTemperature != null">
+                <![CDATA[
+                  and a.temperature_ >= #{searchParams.minTemperature}
+                ]]>
+            </if>
+            <if test="searchParams.maxTempedistinctrature != null">
+                <![CDATA[
+                  and a.temperature_ <= #{searchParams.maxTemperature}
+                ]]>
+            </if>
+            <if test="searchParams.matchMsg != null">
+                and a.match_msg like #{searchParams.matchMsg}
+            </if>
+            <if test="searchParams.distinct">
+                and a.rownum_ in (
+                SELECT max(rownum_)
+                from base_person_device_log
+                <where>
+                    del_flag=0
+                    <if test="searchParams.beginTime != null">
+                        <![CDATA[
+                          and record_time >= #{searchParams.beginTime}
+                        ]]>
+                    </if>
+                    <if test="searchParams.endTime != null">
+                        <![CDATA[
+                          and record_time <= #{searchParams.endTime}
+                        ]]>
+                    </if>
+                </where>
+                GROUP BY person_id
+                )
+            </if>
+        </where>
+        <foreach item="sort" collection="sortList"  open="order by" separator=",">
+            ${sort.name} ${sort.order}
+        </foreach>
+    </select>
 </mapper>

+ 2 - 1
web/src/main/java/com/jpsoft/smart/modules/base/controller/PersonDeviceLogController.java

@@ -338,7 +338,8 @@ public class PersonDeviceLogController {
                 searchParams.put("maxTemperature", maxTemperature);
             }
 
-            Page<PersonDeviceLog> page = personDeviceLogService.pageSearch(searchParams, 1, 10000, false, sortList);
+            //Page<PersonDeviceLog> page = personDeviceLogService.pageSearch(searchParams, 1, 10000, false, sortList);
+            List<PersonDeviceLog> page = personDeviceLogService.pageList(searchParams,sortList);
 
             SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");