Commit 2f585aab authored by 廖旭伟's avatar 廖旭伟

修改综窗事项列表接口

parent 831ea89f
package com.mortals.xhx.system; //package com.mortals.xhx.system;
//
import com.alibaba.fastjson.JSON; //import com.alibaba.fastjson.JSON;
import com.mortals.framework.model.AccessLogPdu; //import com.mortals.framework.model.AccessLogPdu;
import com.mortals.framework.model.BizLogPdu; //import com.mortals.framework.model.BizLogPdu;
import com.mortals.framework.model.ErrorLogPdu; //import com.mortals.framework.model.ErrorLogPdu;
import com.mortals.framework.model.OperateLogPdu; //import com.mortals.framework.model.OperateLogPdu;
import com.mortals.framework.service.IMessageProduceService; //import com.mortals.framework.service.IMessageProduceService;
import com.mortals.xhx.common.keys.QueueKey; //import com.mortals.xhx.common.keys.QueueKey;
import lombok.extern.slf4j.Slf4j; //import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate; //import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary; //import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component; //import org.springframework.stereotype.Component;
//
@Component ////@Component
@Primary //@Primary
@Slf4j //@Slf4j
public class MessageProducer implements IMessageProduceService { //public class MessageProducer implements IMessageProduceService {
//
@Autowired // @Autowired
private RabbitTemplate rabbitTemplate; // private RabbitTemplate rabbitTemplate;
//
public void syncAccessSend(AccessLogPdu accessLogPdu) { // public void syncAccessSend(AccessLogPdu accessLogPdu) {
//new Message(JSON.toJSONString(accessLogPdu).getBytes(StandardCharsets.UTF_8)) // //new Message(JSON.toJSONString(accessLogPdu).getBytes(StandardCharsets.UTF_8))
//rabbitTemplate.send(QueueKey.EXCHANGE, QueueKey.ACCESS_LOG_QUEUE,new Message(JSON.toJSONString(accessLogPdu).getBytes(StandardCharsets.UTF_8))); // //rabbitTemplate.send(QueueKey.EXCHANGE, QueueKey.ACCESS_LOG_QUEUE,new Message(JSON.toJSONString(accessLogPdu).getBytes(StandardCharsets.UTF_8)));
//
rabbitTemplate.convertAndSend(QueueKey.EXCHANGE, QueueKey.ACCESS_LOG_QUEUE, JSON.toJSONString(accessLogPdu)); // rabbitTemplate.convertAndSend(QueueKey.EXCHANGE, QueueKey.ACCESS_LOG_QUEUE, JSON.toJSONString(accessLogPdu));
//rabbitTemplate.convertAndSend(QueueKey.EXCHANGE, QueueKey.ACCESS_LOG_QUEUE, accessLogPdu); // //rabbitTemplate.convertAndSend(QueueKey.EXCHANGE, QueueKey.ACCESS_LOG_QUEUE, accessLogPdu);
} // }
//
@Override // @Override
public void syncBizSend(BizLogPdu bizLogPdu) { // public void syncBizSend(BizLogPdu bizLogPdu) {
rabbitTemplate.convertAndSend(QueueKey.EXCHANGE, QueueKey.BIZ_LOG_QUEUE, JSON.toJSONString(bizLogPdu)); // rabbitTemplate.convertAndSend(QueueKey.EXCHANGE, QueueKey.BIZ_LOG_QUEUE, JSON.toJSONString(bizLogPdu));
} // }
//
@Override // @Override
public void syncErrorSend(ErrorLogPdu errorLogPdu) { // public void syncErrorSend(ErrorLogPdu errorLogPdu) {
rabbitTemplate.convertAndSend(QueueKey.EXCHANGE, QueueKey.ERROR_LOG_QUEUE, JSON.toJSONString(errorLogPdu)); // rabbitTemplate.convertAndSend(QueueKey.EXCHANGE, QueueKey.ERROR_LOG_QUEUE, JSON.toJSONString(errorLogPdu));
} // }
//
@Override // @Override
public void syncOperSend(OperateLogPdu operLogPdu) { // public void syncOperSend(OperateLogPdu operLogPdu) {
rabbitTemplate.convertAndSend(QueueKey.EXCHANGE, QueueKey.OPERATION_LOG_QUEUE, JSON.toJSONString(operLogPdu)); // rabbitTemplate.convertAndSend(QueueKey.EXCHANGE, QueueKey.OPERATION_LOG_QUEUE, JSON.toJSONString(operLogPdu));
} // }
//
} //}
...@@ -9,6 +9,8 @@ import com.alibaba.fastjson.TypeReference; ...@@ -9,6 +9,8 @@ import com.alibaba.fastjson.TypeReference;
import com.mortals.framework.annotation.UnAuth; import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.service.ICacheService; import com.mortals.framework.service.ICacheService;
import com.mortals.xhx.busiz.req.ComplexImplementationReq; import com.mortals.xhx.busiz.req.ComplexImplementationReq;
import com.mortals.xhx.busiz.req.FindHandlingPageReq; import com.mortals.xhx.busiz.req.FindHandlingPageReq;
...@@ -32,6 +34,7 @@ import com.mortals.xhx.protocol.complex.matter.model.rsp.HandlingRspInfoList; ...@@ -32,6 +34,7 @@ import com.mortals.xhx.protocol.complex.matter.model.rsp.HandlingRspInfoList;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.axis.utils.StringUtils; import org.apache.axis.utils.StringUtils;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -39,7 +42,9 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -39,7 +42,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.io.File; import java.io.File;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.stream.Collector; import java.util.stream.Collector;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -65,6 +70,7 @@ public class ComplexApiController { ...@@ -65,6 +70,7 @@ public class ComplexApiController {
@Autowired @Autowired
private ApplyMatterService applyMatterService; private ApplyMatterService applyMatterService;
/** /**
* 事项列表查询 * 事项列表查询
* *
...@@ -76,33 +82,46 @@ public class ComplexApiController { ...@@ -76,33 +82,46 @@ public class ComplexApiController {
public String eventImplementationList(@RequestBody ComplexImplementationReq req) { public String eventImplementationList(@RequestBody ComplexImplementationReq req) {
log.info("【事项列表查询】【请求体】--> " + JSONObject.toJSONString(req)); log.info("【事项列表查询】【请求体】--> " + JSONObject.toJSONString(req));
req.setUrlPath("eventImplementation/list"); req.setUrlPath("eventImplementation/list");
ApiResp<String> rsp = new ApiResp<>(); ApiResp<Object> rsp = new ApiResp<>();
rsp.setMsg(ApiRespCodeEnum.SUCCESS.getLabel()); rsp.setMsg(ApiRespCodeEnum.SUCCESS.getLabel());
rsp.setCode(ApiRespCodeEnum.SUCCESS.getValue()); rsp.setCode(ApiRespCodeEnum.SUCCESS.getValue());
try { try {
req.setNonce(RandomUtil.randomNumbers(6)); PageInfo pageInfo = new PageInfo(req.getPageSize());
cacheService.lpush(KEY_COMPLEX_REQ, JSONObject.toJSONString(req)); pageInfo.setCurrPage(req.getCurrentPage());
String rest = cacheService.blpop(KEY_EVENT_IMPLEMENTATION_RESP + req.getNonce(), HTTP_TIMEOUT, String.class); ApplyMatterEntity query = new ApplyMatterEntity();
if (ObjectUtil.isEmpty(rest)) { BeanUtils.copyProperties(req, query);
throw new AppException("请求访问超时");
} Result<ApplyMatterEntity> result = applyMatterService.find(query,pageInfo,null);
Rest<ImplementEventInfo> eventListRest = JSON.parseObject(rest, new TypeReference<Rest<ImplementEventInfo>>() { Map<String, Object> model = new HashMap();
}); model.put("records",result.getList());
if(eventListRest.getCode()==1){ model.put("current",result.getPageInfo().getCurrPage());
Integer applyType = req.getApplyType()==null?1:req.getApplyType(); model.put("pages",result.getPageInfo().getTotalPage());
List<ApplyMatterEntity> entityList = applyMatterService.find(new ApplyMatterQuery().applyType(applyType)); model.put("size",result.getPageInfo().getPrePageResult());
if(CollectionUtils.isNotEmpty(entityList)) { model.put("total",result.getPageInfo().getTotalResult());
Set<String> matter = entityList.stream().map(t -> t.getEventId()).collect(Collectors.toSet()); rsp.setData(model);
for (RecordsItem item : eventListRest.getData().getRecords()) { // req.setNonce(RandomUtil.randomNumbers(6));
if(matter.contains(item.getEventId())){ // cacheService.lpush(KEY_COMPLEX_REQ, JSONObject.toJSONString(req));
item.setEnableFlag(1); // String rest = cacheService.blpop(KEY_EVENT_IMPLEMENTATION_RESP + req.getNonce(), HTTP_TIMEOUT, String.class);
}else { // if (ObjectUtil.isEmpty(rest)) {
item.setEnableFlag(0); // throw new AppException("请求访问超时");
} // }
} // Rest<ImplementEventInfo> eventListRest = JSON.parseObject(rest, new TypeReference<Rest<ImplementEventInfo>>() {
} // });
} // if(eventListRest.getCode()==1){
return JSON.toJSONString(eventListRest); // Integer applyType = req.getApplyType()==null?1:req.getApplyType();
// List<ApplyMatterEntity> entityList = applyMatterService.find(new ApplyMatterQuery().applyType(applyType));
// if(CollectionUtils.isNotEmpty(entityList)) {
// Set<String> matter = entityList.stream().map(t -> t.getEventId()).collect(Collectors.toSet());
// for (RecordsItem item : eventListRest.getData().getRecords()) {
// if(matter.contains(item.getEventId())){
// item.setEnableFlag(1);
// }else {
// item.setEnableFlag(0);
// }
// }
// }
// }
return JSON.toJSONString(rsp);
} catch (Exception e) { } catch (Exception e) {
log.error("接收数据失败", e); log.error("接收数据失败", e);
rsp.setCode(ApiRespCodeEnum.FAILED.getValue()); rsp.setCode(ApiRespCodeEnum.FAILED.getValue());
......
...@@ -10,11 +10,11 @@ import com.mortals.framework.model.BaseEntityLong; ...@@ -10,11 +10,11 @@ import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.matter.model.vo.ApplyMatterVo; import com.mortals.xhx.module.matter.model.vo.ApplyMatterVo;
import lombok.Data; import lombok.Data;
/** /**
* 申报事项列表实体对象 * 申报事项列表实体对象
* *
* @author zxfei * @author zxfei
* @date 2024-06-20 * @date 2024-07-01
*/ */
@Data @Data
public class ApplyMatterEntity extends ApplyMatterVo { public class ApplyMatterEntity extends ApplyMatterVo {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -47,6 +47,18 @@ public class ApplyMatterEntity extends ApplyMatterVo { ...@@ -47,6 +47,18 @@ public class ApplyMatterEntity extends ApplyMatterVo {
* 事项面向对象分类 * 事项面向对象分类
*/ */
private String eventObjectType; private String eventObjectType;
/**
* 是否纳入通办
*/
private String crossFlag;
/**
* 委托部门
*/
private Integer deptId;
/**
* 委托部门
*/
private String deptName;
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getId().hashCode();
...@@ -71,5 +83,8 @@ public class ApplyMatterEntity extends ApplyMatterVo { ...@@ -71,5 +83,8 @@ public class ApplyMatterEntity extends ApplyMatterVo {
this.handlingItemCode = ""; this.handlingItemCode = "";
this.implementName = ""; this.implementName = "";
this.eventObjectType = ""; this.eventObjectType = "";
this.crossFlag = "";
this.deptId = null;
this.deptName = "";
} }
} }
\ No newline at end of file
...@@ -3,11 +3,11 @@ package com.mortals.xhx.module.matter.model; ...@@ -3,11 +3,11 @@ package com.mortals.xhx.module.matter.model;
import java.util.List; import java.util.List;
import com.mortals.xhx.module.matter.model.ApplyMatterEntity; import com.mortals.xhx.module.matter.model.ApplyMatterEntity;
/** /**
* 申报事项列表查询对象 * 申报事项列表查询对象
* *
* @author zxfei * @author zxfei
* @date 2024-06-20 * @date 2024-07-01
*/ */
public class ApplyMatterQuery extends ApplyMatterEntity { public class ApplyMatterQuery extends ApplyMatterEntity {
/** 开始 序号,主键,自增长 */ /** 开始 序号,主键,自增长 */
private Long idStart; private Long idStart;
...@@ -111,6 +111,31 @@ public class ApplyMatterQuery extends ApplyMatterEntity { ...@@ -111,6 +111,31 @@ public class ApplyMatterQuery extends ApplyMatterEntity {
/** 结束 更新时间 */ /** 结束 更新时间 */
private String updateTimeEnd; private String updateTimeEnd;
/** 是否纳入通办 */
private List<String> crossFlagList;
/** 是否纳入通办排除列表 */
private List <String> crossFlagNotList;
/** 开始 委托部门 */
private Integer deptIdStart;
/** 结束 委托部门 */
private Integer deptIdEnd;
/** 增加 委托部门 */
private Integer deptIdIncrement;
/** 委托部门列表 */
private List <Integer> deptIdList;
/** 委托部门排除列表 */
private List <Integer> deptIdNotList;
/** 委托部门 */
private List<String> deptNameList;
/** 委托部门排除列表 */
private List <String> deptNameNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */ /** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<ApplyMatterQuery> orConditionList; private List<ApplyMatterQuery> orConditionList;
...@@ -699,6 +724,151 @@ public class ApplyMatterQuery extends ApplyMatterEntity { ...@@ -699,6 +724,151 @@ public class ApplyMatterQuery extends ApplyMatterEntity {
this.updateTimeEnd = updateTimeEnd; this.updateTimeEnd = updateTimeEnd;
} }
/**
* 获取 是否纳入通办
* @return crossFlagList
*/
public List<String> getCrossFlagList(){
return this.crossFlagList;
}
/**
* 设置 是否纳入通办
* @param crossFlagList
*/
public void setCrossFlagList(List<String> crossFlagList){
this.crossFlagList = crossFlagList;
}
/**
* 获取 是否纳入通办
* @return crossFlagNotList
*/
public List<String> getCrossFlagNotList(){
return this.crossFlagNotList;
}
/**
* 设置 是否纳入通办
* @param crossFlagNotList
*/
public void setCrossFlagNotList(List<String> crossFlagNotList){
this.crossFlagNotList = crossFlagNotList;
}
/**
* 获取 开始 委托部门
* @return deptIdStart
*/
public Integer getDeptIdStart(){
return this.deptIdStart;
}
/**
* 设置 开始 委托部门
* @param deptIdStart
*/
public void setDeptIdStart(Integer deptIdStart){
this.deptIdStart = deptIdStart;
}
/**
* 获取 结束 委托部门
* @return $deptIdEnd
*/
public Integer getDeptIdEnd(){
return this.deptIdEnd;
}
/**
* 设置 结束 委托部门
* @param deptIdEnd
*/
public void setDeptIdEnd(Integer deptIdEnd){
this.deptIdEnd = deptIdEnd;
}
/**
* 获取 增加 委托部门
* @return deptIdIncrement
*/
public Integer getDeptIdIncrement(){
return this.deptIdIncrement;
}
/**
* 设置 增加 委托部门
* @param deptIdIncrement
*/
public void setDeptIdIncrement(Integer deptIdIncrement){
this.deptIdIncrement = deptIdIncrement;
}
/**
* 获取 委托部门
* @return deptIdList
*/
public List<Integer> getDeptIdList(){
return this.deptIdList;
}
/**
* 设置 委托部门
* @param deptIdList
*/
public void setDeptIdList(List<Integer> deptIdList){
this.deptIdList = deptIdList;
}
/**
* 获取 委托部门
* @return deptIdNotList
*/
public List<Integer> getDeptIdNotList(){
return this.deptIdNotList;
}
/**
* 设置 委托部门
* @param deptIdNotList
*/
public void setDeptIdNotList(List<Integer> deptIdNotList){
this.deptIdNotList = deptIdNotList;
}
/**
* 获取 委托部门
* @return deptNameList
*/
public List<String> getDeptNameList(){
return this.deptNameList;
}
/**
* 设置 委托部门
* @param deptNameList
*/
public void setDeptNameList(List<String> deptNameList){
this.deptNameList = deptNameList;
}
/**
* 获取 委托部门
* @return deptNameNotList
*/
public List<String> getDeptNameNotList(){
return this.deptNameNotList;
}
/**
* 设置 委托部门
* @param deptNameNotList
*/
public void setDeptNameNotList(List<String> deptNameNotList){
this.deptNameNotList = deptNameNotList;
}
/** /**
* 设置 序号,主键,自增长 * 设置 序号,主键,自增长
* @param id * @param id
...@@ -1031,6 +1201,98 @@ public class ApplyMatterQuery extends ApplyMatterEntity { ...@@ -1031,6 +1201,98 @@ public class ApplyMatterQuery extends ApplyMatterEntity {
} }
/**
* 设置 是否纳入通办
* @param crossFlag
*/
public ApplyMatterQuery crossFlag(String crossFlag){
setCrossFlag(crossFlag);
return this;
}
/**
* 设置 是否纳入通办
* @param crossFlagList
*/
public ApplyMatterQuery crossFlagList(List<String> crossFlagList){
this.crossFlagList = crossFlagList;
return this;
}
/**
* 设置 委托部门
* @param deptId
*/
public ApplyMatterQuery deptId(Integer deptId){
setDeptId(deptId);
return this;
}
/**
* 设置 开始 委托部门
* @param deptIdStart
*/
public ApplyMatterQuery deptIdStart(Integer deptIdStart){
this.deptIdStart = deptIdStart;
return this;
}
/**
* 设置 结束 委托部门
* @param deptIdEnd
*/
public ApplyMatterQuery deptIdEnd(Integer deptIdEnd){
this.deptIdEnd = deptIdEnd;
return this;
}
/**
* 设置 增加 委托部门
* @param deptIdIncrement
*/
public ApplyMatterQuery deptIdIncrement(Integer deptIdIncrement){
this.deptIdIncrement = deptIdIncrement;
return this;
}
/**
* 设置 委托部门
* @param deptIdList
*/
public ApplyMatterQuery deptIdList(List<Integer> deptIdList){
this.deptIdList = deptIdList;
return this;
}
/**
* 设置 委托部门
* @param deptIdNotList
*/
public ApplyMatterQuery deptIdNotList(List<Integer> deptIdNotList){
this.deptIdNotList = deptIdNotList;
return this;
}
/**
* 设置 委托部门
* @param deptName
*/
public ApplyMatterQuery deptName(String deptName){
setDeptName(deptName);
return this;
}
/**
* 设置 委托部门
* @param deptNameList
*/
public ApplyMatterQuery deptNameList(List<String> deptNameList){
this.deptNameList = deptNameList;
return this;
}
/** /**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) * 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList * @return orConditionList
......
...@@ -10,11 +10,11 @@ import com.mortals.framework.model.BaseEntityLong; ...@@ -10,11 +10,11 @@ import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.matter.model.vo.EventImplementationVo; import com.mortals.xhx.module.matter.model.vo.EventImplementationVo;
import lombok.Data; import lombok.Data;
/** /**
* 综窗事项列表实体对象 * 综窗事项列表实体对象
* *
* @author zxfei * @author zxfei
* @date 2024-06-20 * @date 2024-07-01
*/ */
@Data @Data
public class EventImplementationEntity extends EventImplementationVo { public class EventImplementationEntity extends EventImplementationVo {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -43,6 +43,18 @@ public class EventImplementationEntity extends EventImplementationVo { ...@@ -43,6 +43,18 @@ public class EventImplementationEntity extends EventImplementationVo {
* 事项面向对象分类 * 事项面向对象分类
*/ */
private String eventObjectType; private String eventObjectType;
/**
* 是否纳入通办
*/
private String crossFlag;
/**
* 委托部门
*/
private Integer deptId;
/**
* 委托部门
*/
private String deptName;
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getId().hashCode();
...@@ -66,5 +78,8 @@ public class EventImplementationEntity extends EventImplementationVo { ...@@ -66,5 +78,8 @@ public class EventImplementationEntity extends EventImplementationVo {
this.handlingItemCode = ""; this.handlingItemCode = "";
this.implementName = ""; this.implementName = "";
this.eventObjectType = ""; this.eventObjectType = "";
this.crossFlag = "";
this.deptId = null;
this.deptName = "";
} }
} }
\ No newline at end of file
...@@ -3,11 +3,11 @@ package com.mortals.xhx.module.matter.model; ...@@ -3,11 +3,11 @@ package com.mortals.xhx.module.matter.model;
import java.util.List; import java.util.List;
import com.mortals.xhx.module.matter.model.EventImplementationEntity; import com.mortals.xhx.module.matter.model.EventImplementationEntity;
/** /**
* 综窗事项列表查询对象 * 综窗事项列表查询对象
* *
* @author zxfei * @author zxfei
* @date 2024-06-20 * @date 2024-07-01
*/ */
public class EventImplementationQuery extends EventImplementationEntity { public class EventImplementationQuery extends EventImplementationEntity {
/** 开始 序号,主键,自增长 */ /** 开始 序号,主键,自增长 */
private Long idStart; private Long idStart;
...@@ -96,6 +96,31 @@ public class EventImplementationQuery extends EventImplementationEntity { ...@@ -96,6 +96,31 @@ public class EventImplementationQuery extends EventImplementationEntity {
/** 结束 更新时间 */ /** 结束 更新时间 */
private String updateTimeEnd; private String updateTimeEnd;
/** 是否纳入通办 */
private List<String> crossFlagList;
/** 是否纳入通办排除列表 */
private List <String> crossFlagNotList;
/** 开始 委托部门 */
private Integer deptIdStart;
/** 结束 委托部门 */
private Integer deptIdEnd;
/** 增加 委托部门 */
private Integer deptIdIncrement;
/** 委托部门列表 */
private List <Integer> deptIdList;
/** 委托部门排除列表 */
private List <Integer> deptIdNotList;
/** 委托部门 */
private List<String> deptNameList;
/** 委托部门排除列表 */
private List <String> deptNameNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */ /** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<EventImplementationQuery> orConditionList; private List<EventImplementationQuery> orConditionList;
...@@ -603,6 +628,151 @@ public class EventImplementationQuery extends EventImplementationEntity { ...@@ -603,6 +628,151 @@ public class EventImplementationQuery extends EventImplementationEntity {
this.updateTimeEnd = updateTimeEnd; this.updateTimeEnd = updateTimeEnd;
} }
/**
* 获取 是否纳入通办
* @return crossFlagList
*/
public List<String> getCrossFlagList(){
return this.crossFlagList;
}
/**
* 设置 是否纳入通办
* @param crossFlagList
*/
public void setCrossFlagList(List<String> crossFlagList){
this.crossFlagList = crossFlagList;
}
/**
* 获取 是否纳入通办
* @return crossFlagNotList
*/
public List<String> getCrossFlagNotList(){
return this.crossFlagNotList;
}
/**
* 设置 是否纳入通办
* @param crossFlagNotList
*/
public void setCrossFlagNotList(List<String> crossFlagNotList){
this.crossFlagNotList = crossFlagNotList;
}
/**
* 获取 开始 委托部门
* @return deptIdStart
*/
public Integer getDeptIdStart(){
return this.deptIdStart;
}
/**
* 设置 开始 委托部门
* @param deptIdStart
*/
public void setDeptIdStart(Integer deptIdStart){
this.deptIdStart = deptIdStart;
}
/**
* 获取 结束 委托部门
* @return $deptIdEnd
*/
public Integer getDeptIdEnd(){
return this.deptIdEnd;
}
/**
* 设置 结束 委托部门
* @param deptIdEnd
*/
public void setDeptIdEnd(Integer deptIdEnd){
this.deptIdEnd = deptIdEnd;
}
/**
* 获取 增加 委托部门
* @return deptIdIncrement
*/
public Integer getDeptIdIncrement(){
return this.deptIdIncrement;
}
/**
* 设置 增加 委托部门
* @param deptIdIncrement
*/
public void setDeptIdIncrement(Integer deptIdIncrement){
this.deptIdIncrement = deptIdIncrement;
}
/**
* 获取 委托部门
* @return deptIdList
*/
public List<Integer> getDeptIdList(){
return this.deptIdList;
}
/**
* 设置 委托部门
* @param deptIdList
*/
public void setDeptIdList(List<Integer> deptIdList){
this.deptIdList = deptIdList;
}
/**
* 获取 委托部门
* @return deptIdNotList
*/
public List<Integer> getDeptIdNotList(){
return this.deptIdNotList;
}
/**
* 设置 委托部门
* @param deptIdNotList
*/
public void setDeptIdNotList(List<Integer> deptIdNotList){
this.deptIdNotList = deptIdNotList;
}
/**
* 获取 委托部门
* @return deptNameList
*/
public List<String> getDeptNameList(){
return this.deptNameList;
}
/**
* 设置 委托部门
* @param deptNameList
*/
public void setDeptNameList(List<String> deptNameList){
this.deptNameList = deptNameList;
}
/**
* 获取 委托部门
* @return deptNameNotList
*/
public List<String> getDeptNameNotList(){
return this.deptNameNotList;
}
/**
* 设置 委托部门
* @param deptNameNotList
*/
public void setDeptNameNotList(List<String> deptNameNotList){
this.deptNameNotList = deptNameNotList;
}
/** /**
* 设置 序号,主键,自增长 * 设置 序号,主键,自增长
* @param id * @param id
...@@ -881,6 +1051,98 @@ public class EventImplementationQuery extends EventImplementationEntity { ...@@ -881,6 +1051,98 @@ public class EventImplementationQuery extends EventImplementationEntity {
} }
/**
* 设置 是否纳入通办
* @param crossFlag
*/
public EventImplementationQuery crossFlag(String crossFlag){
setCrossFlag(crossFlag);
return this;
}
/**
* 设置 是否纳入通办
* @param crossFlagList
*/
public EventImplementationQuery crossFlagList(List<String> crossFlagList){
this.crossFlagList = crossFlagList;
return this;
}
/**
* 设置 委托部门
* @param deptId
*/
public EventImplementationQuery deptId(Integer deptId){
setDeptId(deptId);
return this;
}
/**
* 设置 开始 委托部门
* @param deptIdStart
*/
public EventImplementationQuery deptIdStart(Integer deptIdStart){
this.deptIdStart = deptIdStart;
return this;
}
/**
* 设置 结束 委托部门
* @param deptIdEnd
*/
public EventImplementationQuery deptIdEnd(Integer deptIdEnd){
this.deptIdEnd = deptIdEnd;
return this;
}
/**
* 设置 增加 委托部门
* @param deptIdIncrement
*/
public EventImplementationQuery deptIdIncrement(Integer deptIdIncrement){
this.deptIdIncrement = deptIdIncrement;
return this;
}
/**
* 设置 委托部门
* @param deptIdList
*/
public EventImplementationQuery deptIdList(List<Integer> deptIdList){
this.deptIdList = deptIdList;
return this;
}
/**
* 设置 委托部门
* @param deptIdNotList
*/
public EventImplementationQuery deptIdNotList(List<Integer> deptIdNotList){
this.deptIdNotList = deptIdNotList;
return this;
}
/**
* 设置 委托部门
* @param deptName
*/
public EventImplementationQuery deptName(String deptName){
setDeptName(deptName);
return this;
}
/**
* 设置 委托部门
* @param deptNameList
*/
public EventImplementationQuery deptNameList(List<String> deptNameList){
this.deptNameList = deptNameList;
return this;
}
/** /**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) * 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList * @return orConditionList
......
...@@ -20,6 +20,7 @@ import com.mortals.xhx.module.matter.model.ApplyMatterEntity; ...@@ -20,6 +20,7 @@ import com.mortals.xhx.module.matter.model.ApplyMatterEntity;
import com.mortals.xhx.module.matter.model.EventImplementationQuery; import com.mortals.xhx.module.matter.model.EventImplementationQuery;
import com.mortals.xhx.module.matter.service.ApplyMatterService; import com.mortals.xhx.module.matter.service.ApplyMatterService;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
...@@ -169,12 +170,16 @@ public class EventImplementationServiceImpl extends AbstractCRUDServiceImpl<Even ...@@ -169,12 +170,16 @@ public class EventImplementationServiceImpl extends AbstractCRUDServiceImpl<Even
for (EventImplementationEntity item:list){ for (EventImplementationEntity item:list){
ApplyMatterEntity applyMatterEntity = new ApplyMatterEntity(); ApplyMatterEntity applyMatterEntity = new ApplyMatterEntity();
applyMatterEntity.initAttrValue(); applyMatterEntity.initAttrValue();
applyMatterEntity.setEventId(item.getEventId()); BeanUtils.copyProperties(item, applyMatterEntity);
applyMatterEntity.setEventObjectType(item.getEventObjectType()); // applyMatterEntity.setEventId(item.getEventId());
applyMatterEntity.setEventType(item.getEventType()); // applyMatterEntity.setEventObjectType(item.getEventObjectType());
applyMatterEntity.setHandlingItemCode(item.getHandlingItemCode()); // applyMatterEntity.setEventType(item.getEventType());
applyMatterEntity.setImplementName(item.getImplementName()); // applyMatterEntity.setHandlingItemCode(item.getHandlingItemCode());
applyMatterEntity.setImplementCoding(item.getImplementCoding()); // applyMatterEntity.setImplementName(item.getImplementName());
// applyMatterEntity.setImplementCoding(item.getImplementCoding());
// applyMatterEntity.setCrossFlag(item.getCrossFlag());
// applyMatterEntity.setDeptId(item.getDeptId());
// applyMatterEntity.setDeptName(item.getDeptName());
applyMatterEntity.setApplyType(entity.getApplyType()); applyMatterEntity.setApplyType(entity.getApplyType());
applyMatterEntity.setCreateTime(new Date()); applyMatterEntity.setCreateTime(new Date());
applyMatterEntity.setCreateUserId(userId); applyMatterEntity.setCreateUserId(userId);
...@@ -194,12 +199,16 @@ public class EventImplementationServiceImpl extends AbstractCRUDServiceImpl<Even ...@@ -194,12 +199,16 @@ public class EventImplementationServiceImpl extends AbstractCRUDServiceImpl<Even
for (RecordsItem item:records){ for (RecordsItem item:records){
EventImplementationEntity entity = new EventImplementationEntity(); EventImplementationEntity entity = new EventImplementationEntity();
entity.initAttrValue(); entity.initAttrValue();
entity.setEventId(item.getEventId()); BeanUtils.copyProperties(item, entity);
entity.setEventObjectType(item.getEventObjectType()); // entity.setEventId(item.getEventId());
entity.setEventType(item.getEventType()); // entity.setEventObjectType(item.getEventObjectType());
entity.setHandlingItemCode(item.getHandlingItemCode()); // entity.setEventType(item.getEventType());
entity.setImplementName(item.getImplementName()); // entity.setHandlingItemCode(item.getHandlingItemCode());
entity.setImplementCoding(item.getImplementCoding()); // entity.setImplementName(item.getImplementName());
// entity.setImplementCoding(item.getImplementCoding());
// entity.setCrossFlag(item.getCrossFlag());
// entity.setDeptId(item.getDeptId());
// entity.setDeptName(item.getDeptName());
list.add(entity); list.add(entity);
} }
} }
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd"> "mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.matter.dao.ibatis.ApplyMatterDaoImpl"> <mapper namespace="com.mortals.xhx.module.matter.dao.ibatis.ApplyMatterDaoImpl">
<!-- 字段和属性映射 --> <!-- 字段和属性映射 -->
...@@ -17,6 +17,9 @@ ...@@ -17,6 +17,9 @@
<result property="createTime" column="createTime" /> <result property="createTime" column="createTime" />
<result property="updateUserId" column="updateUserId" /> <result property="updateUserId" column="updateUserId" />
<result property="updateTime" column="updateTime" /> <result property="updateTime" column="updateTime" />
<result property="crossFlag" column="crossFlag" />
<result property="deptId" column="deptId" />
<result property="deptName" column="deptName" />
</resultMap> </resultMap>
...@@ -60,23 +63,32 @@ ...@@ -60,23 +63,32 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))">
a.updateTime, a.updateTime,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('crossFlag') or colPickMode == 1 and data.containsKey('crossFlag')))">
a.crossFlag,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deptId') or colPickMode == 1 and data.containsKey('deptId')))">
a.deptId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deptName') or colPickMode == 1 and data.containsKey('deptName')))">
a.deptName,
</if>
</trim> </trim>
</sql> </sql>
<!-- 新增 区分主键自增加还是业务插入 --> <!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="ApplyMatterEntity" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="ApplyMatterEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_apply_matter insert into mortals_xhx_apply_matter
(applyType,eventId,eventType,implementCoding,handlingItemCode,implementName,eventObjectType,createUserId,createTime,updateUserId,updateTime) (applyType,eventId,eventType,implementCoding,handlingItemCode,implementName,eventObjectType,createUserId,createTime,updateUserId,updateTime,crossFlag,deptId,deptName)
VALUES VALUES
(#{applyType},#{eventId},#{eventType},#{implementCoding},#{handlingItemCode},#{implementName},#{eventObjectType},#{createUserId},#{createTime},#{updateUserId},#{updateTime}) (#{applyType},#{eventId},#{eventType},#{implementCoding},#{handlingItemCode},#{implementName},#{eventObjectType},#{createUserId},#{createTime},#{updateUserId},#{updateTime},#{crossFlag},#{deptId},#{deptName})
</insert> </insert>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto"> <insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_apply_matter insert into mortals_xhx_apply_matter
(applyType,eventId,eventType,implementCoding,handlingItemCode,implementName,eventObjectType,createUserId,createTime,updateUserId,updateTime) (applyType,eventId,eventType,implementCoding,handlingItemCode,implementName,eventObjectType,createUserId,createTime,updateUserId,updateTime,crossFlag,deptId,deptName)
VALUES VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," > <foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.applyType},#{item.eventId},#{item.eventType},#{item.implementCoding},#{item.handlingItemCode},#{item.implementName},#{item.eventObjectType},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime}) (#{item.applyType},#{item.eventId},#{item.eventType},#{item.implementCoding},#{item.handlingItemCode},#{item.implementName},#{item.eventObjectType},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime},#{item.crossFlag},#{item.deptId},#{item.deptName})
</foreach> </foreach>
</insert> </insert>
...@@ -128,6 +140,18 @@ ...@@ -128,6 +140,18 @@
<if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))"> <if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))">
a.updateTime=#{data.updateTime}, a.updateTime=#{data.updateTime},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('crossFlag')) or (colPickMode==1 and !data.containsKey('crossFlag'))">
a.crossFlag=#{data.crossFlag},
</if>
<if test="(colPickMode==0 and data.containsKey('deptId')) or (colPickMode==1 and !data.containsKey('deptId'))">
a.deptId=#{data.deptId},
</if>
<if test="(colPickMode==0 and data.containsKey('deptIdIncrement')) or (colPickMode==1 and !data.containsKey('deptIdIncrement'))">
a.deptId=ifnull(a.deptId,0) + #{data.deptIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('deptName')) or (colPickMode==1 and !data.containsKey('deptName'))">
a.deptName=#{data.deptName},
</if>
</trim> </trim>
<trim suffixOverrides="where" suffix=""> <trim suffixOverrides="where" suffix="">
where where
...@@ -232,6 +256,32 @@ ...@@ -232,6 +256,32 @@
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="crossFlag=(case" suffix="ELSE crossFlag end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('crossFlag')) or (colPickMode==1 and !item.containsKey('crossFlag'))">
when a.id=#{item.id} then #{item.crossFlag}
</if>
</foreach>
</trim>
<trim prefix="deptId=(case" suffix="ELSE deptId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('deptId')) or (colPickMode==1 and !item.containsKey('deptId'))">
when a.id=#{item.id} then #{item.deptId}
</when>
<when test="(colPickMode==0 and item.containsKey('deptIdIncrement')) or (colPickMode==1 and !item.containsKey('deptIdIncrement'))">
when a.id=#{item.id} then ifnull(a.deptId,0) + #{item.deptIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="deptName=(case" suffix="ELSE deptName end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('deptName')) or (colPickMode==1 and !item.containsKey('deptName'))">
when a.id=#{item.id} then #{item.deptName}
</if>
</foreach>
</trim>
</trim> </trim>
where id in where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")"> <foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
...@@ -612,6 +662,75 @@ ...@@ -612,6 +662,75 @@
<if test="conditionParamRef.containsKey('updateTimeEnd') and conditionParamRef.updateTimeEnd != null and conditionParamRef.updateTimeEnd!=''"> <if test="conditionParamRef.containsKey('updateTimeEnd') and conditionParamRef.updateTimeEnd != null and conditionParamRef.updateTimeEnd!=''">
${_conditionType_} a.updateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') ${_conditionType_} a.updateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if> </if>
<if test="conditionParamRef.containsKey('crossFlag')">
<if test="conditionParamRef.crossFlag != null and conditionParamRef.crossFlag != ''">
${_conditionType_} a.crossFlag like #{${_conditionParam_}.crossFlag}
</if>
<if test="conditionParamRef.crossFlag == null">
${_conditionType_} a.crossFlag is null
</if>
</if>
<if test="conditionParamRef.containsKey('crossFlagList') and conditionParamRef.crossFlagList.size() > 0">
${_conditionType_} a.crossFlag in
<foreach collection="conditionParamRef.crossFlagList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('crossFlagNotList') and conditionParamRef.crossFlagNotList.size() > 0">
${_conditionType_} a.crossFlag not in
<foreach collection="conditionParamRef.crossFlagNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptId')">
<if test="conditionParamRef.deptId != null ">
${_conditionType_} a.deptId = #{${_conditionParam_}.deptId}
</if>
<if test="conditionParamRef.deptId == null">
${_conditionType_} a.deptId is null
</if>
</if>
<if test="conditionParamRef.containsKey('deptIdList') and conditionParamRef.deptIdList.size() > 0">
${_conditionType_} a.deptId in
<foreach collection="conditionParamRef.deptIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptIdNotList') and conditionParamRef.deptIdNotList.size() > 0">
${_conditionType_} a.deptId not in
<foreach collection="conditionParamRef.deptIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptIdStart') and conditionParamRef.deptIdStart != null">
${_conditionType_} a.deptId <![CDATA[ >= ]]> #{${_conditionParam_}.deptIdStart}
</if>
<if test="conditionParamRef.containsKey('deptIdEnd') and conditionParamRef.deptIdEnd != null">
${_conditionType_} a.deptId <![CDATA[ <= ]]> #{${_conditionParam_}.deptIdEnd}
</if>
<if test="conditionParamRef.containsKey('deptName')">
<if test="conditionParamRef.deptName != null and conditionParamRef.deptName != ''">
${_conditionType_} a.deptName like #{${_conditionParam_}.deptName}
</if>
<if test="conditionParamRef.deptName == null">
${_conditionType_} a.deptName is null
</if>
</if>
<if test="conditionParamRef.containsKey('deptNameList') and conditionParamRef.deptNameList.size() > 0">
${_conditionType_} a.deptName in
<foreach collection="conditionParamRef.deptNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptNameNotList') and conditionParamRef.deptNameNotList.size() > 0">
${_conditionType_} a.deptName not in
<foreach collection="conditionParamRef.deptNameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
</sql> </sql>
<sql id="_orderCols_"> <sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()"> <if test="orderColList != null and !orderColList.isEmpty()">
...@@ -644,6 +763,13 @@ ...@@ -644,6 +763,13 @@
</foreach> </foreach>
, ,
</if> </if>
<if test="conditionParamRef.containsKey('deptIdList') and conditionParamRef.deptIdList.size() > 0">
field(a.deptId,
<foreach collection="conditionParamRef.deptIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<trim suffixOverrides="," suffix=""> <trim suffixOverrides="," suffix="">
<foreach collection="orderColList" open="" close="" index="index" item="item" separator=","> <foreach collection="orderColList" open="" close="" index="index" item="item" separator=",">
a.${item.colName} ${item.sortKind} a.${item.colName} ${item.sortKind}
...@@ -680,6 +806,13 @@ ...@@ -680,6 +806,13 @@
</foreach> </foreach>
, ,
</if> </if>
<if test="conditionParamRef.containsKey('deptIdList') and conditionParamRef.deptIdList.size() > 0">
field(a.deptId,
<foreach collection="conditionParamRef.deptIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<trim suffixOverrides="," suffix=""> <trim suffixOverrides="," suffix="">
<if test="orderCol.containsKey('id')"> <if test="orderCol.containsKey('id')">
a.id a.id
...@@ -741,6 +874,21 @@ ...@@ -741,6 +874,21 @@
<if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if> <if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('crossFlag')">
a.crossFlag
<if test='orderCol.crossFlag != null and "DESC".equalsIgnoreCase(orderCol.crossFlag)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deptId')">
a.deptId
<if test='orderCol.deptId != null and "DESC".equalsIgnoreCase(orderCol.deptId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deptName')">
a.deptName
<if test='orderCol.deptName != null and "DESC".equalsIgnoreCase(orderCol.deptName)'>DESC</if>
,
</if>
</trim> </trim>
</if> </if>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd"> "mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.matter.dao.ibatis.EventImplementationDaoImpl"> <mapper namespace="com.mortals.xhx.module.matter.dao.ibatis.EventImplementationDaoImpl">
<!-- 字段和属性映射 --> <!-- 字段和属性映射 -->
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
<result property="createTime" column="createTime" /> <result property="createTime" column="createTime" />
<result property="updateUserId" column="updateUserId" /> <result property="updateUserId" column="updateUserId" />
<result property="updateTime" column="updateTime" /> <result property="updateTime" column="updateTime" />
<result property="crossFlag" column="crossFlag" />
<result property="deptId" column="deptId" />
<result property="deptName" column="deptName" />
</resultMap> </resultMap>
...@@ -56,23 +59,32 @@ ...@@ -56,23 +59,32 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))">
a.updateTime, a.updateTime,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('crossFlag') or colPickMode == 1 and data.containsKey('crossFlag')))">
a.crossFlag,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deptId') or colPickMode == 1 and data.containsKey('deptId')))">
a.deptId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deptName') or colPickMode == 1 and data.containsKey('deptName')))">
a.deptName,
</if>
</trim> </trim>
</sql> </sql>
<!-- 新增 区分主键自增加还是业务插入 --> <!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="EventImplementationEntity" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="EventImplementationEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_event_implementation insert into mortals_xhx_event_implementation
(eventId,eventType,implementCoding,handlingItemCode,implementName,eventObjectType,createUserId,createTime,updateUserId,updateTime) (eventId,eventType,implementCoding,handlingItemCode,implementName,eventObjectType,createUserId,createTime,updateUserId,updateTime,crossFlag,deptId,deptName)
VALUES VALUES
(#{eventId},#{eventType},#{implementCoding},#{handlingItemCode},#{implementName},#{eventObjectType},#{createUserId},#{createTime},#{updateUserId},#{updateTime}) (#{eventId},#{eventType},#{implementCoding},#{handlingItemCode},#{implementName},#{eventObjectType},#{createUserId},#{createTime},#{updateUserId},#{updateTime},#{crossFlag},#{deptId},#{deptName})
</insert> </insert>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto"> <insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_event_implementation insert into mortals_xhx_event_implementation
(eventId,eventType,implementCoding,handlingItemCode,implementName,eventObjectType,createUserId,createTime,updateUserId,updateTime) (eventId,eventType,implementCoding,handlingItemCode,implementName,eventObjectType,createUserId,createTime,updateUserId,updateTime,crossFlag,deptId,deptName)
VALUES VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," > <foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.eventId},#{item.eventType},#{item.implementCoding},#{item.handlingItemCode},#{item.implementName},#{item.eventObjectType},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime}) (#{item.eventId},#{item.eventType},#{item.implementCoding},#{item.handlingItemCode},#{item.implementName},#{item.eventObjectType},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime},#{item.crossFlag},#{item.deptId},#{item.deptName})
</foreach> </foreach>
</insert> </insert>
...@@ -118,6 +130,18 @@ ...@@ -118,6 +130,18 @@
<if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))"> <if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))">
a.updateTime=#{data.updateTime}, a.updateTime=#{data.updateTime},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('crossFlag')) or (colPickMode==1 and !data.containsKey('crossFlag'))">
a.crossFlag=#{data.crossFlag},
</if>
<if test="(colPickMode==0 and data.containsKey('deptId')) or (colPickMode==1 and !data.containsKey('deptId'))">
a.deptId=#{data.deptId},
</if>
<if test="(colPickMode==0 and data.containsKey('deptIdIncrement')) or (colPickMode==1 and !data.containsKey('deptIdIncrement'))">
a.deptId=ifnull(a.deptId,0) + #{data.deptIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('deptName')) or (colPickMode==1 and !data.containsKey('deptName'))">
a.deptName=#{data.deptName},
</if>
</trim> </trim>
<trim suffixOverrides="where" suffix=""> <trim suffixOverrides="where" suffix="">
where where
...@@ -210,6 +234,32 @@ ...@@ -210,6 +234,32 @@
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="crossFlag=(case" suffix="ELSE crossFlag end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('crossFlag')) or (colPickMode==1 and !item.containsKey('crossFlag'))">
when a.id=#{item.id} then #{item.crossFlag}
</if>
</foreach>
</trim>
<trim prefix="deptId=(case" suffix="ELSE deptId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('deptId')) or (colPickMode==1 and !item.containsKey('deptId'))">
when a.id=#{item.id} then #{item.deptId}
</when>
<when test="(colPickMode==0 and item.containsKey('deptIdIncrement')) or (colPickMode==1 and !item.containsKey('deptIdIncrement'))">
when a.id=#{item.id} then ifnull(a.deptId,0) + #{item.deptIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="deptName=(case" suffix="ELSE deptName end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('deptName')) or (colPickMode==1 and !item.containsKey('deptName'))">
when a.id=#{item.id} then #{item.deptName}
</if>
</foreach>
</trim>
</trim> </trim>
where id in where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")"> <foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
...@@ -563,6 +613,75 @@ ...@@ -563,6 +613,75 @@
<if test="conditionParamRef.containsKey('updateTimeEnd') and conditionParamRef.updateTimeEnd != null and conditionParamRef.updateTimeEnd!=''"> <if test="conditionParamRef.containsKey('updateTimeEnd') and conditionParamRef.updateTimeEnd != null and conditionParamRef.updateTimeEnd!=''">
${_conditionType_} a.updateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') ${_conditionType_} a.updateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if> </if>
<if test="conditionParamRef.containsKey('crossFlag')">
<if test="conditionParamRef.crossFlag != null and conditionParamRef.crossFlag != ''">
${_conditionType_} a.crossFlag like #{${_conditionParam_}.crossFlag}
</if>
<if test="conditionParamRef.crossFlag == null">
${_conditionType_} a.crossFlag is null
</if>
</if>
<if test="conditionParamRef.containsKey('crossFlagList') and conditionParamRef.crossFlagList.size() > 0">
${_conditionType_} a.crossFlag in
<foreach collection="conditionParamRef.crossFlagList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('crossFlagNotList') and conditionParamRef.crossFlagNotList.size() > 0">
${_conditionType_} a.crossFlag not in
<foreach collection="conditionParamRef.crossFlagNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptId')">
<if test="conditionParamRef.deptId != null ">
${_conditionType_} a.deptId = #{${_conditionParam_}.deptId}
</if>
<if test="conditionParamRef.deptId == null">
${_conditionType_} a.deptId is null
</if>
</if>
<if test="conditionParamRef.containsKey('deptIdList') and conditionParamRef.deptIdList.size() > 0">
${_conditionType_} a.deptId in
<foreach collection="conditionParamRef.deptIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptIdNotList') and conditionParamRef.deptIdNotList.size() > 0">
${_conditionType_} a.deptId not in
<foreach collection="conditionParamRef.deptIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptIdStart') and conditionParamRef.deptIdStart != null">
${_conditionType_} a.deptId <![CDATA[ >= ]]> #{${_conditionParam_}.deptIdStart}
</if>
<if test="conditionParamRef.containsKey('deptIdEnd') and conditionParamRef.deptIdEnd != null">
${_conditionType_} a.deptId <![CDATA[ <= ]]> #{${_conditionParam_}.deptIdEnd}
</if>
<if test="conditionParamRef.containsKey('deptName')">
<if test="conditionParamRef.deptName != null and conditionParamRef.deptName != ''">
${_conditionType_} a.deptName like #{${_conditionParam_}.deptName}
</if>
<if test="conditionParamRef.deptName == null">
${_conditionType_} a.deptName is null
</if>
</if>
<if test="conditionParamRef.containsKey('deptNameList') and conditionParamRef.deptNameList.size() > 0">
${_conditionType_} a.deptName in
<foreach collection="conditionParamRef.deptNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptNameNotList') and conditionParamRef.deptNameNotList.size() > 0">
${_conditionType_} a.deptName not in
<foreach collection="conditionParamRef.deptNameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
</sql> </sql>
<sql id="_orderCols_"> <sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()"> <if test="orderColList != null and !orderColList.isEmpty()">
...@@ -588,6 +707,13 @@ ...@@ -588,6 +707,13 @@
</foreach> </foreach>
, ,
</if> </if>
<if test="conditionParamRef.containsKey('deptIdList') and conditionParamRef.deptIdList.size() > 0">
field(a.deptId,
<foreach collection="conditionParamRef.deptIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<trim suffixOverrides="," suffix=""> <trim suffixOverrides="," suffix="">
<foreach collection="orderColList" open="" close="" index="index" item="item" separator=","> <foreach collection="orderColList" open="" close="" index="index" item="item" separator=",">
a.${item.colName} ${item.sortKind} a.${item.colName} ${item.sortKind}
...@@ -617,6 +743,13 @@ ...@@ -617,6 +743,13 @@
</foreach> </foreach>
, ,
</if> </if>
<if test="conditionParamRef.containsKey('deptIdList') and conditionParamRef.deptIdList.size() > 0">
field(a.deptId,
<foreach collection="conditionParamRef.deptIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<trim suffixOverrides="," suffix=""> <trim suffixOverrides="," suffix="">
<if test="orderCol.containsKey('id')"> <if test="orderCol.containsKey('id')">
a.id a.id
...@@ -673,6 +806,21 @@ ...@@ -673,6 +806,21 @@
<if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if> <if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('crossFlag')">
a.crossFlag
<if test='orderCol.crossFlag != null and "DESC".equalsIgnoreCase(orderCol.crossFlag)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deptId')">
a.deptId
<if test='orderCol.deptId != null and "DESC".equalsIgnoreCase(orderCol.deptId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deptName')">
a.deptName
<if test='orderCol.deptName != null and "DESC".equalsIgnoreCase(orderCol.deptName)'>DESC</if>
,
</if>
</trim> </trim>
</if> </if>
......
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