Commit 33cc0fd5 by tyfanchz

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

1 parent 2a5f4037
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.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
/**
* <p>Description:
......@@ -41,11 +41,13 @@ public class PlatformDevice implements Serializable {
/**
* 客户id t_platform_customer表的id
*/
@Column(name = "customer_id")
private Integer customerId;
/**
* 客户名称
*/
@Transient
private String customerName;
/**
......
......@@ -79,23 +79,6 @@ public class R extends HashMap<String, Object> {
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> {
*/
public R putPageData(Object obj) {
Map<Object, Object> data = new HashMap<>(2);
if (obj instanceof com.github.pagehelper.Page) {
com.github.pagehelper.Page<?> page = (Page<?>) obj;
if (obj instanceof Page) {
Page<?> page = (Page<?>) obj;
Map<Object, Object> pageMap = new HashMap<>();
pageMap.put("pages", page.getPages());
pageMap.put("total", page.getTotal());
......
......@@ -28,34 +28,36 @@
<select id="getDeviceMgrList" parameterType="cn.com.glsx.openplatform.vo.DeviceVo"
resultMap="BaseResultMap">
select a.id,
a.device_sn,
a.device_type,
b.customer_name,
a.activat_time,
a.`status`,
a.create_time,
a.update_time,
a.create_by,
a.update_by,
a.remark
a.device_sn,
a.device_type,
b.customer_name,
a.activat_time,
a.`status`,
a.create_time,
a.update_time,
a.create_by,
a.update_by,
a.remark
from t_platform_device a
left join t_platform_customer b on a.customer_id = b.id
where 1 = 1
<if test="customerName != null and customerName != ''">
and b.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
<if test="customerNameAuth != null and customerNameAuth != ''">
and b.customer_name = #{customerNameAuth,jdbcType=VARCHAR}
</if>
<if test="deviceType != null and deviceType != ''">
and a.device_type = #{deviceType,jdbcType=VARCHAR}
</if>
<if test="activatStartTime != null">
and a.activat_time &gt;= #{activatStartTime,jdbcType=TIMESTAMP}
</if>
<if test="activatEndTime != null">
and a.activat_time &lt;= #{activatEndTime,jdbcType=TIMESTAMP}
</if>
<where>
and a.status != 9
<if test="customerName != null and customerName != ''">
and b.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
<if test="customerNameAuth != null and customerNameAuth != ''">
and b.customer_name = #{customerNameAuth,jdbcType=VARCHAR}
</if>
<if test="deviceType != null and deviceType != ''">
and a.device_type = #{deviceType,jdbcType=VARCHAR}
</if>
<if test="activatStartTime != null">
and a.activat_time &gt;= #{activatStartTime,jdbcType=TIMESTAMP}
</if>
<if test="activatEndTime != null">
and a.activat_time &lt;= #{activatEndTime,jdbcType=TIMESTAMP}
</if>
</where>
</select>
<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!