Commit 33cc0fd5 by tyfanchz

实体类修改、设备查询条件修改

1 parent 2a5f4037
package cn.com.glsx.openplatform.model; package cn.com.glsx.openplatform.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
/** /**
* <p>Description: * <p>Description:
...@@ -41,11 +41,13 @@ public class PlatformDevice implements Serializable { ...@@ -41,11 +41,13 @@ public class PlatformDevice implements Serializable {
/** /**
* 客户id t_platform_customer表的id * 客户id t_platform_customer表的id
*/ */
@Column(name = "customer_id")
private Integer customerId; private Integer customerId;
/** /**
* 客户名称 * 客户名称
*/ */
@Transient
private String customerName; private String customerName;
/** /**
......
...@@ -79,23 +79,6 @@ public class R extends HashMap<String, Object> { ...@@ -79,23 +79,6 @@ public class R extends HashMap<String, Object> {
return this; return this;
} }
///**
// * mybatis PageHelper分页数据
// *
// * @param page PageHelper分页数据
// * @return 结果
// */
//public R putPageData(com.github.pagehelper.Page<?> page) {
// Map<Object, Object> data = new HashMap<>(2);
// Map<Object, Object> pageMap = new HashMap<>();
// pageMap.put("pages", page.getPages());
// pageMap.put("total", page.getTotal());
// data.put(PAGE_KEY, pageMap);//分页信息
// data.put(LIST_KEY, page.getResult());//分页数据
// super.put(DATA_KEY, data);
// return this;
//}
/** /**
* 分页数据 * 分页数据
* *
...@@ -104,8 +87,8 @@ public class R extends HashMap<String, Object> { ...@@ -104,8 +87,8 @@ public class R extends HashMap<String, Object> {
*/ */
public R putPageData(Object obj) { public R putPageData(Object obj) {
Map<Object, Object> data = new HashMap<>(2); Map<Object, Object> data = new HashMap<>(2);
if (obj instanceof com.github.pagehelper.Page) { if (obj instanceof Page) {
com.github.pagehelper.Page<?> page = (Page<?>) obj; Page<?> page = (Page<?>) obj;
Map<Object, Object> pageMap = new HashMap<>(); Map<Object, Object> pageMap = new HashMap<>();
pageMap.put("pages", page.getPages()); pageMap.put("pages", page.getPages());
pageMap.put("total", page.getTotal()); pageMap.put("total", page.getTotal());
......
...@@ -28,34 +28,36 @@ ...@@ -28,34 +28,36 @@
<select id="getDeviceMgrList" parameterType="cn.com.glsx.openplatform.vo.DeviceVo" <select id="getDeviceMgrList" parameterType="cn.com.glsx.openplatform.vo.DeviceVo"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select a.id, select a.id,
a.device_sn, a.device_sn,
a.device_type, a.device_type,
b.customer_name, b.customer_name,
a.activat_time, a.activat_time,
a.`status`, a.`status`,
a.create_time, a.create_time,
a.update_time, a.update_time,
a.create_by, a.create_by,
a.update_by, a.update_by,
a.remark a.remark
from t_platform_device a from t_platform_device a
left join t_platform_customer b on a.customer_id = b.id left join t_platform_customer b on a.customer_id = b.id
where 1 = 1 <where>
<if test="customerName != null and customerName != ''"> and a.status != 9
and b.customer_name = #{customerName,jdbcType=VARCHAR} <if test="customerName != null and customerName != ''">
</if> and b.customer_name = #{customerName,jdbcType=VARCHAR}
<if test="customerNameAuth != null and customerNameAuth != ''"> </if>
and b.customer_name = #{customerNameAuth,jdbcType=VARCHAR} <if test="customerNameAuth != null and customerNameAuth != ''">
</if> and b.customer_name = #{customerNameAuth,jdbcType=VARCHAR}
<if test="deviceType != null and deviceType != ''"> </if>
and a.device_type = #{deviceType,jdbcType=VARCHAR} <if test="deviceType != null and deviceType != ''">
</if> and a.device_type = #{deviceType,jdbcType=VARCHAR}
<if test="activatStartTime != null"> </if>
and a.activat_time &gt;= #{activatStartTime,jdbcType=TIMESTAMP} <if test="activatStartTime != null">
</if> and a.activat_time &gt;= #{activatStartTime,jdbcType=TIMESTAMP}
<if test="activatEndTime != null"> </if>
and a.activat_time &lt;= #{activatEndTime,jdbcType=TIMESTAMP} <if test="activatEndTime != null">
</if> and a.activat_time &lt;= #{activatEndTime,jdbcType=TIMESTAMP}
</if>
</where>
</select> </select>
<select id="getDeviceTypeList" resultType="java.lang.String"> <select id="getDeviceTypeList" resultType="java.lang.String">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!