Browse Source

物联网 BUG修复

mengkang 5 years ago
parent
commit
2dee0b362f

+ 6 - 4
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceSimService.java

@ -124,10 +124,12 @@ public class IotDeviceSimService  extends BaseJpaService<IotDeviceSimDO, IotDevi
    public MixEnvelop<IotDeviceSimDO, IotDeviceSimDO> conditionQueryPage(Integer page, Integer size, String status, String sim, String sn){
//        StringBuffer sql = new StringBuffer("SELECT c.* from iot_device_sim c WHERE del=0 ");
        StringBuffer sql = new StringBuffer("SELECT c.*,d.patient_name,d.mobile,w.device_sn sn,w.name   FROM iot_device_sim c LEFT JOIN iot_patient_device d ON c.del=0 AND d.del=1 AND c.sim=d.sim" +
                " LEFT JOIN iot_device w ON c.del = 0 AND w.del = 1 AND c.sim=w.sim_no ");
        StringBuffer sqlCount = new StringBuffer("SELECT  COUNT(c.id) count  FROM iot_device_sim c LEFT JOIN iot_patient_device d ON c.del=0 AND d.del=1 AND c.sim=d.sim " +
                "LEFT JOIN iot_device w ON c.del = 0 AND w.del = 1 AND c.sim=w.sim_no ");
        StringBuffer sql = new StringBuffer("SELECT c.* FROM " +
                " (SELECT c.*,d.patient_name,d.mobile,w.device_sn sn,w.name   FROM iot_device_sim c LEFT JOIN iot_patient_device d ON c.del=0 AND d.del=1 AND c.sim=d.sim LEFT JOIN iot_device w ON c.del = 0 AND w.del = 1 AND c.sim=w.sim_no) c" +
                " WHERE  c.del=0 ");
        StringBuffer sqlCount = new StringBuffer("SELECT  COUNT(c.id) count FROM " +
                " (SELECT c.*,d.patient_name,d.mobile,w.device_sn sn,w.name   FROM iot_device_sim c LEFT JOIN iot_patient_device d ON c.del=0 AND d.del=1 AND c.sim=d.sim LEFT JOIN iot_device w ON c.del = 0 AND w.del = 1 AND c.sim=w.sim_no) c" +
                " WHERE  c.del=0 ");
        List<Object> args = new ArrayList<>();
        if(StringUtils.isNotBlank(status)){
            sql.append(" and c.status=").append(status);