Commit 71685c65 authored by 廖旭伟's avatar 廖旭伟

bug修改

parent 4d6c29bb
...@@ -136,6 +136,14 @@ public class RetainLogEntity extends RetainLogVo { ...@@ -136,6 +136,14 @@ public class RetainLogEntity extends RetainLogVo {
* 专网ID * 专网ID
*/ */
private String privateID; private String privateID;
/**
* 申请ID
*/
private Long applyId;
/**
* 打印次数
*/
private Integer total;
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getId().hashCode();
...@@ -182,5 +190,7 @@ public class RetainLogEntity extends RetainLogVo { ...@@ -182,5 +190,7 @@ public class RetainLogEntity extends RetainLogVo {
this.holderType = 1; this.holderType = 1;
this.holderIdType = 1; this.holderIdType = 1;
this.privateID = ""; this.privateID = "";
this.applyId = null;
this.total = 1;
} }
} }
\ No newline at end of file
...@@ -275,6 +275,36 @@ public class RetainLogQuery extends RetainLogEntity { ...@@ -275,6 +275,36 @@ public class RetainLogQuery extends RetainLogEntity {
/** 专网ID排除列表 */ /** 专网ID排除列表 */
private List <String> privateIDNotList; private List <String> privateIDNotList;
/** 开始 申请ID */
private Long applyIdStart;
/** 结束 申请ID */
private Long applyIdEnd;
/** 增加 申请ID */
private Long applyIdIncrement;
/** 申请ID列表 */
private List <Long> applyIdList;
/** 申请ID排除列表 */
private List <Long> applyIdNotList;
/** 开始 打印次数 */
private Integer totalStart;
/** 结束 打印次数 */
private Integer totalEnd;
/** 增加 打印次数 */
private Integer totalIncrement;
/** 打印次数列表 */
private List <Integer> totalList;
/** 打印次数排除列表 */
private List <Integer> totalNotList;
/** 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<RetainLogQuery> orConditionList; private List<RetainLogQuery> orConditionList;
...@@ -1812,6 +1842,168 @@ public class RetainLogQuery extends RetainLogEntity { ...@@ -1812,6 +1842,168 @@ public class RetainLogQuery extends RetainLogEntity {
this.privateIDNotList = privateIDNotList; this.privateIDNotList = privateIDNotList;
} }
/**
* 获取 开始 申请ID
* @return applyIdStart
*/
public Long getApplyIdStart(){
return this.applyIdStart;
}
/**
* 设置 开始 申请ID
* @param applyIdStart
*/
public void setApplyIdStart(Long applyIdStart){
this.applyIdStart = applyIdStart;
}
/**
* 获取 结束 申请ID
* @return $applyIdEnd
*/
public Long getApplyIdEnd(){
return this.applyIdEnd;
}
/**
* 设置 结束 申请ID
* @param applyIdEnd
*/
public void setApplyIdEnd(Long applyIdEnd){
this.applyIdEnd = applyIdEnd;
}
/**
* 获取 增加 申请ID
* @return applyIdIncrement
*/
public Long getApplyIdIncrement(){
return this.applyIdIncrement;
}
/**
* 设置 增加 申请ID
* @param applyIdIncrement
*/
public void setApplyIdIncrement(Long applyIdIncrement){
this.applyIdIncrement = applyIdIncrement;
}
/**
* 获取 申请ID
* @return applyIdList
*/
public List<Long> getApplyIdList(){
return this.applyIdList;
}
/**
* 设置 申请ID
* @param applyIdList
*/
public void setApplyIdList(List<Long> applyIdList){
this.applyIdList = applyIdList;
}
/**
* 获取 申请ID
* @return applyIdNotList
*/
public List<Long> getApplyIdNotList(){
return this.applyIdNotList;
}
/**
* 设置 申请ID
* @param applyIdNotList
*/
public void setApplyIdNotList(List<Long> applyIdNotList){
this.applyIdNotList = applyIdNotList;
}
/**
* 获取 开始 打印次数
* @return totalStart
*/
public Integer getTotalStart(){
return this.totalStart;
}
/**
* 设置 开始 打印次数
* @param totalStart
*/
public void setTotalStart(Integer totalStart){
this.totalStart = totalStart;
}
/**
* 获取 结束 打印次数
* @return $totalEnd
*/
public Integer getTotalEnd(){
return this.totalEnd;
}
/**
* 设置 结束 打印次数
* @param totalEnd
*/
public void setTotalEnd(Integer totalEnd){
this.totalEnd = totalEnd;
}
/**
* 获取 增加 打印次数
* @return totalIncrement
*/
public Integer getTotalIncrement(){
return this.totalIncrement;
}
/**
* 设置 增加 打印次数
* @param totalIncrement
*/
public void setTotalIncrement(Integer totalIncrement){
this.totalIncrement = totalIncrement;
}
/**
* 获取 打印次数
* @return totalList
*/
public List<Integer> getTotalList(){
return this.totalList;
}
/**
* 设置 打印次数
* @param totalList
*/
public void setTotalList(List<Integer> totalList){
this.totalList = totalList;
}
/**
* 获取 打印次数
* @return totalNotList
*/
public List<Integer> getTotalNotList(){
return this.totalNotList;
}
/**
* 设置 打印次数
* @param totalNotList
*/
public void setTotalNotList(List<Integer> totalNotList){
this.totalNotList = totalNotList;
}
/** /**
* 设置 序号,主键,自增长 * 设置 序号,主键,自增长
* @param id * @param id
...@@ -2683,6 +2875,114 @@ public class RetainLogQuery extends RetainLogEntity { ...@@ -2683,6 +2875,114 @@ public class RetainLogQuery extends RetainLogEntity {
return this; return this;
} }
/**
* 设置 申请ID
* @param applyId
*/
public RetainLogQuery applyId(Long applyId){
setApplyId(applyId);
return this;
}
/**
* 设置 开始 申请ID
* @param applyIdStart
*/
public RetainLogQuery applyIdStart(Long applyIdStart){
this.applyIdStart = applyIdStart;
return this;
}
/**
* 设置 结束 申请ID
* @param applyIdEnd
*/
public RetainLogQuery applyIdEnd(Long applyIdEnd){
this.applyIdEnd = applyIdEnd;
return this;
}
/**
* 设置 增加 申请ID
* @param applyIdIncrement
*/
public RetainLogQuery applyIdIncrement(Long applyIdIncrement){
this.applyIdIncrement = applyIdIncrement;
return this;
}
/**
* 设置 申请ID
* @param applyIdList
*/
public RetainLogQuery applyIdList(List<Long> applyIdList){
this.applyIdList = applyIdList;
return this;
}
/**
* 设置 申请ID
* @param applyIdNotList
*/
public RetainLogQuery applyIdNotList(List<Long> applyIdNotList){
this.applyIdNotList = applyIdNotList;
return this;
}
/**
* 设置 打印次数
* @param total
*/
public RetainLogQuery total(Integer total){
setTotal(total);
return this;
}
/**
* 设置 开始 打印次数
* @param totalStart
*/
public RetainLogQuery totalStart(Integer totalStart){
this.totalStart = totalStart;
return this;
}
/**
* 设置 结束 打印次数
* @param totalEnd
*/
public RetainLogQuery totalEnd(Integer totalEnd){
this.totalEnd = totalEnd;
return this;
}
/**
* 设置 增加 打印次数
* @param totalIncrement
*/
public RetainLogQuery totalIncrement(Integer totalIncrement){
this.totalIncrement = totalIncrement;
return this;
}
/**
* 设置 打印次数
* @param totalList
*/
public RetainLogQuery totalList(List<Integer> totalList){
this.totalList = totalList;
return this;
}
/**
* 设置 打印次数
* @param totalNotList
*/
public RetainLogQuery totalNotList(List<Integer> totalNotList){
this.totalNotList = totalNotList;
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
......
...@@ -21,6 +21,7 @@ import com.mortals.xhx.module.record.dao.RetainLogDao; ...@@ -21,6 +21,7 @@ import com.mortals.xhx.module.record.dao.RetainLogDao;
import com.mortals.xhx.module.record.model.*; import com.mortals.xhx.module.record.model.*;
import com.mortals.xhx.module.record.service.ApplyLogService; import com.mortals.xhx.module.record.service.ApplyLogService;
import com.mortals.xhx.module.record.service.PrintWaitQueueService; import com.mortals.xhx.module.record.service.PrintWaitQueueService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -156,18 +157,10 @@ public class PrintWaitQueueServiceImpl extends AbstractCRUDServiceImpl<PrintWait ...@@ -156,18 +157,10 @@ public class PrintWaitQueueServiceImpl extends AbstractCRUDServiceImpl<PrintWait
} }
private void doPrintSuccess(PrintWaitQueueEntity waitQueueEntity){ private void doPrintSuccess(PrintWaitQueueEntity waitQueueEntity){
RetainLogEntity retainLogEntity = new RetainLogEntity();
ApplyLogEntity applyLogEntity = applyLogService.get(waitQueueEntity.getApplyId()); ApplyLogEntity applyLogEntity = applyLogService.get(waitQueueEntity.getApplyId());
Date now = new Date(); Date now = new Date();
BeanUtils.copyProperties(applyLogEntity, retainLogEntity, BeanUtil.getNullPropertyNames(applyLogEntity));
retainLogEntity.setId(null);
retainLogEntity.setUpdateUserId(null);
retainLogEntity.setUpdateTime(null);
retainLogEntity.setCertificateStatus(CertificateStatus.NORMAL.getValue());
retainLogEntity.setCreateUserId(waitQueueEntity.getCreateUserId());
retainLogEntity.setCreateTime(now);
PrintLogEntity printLogEntity = new PrintLogEntity(); PrintLogEntity printLogEntity = new PrintLogEntity();
BeanUtils.copyProperties(waitQueueEntity, printLogEntity, BeanUtil.getNullPropertyNames(waitQueueEntity)); BeanUtils.copyProperties(waitQueueEntity, printLogEntity, BeanUtil.getNullPropertyNames(waitQueueEntity));
...@@ -179,7 +172,28 @@ public class PrintWaitQueueServiceImpl extends AbstractCRUDServiceImpl<PrintWait ...@@ -179,7 +172,28 @@ public class PrintWaitQueueServiceImpl extends AbstractCRUDServiceImpl<PrintWait
printLogEntity.setCreateTime(now); printLogEntity.setCreateTime(now);
printLogEntity.setPrintStatus(PrintStatus.SUCCESS.getValue()); printLogEntity.setPrintStatus(PrintStatus.SUCCESS.getValue());
printLogEntity.setStatusRemark(PrintStatus.SUCCESS.getDesc()); printLogEntity.setStatusRemark(PrintStatus.SUCCESS.getDesc());
RetainLogEntity retainLogquery = new RetainLogEntity();
retainLogquery.setApplyId(waitQueueEntity.getApplyId());
List<RetainLogEntity> tempRetainLogList = retainLogDao.getList(retainLogquery);
if(CollectionUtils.isNotEmpty(tempRetainLogList)){
RetainLogQuery updateRetainLog = new RetainLogQuery();
updateRetainLog.setUpdateTime(now);
updateRetainLog.setId(tempRetainLogList.get(0).getId());
updateRetainLog.setTotalIncrement(1);
retainLogDao.update(updateRetainLog);
}else {
RetainLogEntity retainLogEntity = new RetainLogEntity();
BeanUtils.copyProperties(applyLogEntity, retainLogEntity, BeanUtil.getNullPropertyNames(applyLogEntity));
retainLogEntity.setId(null);
retainLogEntity.setUpdateUserId(null);
retainLogEntity.setUpdateTime(null);
retainLogEntity.setCertificateStatus(CertificateStatus.NORMAL.getValue());
retainLogEntity.setCreateUserId(waitQueueEntity.getCreateUserId());
retainLogEntity.setCreateTime(now);
retainLogDao.insert(retainLogEntity); retainLogDao.insert(retainLogEntity);
}
printLogDao.insert(printLogEntity); printLogDao.insert(printLogEntity);
CertificateCatalogEntity catalogEntity = certificateCatalogService.get(waitQueueEntity.getCatalogId()); CertificateCatalogEntity catalogEntity = certificateCatalogService.get(waitQueueEntity.getCatalogId());
CertificateClassifyQuery query = new CertificateClassifyQuery(); CertificateClassifyQuery query = new CertificateClassifyQuery();
...@@ -189,6 +203,9 @@ public class PrintWaitQueueServiceImpl extends AbstractCRUDServiceImpl<PrintWait ...@@ -189,6 +203,9 @@ public class PrintWaitQueueServiceImpl extends AbstractCRUDServiceImpl<PrintWait
certificateClassifyService.update(query); certificateClassifyService.update(query);
ApplyLogEntity updateApply = new ApplyLogEntity(); ApplyLogEntity updateApply = new ApplyLogEntity();
updateApply.setId(applyLogEntity.getId()); updateApply.setId(applyLogEntity.getId());
updateApply.setCertificateCode(applyLogEntity.getCertificateCode());
updateApply.setEnterpriseName(applyLogEntity.getEnterpriseName());
updateApply.setCatalogId(applyLogEntity.getCatalogId());
updateApply.setRecordStatus(YesNoEnum.YES.getValue()); updateApply.setRecordStatus(YesNoEnum.YES.getValue());
updateApply.setUpdateTime(new Date()); updateApply.setUpdateTime(new Date());
applyLogService.update(updateApply); applyLogService.update(updateApply);
......
...@@ -2,6 +2,8 @@ package com.mortals.xhx.module.record.web; ...@@ -2,6 +2,8 @@ package com.mortals.xhx.module.record.web;
import com.mortals.framework.common.IBaseEnum; import com.mortals.framework.common.IBaseEnum;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.base.system.user.model.UserQuery;
import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.common.code.CertificateStatus; import com.mortals.xhx.common.code.CertificateStatus;
import com.mortals.xhx.common.code.StatusEnum; import com.mortals.xhx.common.code.StatusEnum;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -25,6 +27,8 @@ import java.util.Arrays; ...@@ -25,6 +27,8 @@ import java.util.Arrays;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*; import static com.mortals.framework.ap.SysConstains.*;
import static java.util.stream.Collectors.toMap;
/** /**
* *
* 证照持有 * 证照持有
...@@ -38,6 +42,8 @@ public class RetainLogController extends BaseCRUDJsonBodyMappingController<Retai ...@@ -38,6 +42,8 @@ public class RetainLogController extends BaseCRUDJsonBodyMappingController<Retai
@Autowired @Autowired
private ParamService paramService; private ParamService paramService;
@Autowired
private UserService userService;
public RetainLogController(){ public RetainLogController(){
super.setModuleDesc( "证照持有"); super.setModuleDesc( "证照持有");
...@@ -47,6 +53,7 @@ public class RetainLogController extends BaseCRUDJsonBodyMappingController<Retai ...@@ -47,6 +53,7 @@ public class RetainLogController extends BaseCRUDJsonBodyMappingController<Retai
protected void init(Map<String, Object> model, Context context) { protected void init(Map<String, Object> model, Context context) {
this.addDict(model,"status", IBaseEnum.getEnumMap(StatusEnum.class)); this.addDict(model,"status", IBaseEnum.getEnumMap(StatusEnum.class));
this.addDict(model,"certificateStatus", IBaseEnum.getEnumMap(CertificateStatus.class)); this.addDict(model,"certificateStatus", IBaseEnum.getEnumMap(CertificateStatus.class));
this.addDict(model, "createUserId", userService.find(new UserQuery()).stream().collect(toMap(x -> x.getId().toString(), y -> y.getRealName(), (o, n) -> n)));
super.init(model, context); super.init(model, context);
} }
......
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
<result property="holderType" column="holderType" /> <result property="holderType" column="holderType" />
<result property="holderIdType" column="holderIdType" /> <result property="holderIdType" column="holderIdType" />
<result property="privateID" column="privateID" /> <result property="privateID" column="privateID" />
<result property="applyId" column="applyId" />
<result property="total" column="total" />
</resultMap> </resultMap>
<!-- 表所有列 --> <!-- 表所有列 -->
...@@ -146,23 +148,29 @@ ...@@ -146,23 +148,29 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('privateID') or colPickMode == 1 and data.containsKey('privateID')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('privateID') or colPickMode == 1 and data.containsKey('privateID')))">
a.privateID, a.privateID,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('applyId') or colPickMode == 1 and data.containsKey('applyId')))">
a.applyId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('total') or colPickMode == 1 and data.containsKey('total')))">
a.total,
</if>
</trim> </trim>
</sql> </sql>
<!-- 新增 区分主键自增加还是业务插入 --> <!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="RetainLogEntity" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="RetainLogEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_retain_log insert into mortals_xhx_retain_log
(siteId,recordId,catalogId,catalogCode,catalogName,certificateName,certificateCode,enterpriseName,legalPerson,socialCode,qRCode,holderName,holderIDCardNo,mobile,certificateStatus,certificateUrl,previewUrl,createUserId,createTime,updateUserId,updateTime,industryName,businessPlace,licenseProject,authority,issueTime,annexName,annexUrl,validityStart,validityEnd,holderType,holderIdType,privateID) (siteId,recordId,catalogId,catalogCode,catalogName,certificateName,certificateCode,enterpriseName,legalPerson,socialCode,qRCode,holderName,holderIDCardNo,mobile,certificateStatus,certificateUrl,previewUrl,createUserId,createTime,updateUserId,updateTime,industryName,businessPlace,licenseProject,authority,issueTime,annexName,annexUrl,validityStart,validityEnd,holderType,holderIdType,privateID,applyId,total)
VALUES VALUES
(#{siteId},#{recordId},#{catalogId},#{catalogCode},#{catalogName},#{certificateName},#{certificateCode},#{enterpriseName},#{legalPerson},#{socialCode},#{qRCode},#{holderName},#{holderIDCardNo},#{mobile},#{certificateStatus},#{certificateUrl},#{previewUrl},#{createUserId},#{createTime},#{updateUserId},#{updateTime},#{industryName},#{businessPlace},#{licenseProject},#{authority},#{issueTime},#{annexName},#{annexUrl},#{validityStart},#{validityEnd},#{holderType},#{holderIdType},#{privateID}) (#{siteId},#{recordId},#{catalogId},#{catalogCode},#{catalogName},#{certificateName},#{certificateCode},#{enterpriseName},#{legalPerson},#{socialCode},#{qRCode},#{holderName},#{holderIDCardNo},#{mobile},#{certificateStatus},#{certificateUrl},#{previewUrl},#{createUserId},#{createTime},#{updateUserId},#{updateTime},#{industryName},#{businessPlace},#{licenseProject},#{authority},#{issueTime},#{annexName},#{annexUrl},#{validityStart},#{validityEnd},#{holderType},#{holderIdType},#{privateID},#{applyId},#{total})
</insert> </insert>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto"> <insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_retain_log insert into mortals_xhx_retain_log
(siteId,recordId,catalogId,catalogCode,catalogName,certificateName,certificateCode,enterpriseName,legalPerson,socialCode,qRCode,holderName,holderIDCardNo,mobile,certificateStatus,certificateUrl,previewUrl,createUserId,createTime,updateUserId,updateTime,industryName,businessPlace,licenseProject,authority,issueTime,annexName,annexUrl,validityStart,validityEnd,holderType,holderIdType,privateID) (siteId,recordId,catalogId,catalogCode,catalogName,certificateName,certificateCode,enterpriseName,legalPerson,socialCode,qRCode,holderName,holderIDCardNo,mobile,certificateStatus,certificateUrl,previewUrl,createUserId,createTime,updateUserId,updateTime,industryName,businessPlace,licenseProject,authority,issueTime,annexName,annexUrl,validityStart,validityEnd,holderType,holderIdType,privateID,applyId,total)
VALUES VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," > <foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.siteId},#{item.recordId},#{item.catalogId},#{item.catalogCode},#{item.catalogName},#{item.certificateName},#{item.certificateCode},#{item.enterpriseName},#{item.legalPerson},#{item.socialCode},#{item.qRCode},#{item.holderName},#{item.holderIDCardNo},#{item.mobile},#{item.certificateStatus},#{item.certificateUrl},#{item.previewUrl},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime},#{item.industryName},#{item.businessPlace},#{item.licenseProject},#{item.authority},#{item.issueTime},#{item.annexName},#{item.annexUrl},#{item.validityStart},#{item.validityEnd},#{item.holderType},#{item.holderIdType},#{item.privateID}) (#{item.siteId},#{item.recordId},#{item.catalogId},#{item.catalogCode},#{item.catalogName},#{item.certificateName},#{item.certificateCode},#{item.enterpriseName},#{item.legalPerson},#{item.socialCode},#{item.qRCode},#{item.holderName},#{item.holderIDCardNo},#{item.mobile},#{item.certificateStatus},#{item.certificateUrl},#{item.previewUrl},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime},#{item.industryName},#{item.businessPlace},#{item.licenseProject},#{item.authority},#{item.issueTime},#{item.annexName},#{item.annexUrl},#{item.validityStart},#{item.validityEnd},#{item.holderType},#{item.holderIdType},#{item.privateID},#{item.applyId},#{item.total})
</foreach> </foreach>
</insert> </insert>
...@@ -295,6 +303,18 @@ ...@@ -295,6 +303,18 @@
<if test="(colPickMode==0 and data.containsKey('privateID')) or (colPickMode==1 and !data.containsKey('privateID'))"> <if test="(colPickMode==0 and data.containsKey('privateID')) or (colPickMode==1 and !data.containsKey('privateID'))">
a.privateID=#{data.privateID}, a.privateID=#{data.privateID},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('applyId')) or (colPickMode==1 and !data.containsKey('applyId'))">
a.applyId=#{data.applyId},
</if>
<if test="(colPickMode==0 and data.containsKey('applyIdIncrement')) or (colPickMode==1 and !data.containsKey('applyIdIncrement'))">
a.applyId=ifnull(a.applyId,0) + #{data.applyIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('total')) or (colPickMode==1 and !data.containsKey('total'))">
a.total=#{data.total},
</if>
<if test="(colPickMode==0 and data.containsKey('totalIncrement')) or (colPickMode==1 and !data.containsKey('totalIncrement'))">
a.total=ifnull(a.total,0) + #{data.totalIncrement},
</if>
</trim> </trim>
<trim suffixOverrides="where" suffix=""> <trim suffixOverrides="where" suffix="">
where where
...@@ -578,6 +598,30 @@ ...@@ -578,6 +598,30 @@
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="applyId=(case" suffix="ELSE applyId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('applyId')) or (colPickMode==1 and !item.containsKey('applyId'))">
when a.id=#{item.id} then #{item.applyId}
</when>
<when test="(colPickMode==0 and item.containsKey('applyIdIncrement')) or (colPickMode==1 and !item.containsKey('applyIdIncrement'))">
when a.id=#{item.id} then ifnull(a.applyId,0) + #{item.applyIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="total=(case" suffix="ELSE total end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('total')) or (colPickMode==1 and !item.containsKey('total'))">
when a.id=#{item.id} then #{item.total}
</when>
<when test="(colPickMode==0 and item.containsKey('totalIncrement')) or (colPickMode==1 and !item.containsKey('totalIncrement'))">
when a.id=#{item.id} then ifnull(a.total,0) + #{item.totalIncrement}
</when>
</choose>
</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=")">
...@@ -1436,6 +1480,60 @@ ...@@ -1436,6 +1480,60 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="conditionParamRef.containsKey('applyId')">
<if test="conditionParamRef.applyId != null ">
${_conditionType_} a.applyId = #{${_conditionParam_}.applyId}
</if>
<if test="conditionParamRef.applyId == null">
${_conditionType_} a.applyId is null
</if>
</if>
<if test="conditionParamRef.containsKey('applyIdList') and conditionParamRef.applyIdList.size() > 0">
${_conditionType_} a.applyId in
<foreach collection="conditionParamRef.applyIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('applyIdNotList') and conditionParamRef.applyIdNotList.size() > 0">
${_conditionType_} a.applyId not in
<foreach collection="conditionParamRef.applyIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('applyIdStart') and conditionParamRef.applyIdStart != null">
${_conditionType_} a.applyId <![CDATA[ >= ]]> #{${_conditionParam_}.applyIdStart}
</if>
<if test="conditionParamRef.containsKey('applyIdEnd') and conditionParamRef.applyIdEnd != null">
${_conditionType_} a.applyId <![CDATA[ <= ]]> #{${_conditionParam_}.applyIdEnd}
</if>
<if test="conditionParamRef.containsKey('total')">
<if test="conditionParamRef.total != null ">
${_conditionType_} a.total = #{${_conditionParam_}.total}
</if>
<if test="conditionParamRef.total == null">
${_conditionType_} a.total is null
</if>
</if>
<if test="conditionParamRef.containsKey('totalList') and conditionParamRef.totalList.size() > 0">
${_conditionType_} a.total in
<foreach collection="conditionParamRef.totalList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('totalNotList') and conditionParamRef.totalNotList.size() > 0">
${_conditionType_} a.total not in
<foreach collection="conditionParamRef.totalNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('totalStart') and conditionParamRef.totalStart != null">
${_conditionType_} a.total <![CDATA[ >= ]]> #{${_conditionParam_}.totalStart}
</if>
<if test="conditionParamRef.containsKey('totalEnd') and conditionParamRef.totalEnd != null">
${_conditionType_} a.total <![CDATA[ <= ]]> #{${_conditionParam_}.totalEnd}
</if>
</sql> </sql>
<sql id="_orderCols_"> <sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()"> <if test="orderColList != null and !orderColList.isEmpty()">
...@@ -1503,6 +1601,20 @@ ...@@ -1503,6 +1601,20 @@
</foreach> </foreach>
, ,
</if> </if>
<if test="conditionParamRef.containsKey('applyIdList') and conditionParamRef.applyIdList.size() > 0">
field(a.applyId,
<foreach collection="conditionParamRef.applyIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('totalList') and conditionParamRef.totalList.size() > 0">
field(a.total,
<foreach collection="conditionParamRef.totalList" 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}
...@@ -1574,6 +1686,20 @@ ...@@ -1574,6 +1686,20 @@
</foreach> </foreach>
, ,
</if> </if>
<if test="conditionParamRef.containsKey('applyIdList') and conditionParamRef.applyIdList.size() > 0">
field(a.applyId,
<foreach collection="conditionParamRef.applyIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('totalList') and conditionParamRef.totalList.size() > 0">
field(a.total,
<foreach collection="conditionParamRef.totalList" 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
...@@ -1745,6 +1871,16 @@ ...@@ -1745,6 +1871,16 @@
<if test='orderCol.privateID != null and "DESC".equalsIgnoreCase(orderCol.privateID)'>DESC</if> <if test='orderCol.privateID != null and "DESC".equalsIgnoreCase(orderCol.privateID)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('applyId')">
a.applyId
<if test='orderCol.applyId != null and "DESC".equalsIgnoreCase(orderCol.applyId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('total')">
a.total
<if test='orderCol.total != null and "DESC".equalsIgnoreCase(orderCol.total)'>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