|
@@ -1,7 +1,11 @@
|
|
|
package com.github.zuihou.business.productionresource.dao;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.github.zuihou.base.mapper.SuperMapper;
|
|
|
+import com.github.zuihou.business.productionresource.dto.EquStatusPageDTO;
|
|
|
import com.github.zuihou.business.productionresource.entity.EquStatus;
|
|
|
+import org.apache.ibatis.annotations.Param;
|
|
|
+import org.apache.ibatis.annotations.Select;
|
|
|
import org.springframework.stereotype.Repository;
|
|
|
|
|
|
/**
|
|
@@ -13,4 +17,26 @@ import org.springframework.stereotype.Repository;
|
|
|
@Repository
|
|
|
public interface EquStatusMapper extends SuperMapper<EquStatus>
|
|
|
{
|
|
|
+ /**
|
|
|
+ * 分页查询
|
|
|
+ */
|
|
|
+ @Select
|
|
|
+ (
|
|
|
+ "<script>" +
|
|
|
+ "SELECT " +
|
|
|
+ " bes.id, bes.status, bes.message, bes.create_time," +
|
|
|
+ " itp.name, itp.code, itp.place_id, itp.compnay_id, itp.area_id," +
|
|
|
+ " bp.plc_name, cca.full_name AS area " +
|
|
|
+ "FROM bt_equ_status bes " +
|
|
|
+ "LEFT JOIN imcs_tenant_productionresource itp ON bes.equ_id = itp.id " +
|
|
|
+ "LEFT JOIN bt_place bp ON itp.place_id = bp.id " +
|
|
|
+ "LEFT JOIN c_common_area cca ON cca.code LIKE CONCAT(itp.area_id, '%') " +
|
|
|
+ "WHERE 1 = 1 " +
|
|
|
+ " <if test=\"null != params.beginTime\"> AND bes.create_time > = #{params.beginTime}</if> " +
|
|
|
+ " <if test=\"null != params.endTime\"> AND bes.create_time < = #{params.endTime}</if> " +
|
|
|
+ //" <if test=\"null != params.company and '' != params.company\"> AND ? LIKE ?</if> " +
|
|
|
+ "ORDER BY bes.create_time DESC" +
|
|
|
+ "</script>"
|
|
|
+ )
|
|
|
+ IPage<EquStatus> findByPage(IPage<EquStatus> page, @Param("params") EquStatusPageDTO params);
|
|
|
}
|