Commit 758842b4 authored by taabe's avatar taabe

修改查询关联点列表接口

parent 9f881e0a
......@@ -36,6 +36,8 @@ public class PointListParam extends CommonPageable{
*/
private String orgCode;
private String[] bindingPointIds;
public String getPointNo() {
return pointNo;
}
......@@ -91,4 +93,12 @@ public class PointListParam extends CommonPageable{
public void setFmeaId(Long fmeaId) {
this.fmeaId = fmeaId;
}
public String[] getBindingPointIds() {
return bindingPointIds;
}
public void setBindingPointIds(String[] bindingPointIds) {
this.bindingPointIds = bindingPointIds;
}
}
package com.yeejoin.amos.fas.business.param;
import java.util.HashMap;
import java.util.List;
import com.yeejoin.amos.fas.core.common.request.CommonPageable;
......@@ -8,39 +7,41 @@ import com.yeejoin.amos.fas.core.common.request.CommonRequest;
public class QueryParamUtil {
public static PointListParam fillPointListParam(List<CommonRequest> queryRequests, CommonPageable commonPageable,
PointListParam param) {
for (int i = 0; i < queryRequests.size(); i++) {
String name = queryRequests.get(i).getName();
String value = toString(queryRequests.get(i).getValue());
if ("departmentId".equals(name)) {
param.setDepartmentId(Long.valueOf(value));
}else if("pointNo".equals(name)){
param.setPointNo(value);
}else if("pointName".equals(name)){
param.setPointName(value);
}else if("pointId".equals(name)){
param.setPointId(Long.valueOf(value));
}else if("inputType".equals(name)){
param.setInputType(value);
}else if("fmeaId".equals(name)){
param.setFmeaId(Long.valueOf(value));
}
}
if (commonPageable != null) {
param.setPageNumber(commonPageable.getPageNumber());
param.setPageSize(commonPageable.getPageSize());
}
return param;
}
private static String toString(Object value) {
if (null == value || value == "") {
return null;
} else {
return value.toString();
}
}
public static PointListParam fillPointListParam(List<CommonRequest> queryRequests, CommonPageable commonPageable,
PointListParam param) {
for (int i = 0; i < queryRequests.size(); i++) {
String name = queryRequests.get(i).getName();
String value = toString(queryRequests.get(i).getValue());
if ("departmentId".equals(name)) {
param.setDepartmentId(Long.valueOf(value));
} else if ("pointNo".equals(name)) {
param.setPointNo(value);
} else if ("pointName".equals(name)) {
param.setPointName(value);
} else if ("pointId".equals(name)) {
param.setPointId(Long.valueOf(value));
} else if ("inputType".equals(name)) {
param.setInputType(value);
} else if ("fmeaId".equals(name)) {
param.setFmeaId(Long.valueOf(value));
} else if ("bindPointIds".equals(name)) {
param.setBindingPointIds(value.split(","));
}
}
if (commonPageable != null) {
param.setPageNumber(commonPageable.getPageNumber());
param.setPageSize(commonPageable.getPageSize());
}
return param;
}
private static String toString(Object value) {
if (null == value || value == "") {
return null;
} else {
return value.toString();
}
}
}
......@@ -13,6 +13,11 @@
<if test="pointNo!=null"> and p.point_no like concat(concat("%",#{pointNo}),"%") </if>
<if test="pointId!=null"> and p.id = #{pointId} </if>
<if test="pointName!=null"> and p.name like concat(concat("%",#{pointName}),"%")</if>
<if test="bindingPointIds!=null"> and p.id not in
<foreach collection="bindingPointIds" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
</select>
<select id="getPointList" resultType="java.util.HashMap">
SELECT
......@@ -27,6 +32,11 @@
<if test="pointNo!=null"> and p.point_no like concat(concat("%",#{pointNo}),"%") </if>
<if test="pointId!=null"> and p.id = #{pointId} </if>
<if test="pointName!=null"> and p.name like concat(concat("%",#{pointName}),"%")</if>
<if test="bindingPointIds!=null"> and p.id not in
<foreach collection="bindingPointIds" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
order by p.point_no
<choose>
<when test="pageSize==-1"></when>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment