Commit aa741985 authored by 廖旭伟's avatar 廖旭伟

事项申请增加申请文件;单事项申请文件配置

parent d2b85cdb
......@@ -2,8 +2,6 @@ package com.mortals.xhx.module.apply.model;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
......@@ -13,7 +11,7 @@ import lombok.Data;
* 单事项申报实体对象
*
* @author zxfei
* @date 2023-05-27
* @date 2023-06-07
*/
@Data
public class MatterApplyEntity extends MatterApplyVo {
......@@ -66,7 +64,6 @@ public class MatterApplyEntity extends MatterApplyVo {
/**
* 申请时间
*/
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date applyTime;
/**
* 审批状态0审批中1通过2不通过
......@@ -84,6 +81,14 @@ public class MatterApplyEntity extends MatterApplyVo {
* 微信openId
*/
private String openId;
/**
* 事项申请文件名称
*/
private String filename;
/**
* 事项申请文件地址
*/
private String fileUrl;
@Override
public int hashCode() {
return this.getId().hashCode();
......@@ -133,5 +138,9 @@ public class MatterApplyEntity extends MatterApplyVo {
this.remarks = "";
this.openId = "";
this.filename = "";
this.fileUrl = "";
}
}
\ No newline at end of file
......@@ -7,7 +7,7 @@ import com.mortals.xhx.module.apply.model.MatterApplyEntity;
* 单事项申报查询对象
*
* @author zxfei
* @date 2023-05-27
* @date 2023-06-07
*/
public class MatterApplyQuery extends MatterApplyEntity {
/** 开始 序号,主键,自增长 */
......@@ -208,6 +208,16 @@ public class MatterApplyQuery extends MatterApplyEntity {
/** 结束 更新时间 */
private String updateTimeEnd;
/** 事项申请文件名称 */
private List<String> filenameList;
/** 事项申请文件名称排除列表 */
private List <String> filenameNotList;
/** 事项申请文件地址 */
private List<String> fileUrlList;
/** 事项申请文件地址排除列表 */
private List <String> fileUrlNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<MatterApplyQuery> orConditionList;
......@@ -1329,6 +1339,70 @@ public class MatterApplyQuery extends MatterApplyEntity {
this.updateTimeEnd = updateTimeEnd;
}
/**
* 获取 事项申请文件名称
* @return filenameList
*/
public List<String> getFilenameList(){
return this.filenameList;
}
/**
* 设置 事项申请文件名称
* @param filenameList
*/
public void setFilenameList(List<String> filenameList){
this.filenameList = filenameList;
}
/**
* 获取 事项申请文件名称
* @return filenameNotList
*/
public List<String> getFilenameNotList(){
return this.filenameNotList;
}
/**
* 设置 事项申请文件名称
* @param filenameNotList
*/
public void setFilenameNotList(List<String> filenameNotList){
this.filenameNotList = filenameNotList;
}
/**
* 获取 事项申请文件地址
* @return fileUrlList
*/
public List<String> getFileUrlList(){
return this.fileUrlList;
}
/**
* 设置 事项申请文件地址
* @param fileUrlList
*/
public void setFileUrlList(List<String> fileUrlList){
this.fileUrlList = fileUrlList;
}
/**
* 获取 事项申请文件地址
* @return fileUrlNotList
*/
public List<String> getFileUrlNotList(){
return this.fileUrlNotList;
}
/**
* 设置 事项申请文件地址
* @param fileUrlNotList
*/
public void setFileUrlNotList(List<String> fileUrlNotList){
this.fileUrlNotList = fileUrlNotList;
}
/**
* 设置 序号,主键,自增长
* @param id
......@@ -1989,6 +2063,44 @@ public class MatterApplyQuery extends MatterApplyEntity {
}
/**
* 设置 事项申请文件名称
* @param filename
*/
public MatterApplyQuery filename(String filename){
setFilename(filename);
return this;
}
/**
* 设置 事项申请文件名称
* @param filenameList
*/
public MatterApplyQuery filenameList(List<String> filenameList){
this.filenameList = filenameList;
return this;
}
/**
* 设置 事项申请文件地址
* @param fileUrl
*/
public MatterApplyQuery fileUrl(String fileUrl){
setFileUrl(fileUrl);
return this;
}
/**
* 设置 事项申请文件地址
* @param fileUrlList
*/
public MatterApplyQuery fileUrlList(List<String> fileUrlList){
this.fileUrlList = fileUrlList;
return this;
}
/**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList
......
package com.mortals.xhx.module.apply.service;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.apply.model.MatterApplyDatumEntity;
import com.mortals.xhx.module.apply.dao.MatterApplyDatumDao;
......@@ -13,4 +15,13 @@ import com.mortals.xhx.module.apply.dao.MatterApplyDatumDao;
public interface MatterApplyDatumService extends ICRUDService<MatterApplyDatumEntity,Long>{
MatterApplyDatumDao getDao();
/**
* 根据申请id删除材料附件
* @param applyIds
* @param context
* @return
* @throws AppException
*/
int remobeByApplyIds(Long[] applyIds, Context context) throws AppException;
}
\ No newline at end of file
......@@ -7,6 +7,9 @@ import com.mortals.xhx.module.apply.dao.MatterApplyDatumDao;
import com.mortals.xhx.module.apply.model.MatterApplyDatumEntity;
import com.mortals.xhx.module.apply.service.MatterApplyDatumService;
import lombok.extern.slf4j.Slf4j;
import java.util.*;
/**
* MatterApplyDatumService
* 事项申报材料 service实现
......@@ -17,5 +20,17 @@ import lombok.extern.slf4j.Slf4j;
@Service("matterApplyDatumService")
@Slf4j
public class MatterApplyDatumServiceImpl extends AbstractCRUDServiceImpl<MatterApplyDatumDao, MatterApplyDatumEntity, Long> implements MatterApplyDatumService {
@Override
public int remobeByApplyIds(Long[] applyIds, Context context) throws AppException {
if(applyIds != null) {
List<Long> applyIdList = new ArrayList<>(applyIds.length);
Collections.addAll(applyIdList,applyIds);
Map<String, Object> condition = new HashMap();
condition.put("applyIdList", applyIdList);
return dao.delete(condition);
}else {
return 0;
}
}
}
\ No newline at end of file
......@@ -5,7 +5,6 @@ import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.module.apply.dao.MatterApplyDao;
import com.mortals.xhx.module.apply.model.MatterApplyDatumEntity;
import com.mortals.xhx.module.apply.model.MatterApplyDatumQuery;
......@@ -175,4 +174,9 @@ public class MatterApplyServiceImpl extends AbstractCRUDServiceImpl<MatterApplyD
entity.setAdvisement("");
this.update(entity,context);
}
@Override
protected void removeAfter(Long[] ids, Context context, int result) throws AppException {
matterApplyDatumService.remobeByApplyIds(ids,context);
}
}
\ No newline at end of file
......@@ -192,4 +192,36 @@ public class MatterApplyController extends BaseCRUDJsonBodyMappingController<Mat
ret.put("data", model);
return ret.toJSONString();
}
@RequestMapping(
value = {"delete"},
method = {RequestMethod.POST, RequestMethod.GET}
)
@UnAuth
public String delete(Long[] id) {
Context context = this.getContext();
if (id == null) {
return this.createFailJsonResp("请至少选择一条记录");
} else {
Map<String, Object> model = new HashMap();
int code = 1;
String busiDesc = "删除" + this.getModuleDesc();
try {
this.deleteBefore(id, context);
int iRet = this.service.remove(id, context);
model.put("message_info", this.getModuleDesc() + "删除成功!删除条数:" + iRet);
this.recordSysLog(this.request, busiDesc + " 【成功】 [id:" + StringUtils.converArray2Str(id) + "]");
} catch (Exception var7) {
code = -1;
this.doException(this.request, busiDesc, model, var7);
}
JSONObject ret = new JSONObject();
ret.put("code", Integer.valueOf(code));
ret.put("msg", model.remove("message_info"));
ret.put("data", model);
return ret.toJSONString();
}
}
}
\ No newline at end of file
package com.mortals.xhx.module.single.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.single.model.SingleMatterFileEntity;
import java.util.List;
/**
* 单事项申请文件Dao
* 单事项申请文件 DAO接口
*
* @author zxfei
* @date 2023-06-07
*/
public interface SingleMatterFileDao extends ICRUDDao<SingleMatterFileEntity,Long>{
}
package com.mortals.xhx.module.single.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.single.dao.SingleMatterFileDao;
import com.mortals.xhx.module.single.model.SingleMatterFileEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 单事项申请文件DaoImpl DAO接口
*
* @author zxfei
* @date 2023-06-07
*/
@Repository("singleMatterFileDao")
public class SingleMatterFileDaoImpl extends BaseCRUDDaoMybatis<SingleMatterFileEntity,Long> implements SingleMatterFileDao {
}
package com.mortals.xhx.module.single.model;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.single.model.vo.SingleMatterFileVo;
import lombok.Data;
/**
* 单事项申请文件实体对象
*
* @author zxfei
* @date 2023-06-07
*/
@Data
public class SingleMatterFileEntity extends SingleMatterFileVo {
private static final long serialVersionUID = 1L;
/**
* 站点id
*/
private Long siteId;
/**
* 基础事项ID
*/
private Long matterId;
/**
* 事项名称
*/
private String matterName;
/**
* 事项编码
*/
private String matterCode;
/**
* 事项申请文件名称
*/
private String filename;
/**
* 事项申请文件地址
*/
private String fileUrl;
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof SingleMatterFileEntity) {
SingleMatterFileEntity tmp = (SingleMatterFileEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public void initAttrValue(){
this.siteId = -1L;
this.matterId = -1L;
this.matterName = "";
this.matterCode = "";
this.filename = "";
this.fileUrl = "";
}
}
\ No newline at end of file
package com.mortals.xhx.module.single.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.single.model.SingleMatterFileEntity;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import com.mortals.framework.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;
/**
* 单事项申请文件视图对象
*
* @author zxfei
* @date 2023-06-07
*/
@Data
public class SingleMatterFileVo extends BaseEntityLong {
}
\ No newline at end of file
......@@ -12,5 +12,8 @@ import lombok.Data;
public class SingleMatterVo extends BaseEntityLong {
/** 材料数量 */
private Integer datumCount = 0;
/** 是否有申请表 0否 1是 */
private Integer hasApplyForm = 0;
/** 申请表下载地址 */
private String applyFormUrl;
}
\ No newline at end of file
package com.mortals.xhx.module.single.service;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.single.model.SingleMatterFileEntity;
import com.mortals.xhx.module.single.dao.SingleMatterFileDao;
/**
* SingleMatterFileService
*
* 单事项申请文件 service接口
*
* @author zxfei
* @date 2023-06-07
*/
public interface SingleMatterFileService extends ICRUDService<SingleMatterFileEntity,Long>{
SingleMatterFileDao getDao();
/**
* 保存申请文件
* @param entity
* @param context
* @return
* @throws AppException
*/
SingleMatterFileEntity saveFile(SingleMatterFileEntity entity, Context context) throws AppException;
}
\ No newline at end of file
package com.mortals.xhx.module.single.service.impl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.module.matter.model.MatterEntity;
import com.mortals.xhx.module.matter.service.MatterService;
import com.mortals.xhx.module.single.dao.SingleMatterFileDao;
import com.mortals.xhx.module.single.model.SingleMatterFileEntity;
import com.mortals.xhx.module.single.model.SingleMatterFileQuery;
import com.mortals.xhx.module.single.service.SingleMatterFileService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
* SingleMatterFileService
* 单事项申请文件 service实现
*
* @author zxfei
* @date 2023-06-07
*/
@Service("singleMatterFileService")
@Slf4j
public class SingleMatterFileServiceImpl extends AbstractCRUDServiceImpl<SingleMatterFileDao, SingleMatterFileEntity, Long> implements SingleMatterFileService {
@Autowired
private MatterService matterService;
@Override
protected void validData(SingleMatterFileEntity entity, Context context) throws AppException {
if(entity.getMatterId()==null){
throw new AppException("基础事项id不能为空");
}
if(StringUtils.isEmpty(entity.getFilename())){
throw new AppException("文件名称不能为空");
}
if(StringUtils.isEmpty(entity.getFileUrl())){
throw new AppException("上传文件不能为空");
}
}
@Override
public SingleMatterFileEntity saveFile(SingleMatterFileEntity entity, Context context) throws AppException {
this.validData(entity,context);
SingleMatterFileEntity temp = this.selectOne(new SingleMatterFileQuery().matterId(entity.getMatterId()));
if(temp!=null){
if(!temp.getFileUrl().equals(entity.getFileUrl())){
SingleMatterFileEntity update = new SingleMatterFileEntity();
update.setId(temp.getId());
update.setFilename(entity.getFilename());
update.setFileUrl(entity.getFileUrl());
update.setUpdateTime(new Date());
if(context!=null && context.getUser()!=null){
entity.setUpdateUserId(context.getUser().getId());
}
dao.update(update);
}
}else {
MatterEntity matterEntity = matterService.get(entity.getMatterId());
if(matterEntity==null){
throw new AppException("基础事项id不正确,查不到对应的事项");
}
entity.setMatterCode(matterEntity.getMatterNo());
entity.setMatterName(matterEntity.getMatterName());
if(entity.getSiteId()==null) {
entity.setSiteId(matterEntity.getSiteId());
}
if(context!=null && context.getUser()!=null){
entity.setCreateUserId(context.getUser().getId());
}
entity.setCreateTime(new Date());
dao.insert(entity);
}
return entity;
}
}
\ No newline at end of file
......@@ -3,6 +3,9 @@ import com.mortals.framework.model.PageInfo;
import com.mortals.xhx.module.matter.model.MatterDatumEntity;
import com.mortals.xhx.module.matter.model.MatterDatumQuery;
import com.mortals.xhx.module.matter.service.MatterDatumService;
import com.mortals.xhx.module.single.model.SingleMatterFileEntity;
import com.mortals.xhx.module.single.model.SingleMatterFileQuery;
import com.mortals.xhx.module.single.service.SingleMatterFileService;
import com.mortals.xhx.module.site.model.SiteMatterEntity;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -30,6 +33,8 @@ public class SingleMatterServiceImpl extends AbstractCRUDServiceImpl<SingleMatte
@Autowired
private MatterDatumService matterDatumService;
@Autowired
private SingleMatterFileService singleMatterFileService;
@Override
protected void findAfter(SingleMatterEntity params, PageInfo pageInfo, Context context, List<SingleMatterEntity> list) throws AppException {
......@@ -40,6 +45,11 @@ public class SingleMatterServiceImpl extends AbstractCRUDServiceImpl<SingleMatte
}else {
item.setDatumCount(0);
}
SingleMatterFileEntity singleMatterFileEntity = singleMatterFileService.selectOne(new SingleMatterFileQuery().matterId(item.getMatterId()));
if(singleMatterFileEntity!=null){
item.setHasApplyForm(1);
item.setApplyFormUrl(singleMatterFileEntity.getFileUrl());
}
}).count();
super.findAfter(params, context, list);
}
......@@ -53,6 +63,11 @@ public class SingleMatterServiceImpl extends AbstractCRUDServiceImpl<SingleMatte
}else {
item.setDatumCount(0);
}
SingleMatterFileEntity singleMatterFileEntity = singleMatterFileService.selectOne(new SingleMatterFileQuery().matterId(item.getMatterId()));
if(singleMatterFileEntity!=null){
item.setHasApplyForm(1);
item.setApplyFormUrl(singleMatterFileEntity.getFileUrl());
}
}).count();
super.findAfter(params, context, list);
}
......
package com.mortals.xhx.module.single.web;
import com.mortals.framework.annotation.RepeatSubmit;
import com.mortals.framework.model.BaseEntity;
import com.mortals.framework.service.IUser;
import com.mortals.framework.utils.BeanUtil;
import com.mortals.framework.utils.ReflectUtils;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.single.model.SingleMatterFileEntity;
import com.mortals.xhx.module.single.service.SingleMatterFileService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.*;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 单事项申请文件
*
* @author zxfei
* @date 2023-06-07
*/
@RestController
@RequestMapping("single/matter/file")
public class SingleMatterFileController extends BaseCRUDJsonBodyMappingController<SingleMatterFileService,SingleMatterFileEntity,Long> {
@Autowired
private ParamService paramService;
public SingleMatterFileController(){
super.setModuleDesc( "单事项申请文件");
}
@Override
protected void init(Map<String, Object> model, Context context) {
super.init(model, context);
}
@PostMapping({"save"})
@RepeatSubmit
public String save(@RequestBody SingleMatterFileEntity entity) {
Map<String, Object> model = new HashMap();
Context context = this.getContext();
int code = 1;
String busiDesc = "保存" + this.getModuleDesc();
try {
this.service.saveFile(entity,context);
model.put("id", entity.getId());
model.put("entity", entity);
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】 [id:" + entity.getId() + "]");
} catch (Exception var9) {
this.doException(this.request, busiDesc, model, var9);
model.put("entity", entity);
this.init(model, context);
code = this.saveException(entity, model, context, var9);
}
this.init(model, context);
JSONObject ret = new JSONObject();
ret.put("code", code);
ret.put("msg", model.remove("message_info"));
ret.put("data", model);
return ret.toJSONString();
}
}
\ No newline at end of file
......@@ -26,6 +26,8 @@
<result property="createTime" column="createTime" />
<result property="updateUserId" column="updateUserId" />
<result property="updateTime" column="updateTime" />
<result property="filename" column="filename" />
<result property="fileUrl" column="fileUrl" />
</resultMap>
......@@ -96,23 +98,29 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))">
a.updateTime,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('filename') or colPickMode == 1 and data.containsKey('filename')))">
a.filename,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('fileUrl') or colPickMode == 1 and data.containsKey('fileUrl')))">
a.fileUrl,
</if>
</trim>
</sql>
<!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="MatterApplyEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_sys_matter_apply
(siteId,singleMatterId,matterId,deptCode,matterName,applyPerson,sexual,phoneNum,idCard,address,applyType,applyTime,applyState,advisement,remarks,openId,createUserId,createTime,updateUserId,updateTime)
(siteId,singleMatterId,matterId,deptCode,matterName,applyPerson,sexual,phoneNum,idCard,address,applyType,applyTime,applyState,advisement,remarks,openId,createUserId,createTime,updateUserId,updateTime,filename,fileUrl)
VALUES
(#{siteId},#{singleMatterId},#{matterId},#{deptCode},#{matterName},#{applyPerson},#{sexual},#{phoneNum},#{idCard},#{address},#{applyType},#{applyTime},#{applyState},#{advisement},#{remarks},#{openId},#{createUserId},#{createTime},#{updateUserId},#{updateTime})
(#{siteId},#{singleMatterId},#{matterId},#{deptCode},#{matterName},#{applyPerson},#{sexual},#{phoneNum},#{idCard},#{address},#{applyType},#{applyTime},#{applyState},#{advisement},#{remarks},#{openId},#{createUserId},#{createTime},#{updateUserId},#{updateTime},#{filename},#{fileUrl})
</insert>
<!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto">
insert into mortals_sys_matter_apply
(siteId,singleMatterId,matterId,deptCode,matterName,applyPerson,sexual,phoneNum,idCard,address,applyType,applyTime,applyState,advisement,remarks,openId,createUserId,createTime,updateUserId,updateTime)
(siteId,singleMatterId,matterId,deptCode,matterName,applyPerson,sexual,phoneNum,idCard,address,applyType,applyTime,applyState,advisement,remarks,openId,createUserId,createTime,updateUserId,updateTime,filename,fileUrl)
VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.siteId},#{item.singleMatterId},#{item.matterId},#{item.deptCode},#{item.matterName},#{item.applyPerson},#{item.sexual},#{item.phoneNum},#{item.idCard},#{item.address},#{item.applyType},#{item.applyTime},#{item.applyState},#{item.advisement},#{item.remarks},#{item.openId},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime})
(#{item.siteId},#{item.singleMatterId},#{item.matterId},#{item.deptCode},#{item.matterName},#{item.applyPerson},#{item.sexual},#{item.phoneNum},#{item.idCard},#{item.address},#{item.applyType},#{item.applyTime},#{item.applyState},#{item.advisement},#{item.remarks},#{item.openId},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime},#{item.filename},#{item.fileUrl})
</foreach>
</insert>
......@@ -206,6 +214,12 @@
<if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))">
a.updateTime=#{data.updateTime},
</if>
<if test="(colPickMode==0 and data.containsKey('filename')) or (colPickMode==1 and !data.containsKey('filename'))">
a.filename=#{data.filename},
</if>
<if test="(colPickMode==0 and data.containsKey('fileUrl')) or (colPickMode==1 and !data.containsKey('fileUrl'))">
a.fileUrl=#{data.fileUrl},
</if>
</trim>
<trim suffixOverrides="where" suffix="">
where
......@@ -398,6 +412,20 @@
</if>
</foreach>
</trim>
<trim prefix="filename=(case" suffix="ELSE filename end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('filename')) or (colPickMode==1 and !item.containsKey('filename'))">
when a.id=#{item.id} then #{item.filename}
</if>
</foreach>
</trim>
<trim prefix="fileUrl=(case" suffix="ELSE fileUrl end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('fileUrl')) or (colPickMode==1 and !item.containsKey('fileUrl'))">
when a.id=#{item.id} then #{item.fileUrl}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
......@@ -991,6 +1019,48 @@
<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')
</if>
<if test="conditionParamRef.containsKey('filename')">
<if test="conditionParamRef.filename != null and conditionParamRef.filename != ''">
${_conditionType_} a.filename like #{${_conditionParam_}.filename}
</if>
<if test="conditionParamRef.filename == null">
${_conditionType_} a.filename is null
</if>
</if>
<if test="conditionParamRef.containsKey('filenameList') and conditionParamRef.filenameList.size() > 0">
${_conditionType_} a.filename in
<foreach collection="conditionParamRef.filenameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('filenameNotList') and conditionParamRef.filenameNotList.size() > 0">
${_conditionType_} a.filename not in
<foreach collection="conditionParamRef.filenameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('fileUrl')">
<if test="conditionParamRef.fileUrl != null and conditionParamRef.fileUrl != ''">
${_conditionType_} a.fileUrl like #{${_conditionParam_}.fileUrl}
</if>
<if test="conditionParamRef.fileUrl == null">
${_conditionType_} a.fileUrl is null
</if>
</if>
<if test="conditionParamRef.containsKey('fileUrlList') and conditionParamRef.fileUrlList.size() > 0">
${_conditionType_} a.fileUrl in
<foreach collection="conditionParamRef.fileUrlList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('fileUrlNotList') and conditionParamRef.fileUrlNotList.size() > 0">
${_conditionType_} a.fileUrl not in
<foreach collection="conditionParamRef.fileUrlNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
</sql>
<sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()">
......@@ -1109,6 +1179,16 @@
<if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('filename')">
a.filename
<if test='orderCol.filename != null and "DESC".equalsIgnoreCase(orderCol.filename)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('fileUrl')">
a.fileUrl
<if test='orderCol.fileUrl != null and "DESC".equalsIgnoreCase(orderCol.fileUrl)'>DESC</if>
,
</if>
</trim>
</if>
</sql>
......
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