Commit ddebfb8b by wubh

包活干V1.9.0-修改:保单列表查询方式

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@27032 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent f50d2d9e
......@@ -61,9 +61,13 @@ public class InsuranceReq extends PagedReq {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date startTimeEnd;
/**
* 关键词
*/
private String keyWord;
public Integer getId() {
return this.id;
return id;
}
public void setId(Integer id) {
......@@ -71,7 +75,7 @@ public class InsuranceReq extends PagedReq {
}
public String getInsuranceId() {
return this.insuranceId;
return insuranceId;
}
public void setInsuranceId(String insuranceId) {
......@@ -79,7 +83,7 @@ public class InsuranceReq extends PagedReq {
}
public String getVehicleOwnerName() {
return this.vehicleOwnerName;
return vehicleOwnerName;
}
public void setVehicleOwnerName(String vehicleOwnerName) {
......@@ -87,7 +91,7 @@ public class InsuranceReq extends PagedReq {
}
public String getVin() {
return this.vin;
return vin;
}
public void setVin(String vin) {
......@@ -95,7 +99,7 @@ public class InsuranceReq extends PagedReq {
}
public String getGpsNo() {
return this.gpsNo;
return gpsNo;
}
public void setGpsNo(String gpsNo) {
......@@ -103,7 +107,7 @@ public class InsuranceReq extends PagedReq {
}
public Byte getStatus() {
return this.status;
return status;
}
public void setStatus(Byte status) {
......@@ -111,7 +115,7 @@ public class InsuranceReq extends PagedReq {
}
public Date getApplyTimeStart() {
return this.applyTimeStart;
return applyTimeStart;
}
public void setApplyTimeStart(Date applyTimeStart) {
......@@ -119,7 +123,7 @@ public class InsuranceReq extends PagedReq {
}
public Date getApplyTimeEnd() {
return this.applyTimeEnd;
return applyTimeEnd;
}
public void setApplyTimeEnd(Date applyTimeEnd) {
......@@ -127,7 +131,7 @@ public class InsuranceReq extends PagedReq {
}
public Date getStartTimeStart() {
return this.startTimeStart;
return startTimeStart;
}
public void setStartTimeStart(Date startTimeStart) {
......@@ -135,26 +139,35 @@ public class InsuranceReq extends PagedReq {
}
public Date getStartTimeEnd() {
return this.startTimeEnd;
return startTimeEnd;
}
public void setStartTimeEnd(Date startTimeEnd) {
this.startTimeEnd = startTimeEnd;
}
public String getKeyWord() {
return keyWord;
}
public void setKeyWord(String keyWord) {
this.keyWord = keyWord;
}
@Override
public String toString() {
return "InsuranceReq{" +
"id=" + this.id +
", insuranceId='" + this.insuranceId + '\'' +
", vehicleOwnerName='" + this.vehicleOwnerName + '\'' +
", vin='" + this.vin + '\'' +
", gpsNo='" + this.gpsNo + '\'' +
", status=" + this.status +
", applyTimeStart=" + this.applyTimeStart +
", applyTimeEnd=" + this.applyTimeEnd +
", startTimeStart=" + this.startTimeStart +
", startTimeEnd=" + this.startTimeEnd +
"id=" + id +
", insuranceId='" + insuranceId + '\'' +
", vehicleOwnerName='" + vehicleOwnerName + '\'' +
", vin='" + vin + '\'' +
", gpsNo='" + gpsNo + '\'' +
", status=" + status +
", applyTimeStart=" + applyTimeStart +
", applyTimeEnd=" + applyTimeEnd +
", startTimeStart=" + startTimeStart +
", startTimeEnd=" + startTimeEnd +
", keyWord='" + keyWord + '\'' +
"} " + super.toString();
}
}
......@@ -148,18 +148,18 @@ public class InsuranceServiceImpl extends BaseOrderService implements InsuranceS
SysInsurancePolicyExample.Criteria byExample = example.createCriteria();
// 根据多个条件动态查询
if (StringUtils.isNotBlank(insuranceReq.getVehicleOwnerName())) {
byExample.andVehicleOwnerNameLike(
"%" + insuranceReq.getVehicleOwnerName() + "%");
}
if (StringUtils.isNotBlank(insuranceReq.getVin())) {
byExample.andVinLike("%" + insuranceReq.getVin() + "%");
}
if (StringUtils.isNotBlank(insuranceReq.getGpsNo())) {
byExample.andGpsNoLike("%" + insuranceReq.getGpsNo() + "%");
}
//if (StringUtils.isNotBlank(insuranceReq.getVehicleOwnerName())) {
// byExample.andVehicleOwnerNameLike(
// "%" + insuranceReq.getVehicleOwnerName() + "%");
//}
//
//if (StringUtils.isNotBlank(insuranceReq.getVin())) {
// byExample.andVinLike("%" + insuranceReq.getVin() + "%");
//}
//
//if (StringUtils.isNotBlank(insuranceReq.getGpsNo())) {
// byExample.andGpsNoLike("%" + insuranceReq.getGpsNo() + "%");
//}
if (insuranceReq.getStatus() != null) {
byExample.andStatusEqualTo(insuranceReq.getStatus());
......@@ -183,6 +183,13 @@ public class InsuranceServiceImpl extends BaseOrderService implements InsuranceS
byExample.andExpectedEffectiveTimeLessThan(insuranceReq.getStartTimeEnd());
}
// 使用关键词查询
if (StringUtils.isNotBlank(insuranceReq.getKeyWord())) {
example.or().andVehicleOwnerNameLike("%" + insuranceReq.getKeyWord() + "%");
example.or().andGpsNoLike("%" + insuranceReq.getKeyWord() + "%");
example.or().andVinLike("%" + insuranceReq.getKeyWord() + "%");
}
example.setOrderByClause(ORDER_CLAUSE);
return example;
......
......@@ -121,7 +121,7 @@
</sql>
<sql id="joinClause">
JOIN sys_insurance_data
LEFT JOIN sys_insurance_data
ON sys_insurance_policy.id = sys_insurance_data.policy_id
</sql>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!