Browse Source

任务

master
zhao 1 year ago
parent
commit
10f6f4bd6a
17 changed files with 751 additions and 169 deletions
  1. +8
    -1
      agentcenter-sdk/src/main/java/com/nsgk/agentcentersdk/NSMain.java
  2. +3
    -0
      agentcenter-sdk/src/main/java/com/nsgk/agentcentersdk/entity/NSEntity.java
  3. +4
    -0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/agentcenter/AgentCenterController.java
  4. +4
    -0
      ruoyi-agentcenter/pom.xml
  5. +63
    -30
      ruoyi-agentcenter/src/main/java/com/ruoyi/agentcenter/domain/TAgentTask.java
  6. +56
    -1
      ruoyi-agentcenter/src/main/java/com/ruoyi/agentcenter/listener/ContractionListener.java
  7. +3
    -1
      ruoyi-agentcenter/src/main/java/com/ruoyi/agentcenter/mapper/TAgentTaskMapper.java
  8. +5
    -1
      ruoyi-agentcenter/src/main/java/com/ruoyi/agentcenter/service/ITAgentTaskService.java
  9. +51
    -3
      ruoyi-agentcenter/src/main/java/com/ruoyi/agentcenter/service/impl/TAgentTaskServiceImpl.java
  10. +218
    -111
      ruoyi-agentcenter/src/main/resources/mapper/agentcenter/TAgentTaskMapper.xml
  11. +77
    -2
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java
  12. +148
    -0
      ruoyi-common/src/main/java/com/ruoyi/common/utils/DeptUtils.java
  13. +46
    -0
      ruoyi-common/src/main/java/com/ruoyi/common/utils/sql/SqlUtil.java
  14. +7
    -0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java
  15. +7
    -0
      ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java
  16. +10
    -0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
  17. +41
    -19
      ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml

+ 8
- 1
agentcenter-sdk/src/main/java/com/nsgk/agentcentersdk/NSMain.java View File

@@ -50,7 +50,14 @@ public final class NSMain
entity = new NSEntity(); entity = new NSEntity();
entity.setDeptId(187L) entity.setDeptId(187L)
.setBookId(166L) .setBookId(166L)
.setOrgCode("371081")
.setOrgCode("371002100005")
.setBookName("张村账套")
.setOrgCode("3710021000050001")
.setBookName("张村1组账套")
.setOrgCode("371002100")
.setBookName("张村镇账套")
.setOrgCode("371002")
.setBookName("环翠区账套")
; ;
entity.Parm("buildingTime", "2000-12-25"); entity.Parm("buildingTime", "2000-12-25");
entity.Parm("name", "测试合同"); entity.Parm("name", "测试合同");


+ 3
- 0
agentcenter-sdk/src/main/java/com/nsgk/agentcentersdk/entity/NSEntity.java View File

@@ -34,6 +34,9 @@ public class NSEntity implements Serializable
/** 外部ID */ /** 外部ID */
protected String orgCode; protected String orgCode;


/** 账套名称 */
protected String bookName;

// 存储其他没有声明的属性, 用于当客户端与服务端字段不一致时, 在不更新sdk的情况下, 保持兼容性 // 存储其他没有声明的属性, 用于当客户端与服务端字段不一致时, 在不更新sdk的情况下, 保持兼容性
// 不会覆盖已设置的属性 // 不会覆盖已设置的属性
protected Map<String, Object> parms; protected Map<String, Object> parms;


+ 4
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/agentcenter/AgentCenterController.java View File

@@ -62,6 +62,10 @@ public class AgentCenterController extends BaseController
{ {
return NSSDKServer.Fail(e.getErrno(), e.getMessage()); return NSSDKServer.Fail(e.getErrno(), e.getMessage());
} }
catch(IllegalArgumentException e)
{
return NSSDKServer.Fail(NSErrno.ERRNO_ERROR, e.getMessage());
}
} }


private NSApiResult response(Result<?> result) private NSApiResult response(Result<?> result)


+ 4
- 0
ruoyi-agentcenter/pom.xml View File

@@ -26,6 +26,10 @@
<groupId>com.nsgk</groupId> <groupId>com.nsgk</groupId>
<artifactId>agentcenter-sdk</artifactId> <artifactId>agentcenter-sdk</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-system</artifactId>
</dependency>


</dependencies> </dependencies>



+ 63
- 30
ruoyi-agentcenter/src/main/java/com/ruoyi/agentcenter/domain/TAgentTask.java View File

@@ -14,7 +14,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* 任务清单对象 t_agent_task * 任务清单对象 t_agent_task
* *
* @author zhao * @author zhao
* @date 2023-05-06
* @date 2023-07-14
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@@ -26,7 +26,7 @@ public class TAgentTask extends BaseEntity
private Long id; private Long id;


/** 所属中心 字典 agent_center */ /** 所属中心 字典 agent_center */
@Excel(name = "所属中心", dictType = "agent_center")
@Excel(name = "所属中心 字典 agent_center")
private String agentCenter; private String agentCenter;


/** 县代码 */ /** 县代码 */
@@ -53,9 +53,21 @@ public class TAgentTask extends BaseEntity
@Excel(name = "村名称") @Excel(name = "村名称")
private String orgName; private String orgName;


/** 账套数 */
@Excel(name = "账套数")
private Integer bookCount;
/** 账套id */
@Excel(name = "账套id")
private Long bookId;

/** 账套名称 */
@Excel(name = "账套名称")
private String bookName;

/** 任务年度 */
@Excel(name = "任务年度")
private String orderYear;

/** 任务月份 */
@Excel(name = "任务月份")
private String orderMonth;


/** 凭证数 */ /** 凭证数 */
@Excel(name = "凭证数") @Excel(name = "凭证数")
@@ -63,7 +75,7 @@ public class TAgentTask extends BaseEntity


/** 合同数 */ /** 合同数 */
@Excel(name = "合同数") @Excel(name = "合同数")
private Integer contractionCount;
private Integer contracCount;


/** 资产数 */ /** 资产数 */
@Excel(name = "资产数") @Excel(name = "资产数")
@@ -73,55 +85,76 @@ public class TAgentTask extends BaseEntity
@Excel(name = "任务总数") @Excel(name = "任务总数")
private Integer allCount; private Integer allCount;


/** 任务年度 */
@Excel(name = "任务年度")
private String orderYear;
/** 完成数 */
@Excel(name = "完成数")
private Integer finishCount;


/** 任务月份 */
@Excel(name = "任务月份")
private String orderMonth;

/** 任务状态 字典 agent_status (任务人全部完成后交任务的动作) */
@Excel(name = "任务状态", dictType = "agent_status")
/** 任务状态 字典 agent_status */
@Excel(name = "任务状态 字典 agent_status")
private String agentStatus; private String agentStatus;


/** 分配主管(用user_name) */
@Excel(name = "分配主管")
private String distributionChief;
/** 分配用户(用user_name) */
@Excel(name = "分配用户(用user_name)")
private String distriUser;

/** 分配人(用nick_name) */
@Excel(name = "分配人(用nick_name)")
private String distriNick;


/** 分配时间 */ /** 分配时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "分配时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "分配时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date distributionDate;
private Date distriDate;


/** 任务截止日期 */ /** 任务截止日期 */
@Excel(name = "任务截止日期") @Excel(name = "任务截止日期")
private String endAt; private String endAt;


/** 记账会计(即被分配人,用user_name) */
@Excel(name = "记账会计")
private String handleAccount;
/** 记账用户(用user_name) */
@Excel(name = "记账用户(用user_name)")
private String handleUser;

/** 记账会计(用nick_name) */
@Excel(name = "记账会计(用nick_name)")
private String handleNick;

/** 记账备注 */
@Excel(name = "记账备注")
private String handleRemark;


/** 记账完成时间 */ /** 记账完成时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "记账完成时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "记账完成时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date handleDate; private Date handleDate;


/** 审核会计(用user_name) */
@Excel(name = "审核会计(用user_name)")
private String auditAccount;
/** 审核用户(用user_name) */
@Excel(name = "审核用户(用user_name)")
private String auditUser;

/** 审核人(用nick_name) */
@Excel(name = "审核人(用nick_name)")
private String auditNick;


/** 审核时间 */ /** 审核时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date auditDate; private Date auditDate;


/** 任务评分(分配主管来评价) */
/** 评价用户(用user_name) */
@Excel(name = "评价用户(用user_name)")
private String appraiseUser;

/** 评价人(用nick_name) */
@Excel(name = "评价人(用nick_name)")
private String appraiseNick;

/** 任务评分 */
@Excel(name = "任务评分") @Excel(name = "任务评分")
private BigDecimal taskScore;
private BigDecimal appraiseScore;

/** 评价备注 */
@Excel(name = "评价备注")
private String appraiseRemark;


/** 任务评价 */
@Excel(name = "任务评价")
private String taskAppraise;


} }

+ 56
- 1
ruoyi-agentcenter/src/main/java/com/ruoyi/agentcenter/listener/ContractionListener.java View File

@@ -1,14 +1,20 @@
package com.ruoyi.agentcenter.listener; package com.ruoyi.agentcenter.listener;


import cn.hutool.core.lang.Assert;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.google.common.eventbus.Subscribe; import com.google.common.eventbus.Subscribe;
import com.nsgk.agentcentersdk.entity.NSContractionEntity; import com.nsgk.agentcentersdk.entity.NSContractionEntity;
import com.ruoyi.agentcenter.domain.TAgentContraction; import com.ruoyi.agentcenter.domain.TAgentContraction;
import com.ruoyi.agentcenter.domain.TAgentTask;
import com.ruoyi.agentcenter.object.ContractionSession; import com.ruoyi.agentcenter.object.ContractionSession;
import com.ruoyi.agentcenter.object.Message; import com.ruoyi.agentcenter.object.Message;
import com.ruoyi.agentcenter.object.Result; import com.ruoyi.agentcenter.object.Result;
import com.ruoyi.agentcenter.service.ITAgentContractionService; import com.ruoyi.agentcenter.service.ITAgentContractionService;
import com.ruoyi.agentcenter.service.ITAgentTaskService;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.utils.EventBusEngine; import com.ruoyi.common.utils.EventBusEngine;
import com.ruoyi.common.utils.sql.SqlUtil;
import com.ruoyi.system.service.ISysDeptService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;


@@ -20,6 +26,10 @@ public class ContractionListener
{ {
@Autowired @Autowired
private ITAgentContractionService itAgentContractionService; private ITAgentContractionService itAgentContractionService;
@Autowired
private ITAgentTaskService itAgentTaskService;
@Autowired
private ISysDeptService iSysDeptService;


@PostConstruct @PostConstruct
public void init() public void init()
@@ -34,7 +44,11 @@ public class ContractionListener
TAgentContraction contraction = conv(session.message); TAgentContraction contraction = conv(session.message);
Result result = session.result; Result result = session.result;


itAgentContractionService.insertTAgentContraction(contraction);
SqlUtil.transaction(() -> {
TAgentTask task = syncTask(session.message.getData(), contraction);
contraction.setTaskId(task.getId());
itAgentContractionService.insertTAgentContraction(contraction);
});


result.setData(contraction); result.setData(contraction);
} }
@@ -56,4 +70,45 @@ public class ContractionListener
; ;
return contraction; return contraction;
} }

private TAgentTask syncTask(NSContractionEntity entity, TAgentContraction contraction)
{
String orgCode = contraction.getOrgCode();
TAgentTask task = new TAgentTask();
task.setOrgCode(orgCode)
.setOrderYear(contraction.getOrderYear())
.setOrderMonth(contraction.getOrderMonth())
;
TAgentTask tAgentTask = itAgentTaskService.selectTAgentTask(task);
if(null == tAgentTask)
{
SysDept deptCond = new SysDept();
deptCond.setOrgCode(orgCode);
SysDept dept = iSysDeptService.selectSysDept(deptCond);
Assert.notNull(dept, "部门不存在: {}", orgCode);
task.setBookId(contraction.getBookId())
.setBookName(entity.getBookName())

.setContracCount(0)
.setVoucherCount(0)
.setAssetCount(0)
.setAllCount(0)
.setFinishCount(0)

.setAgentCenter(dept.getAgentCenter())
.setAgentStatus("1")
;
itAgentTaskService.fillTAgentTaskOrg(task);
task.setCreateBy("admin");
itAgentTaskService.insertTAgentTask(task);
tAgentTask = task;
}

task = new TAgentTask();
task.setContracCount(1);
task.setId(tAgentTask.getId());
itAgentTaskService.updateTAgentTaskCount(task);

return task;
}
} }

+ 3
- 1
ruoyi-agentcenter/src/main/java/com/ruoyi/agentcenter/mapper/TAgentTaskMapper.java View File

@@ -7,7 +7,7 @@ import com.ruoyi.agentcenter.domain.TAgentTask;
* 任务清单Mapper接口 * 任务清单Mapper接口
* *
* @author zhao * @author zhao
* @date 2023-05-06
* @date 2023-07-14
*/ */
public interface TAgentTaskMapper public interface TAgentTaskMapper
{ {
@@ -99,4 +99,6 @@ public interface TAgentTaskMapper
* @return 任务清单是否存在 * @return 任务清单是否存在
*/ */
public int selectTAgentTaskExists(TAgentTask tAgentTask); public int selectTAgentTaskExists(TAgentTask tAgentTask);

public int updateTAgentTaskCount(TAgentTask tAgentTask);
} }

+ 5
- 1
ruoyi-agentcenter/src/main/java/com/ruoyi/agentcenter/service/ITAgentTaskService.java View File

@@ -7,7 +7,7 @@ import com.ruoyi.agentcenter.domain.TAgentTask;
* 任务清单Service接口 * 任务清单Service接口
* *
* @author zhao * @author zhao
* @date 2023-05-06
* @date 2023-07-14
*/ */
public interface ITAgentTaskService public interface ITAgentTaskService
{ {
@@ -99,4 +99,8 @@ public interface ITAgentTaskService
* @return 任务清单是否存在 * @return 任务清单是否存在
*/ */
public boolean selectTAgentTaskExists(TAgentTask tAgentTask); public boolean selectTAgentTaskExists(TAgentTask tAgentTask);

public int updateTAgentTaskCount(TAgentTask tAgentTask);

public void fillTAgentTaskOrg(TAgentTask tAgentTask);
} }

+ 51
- 3
ruoyi-agentcenter/src/main/java/com/ruoyi/agentcenter/service/impl/TAgentTaskServiceImpl.java View File

@@ -1,26 +1,33 @@
package com.ruoyi.agentcenter.service.impl; package com.ruoyi.agentcenter.service.impl;


import java.util.List; import java.util.List;

import cn.hutool.core.lang.Assert;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import org.apache.commons.collections4.ListUtils;
import com.ruoyi.common.utils.DeptUtils;
import com.ruoyi.system.mapper.SysDeptMapper;
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 org.springframework.transaction.annotation.Transactional;
import org.apache.commons.collections4.ListUtils;
import com.ruoyi.agentcenter.mapper.TAgentTaskMapper; import com.ruoyi.agentcenter.mapper.TAgentTaskMapper;
import com.ruoyi.agentcenter.domain.TAgentTask; import com.ruoyi.agentcenter.domain.TAgentTask;
import com.ruoyi.agentcenter.service.ITAgentTaskService; import com.ruoyi.agentcenter.service.ITAgentTaskService;
import org.springframework.transaction.annotation.Transactional;


/** /**
* 任务清单Service业务层处理 * 任务清单Service业务层处理
* *
* @author zhao * @author zhao
* @date 2023-05-06
* @date 2023-07-14
*/ */
@Service @Service
public class TAgentTaskServiceImpl implements ITAgentTaskService public class TAgentTaskServiceImpl implements ITAgentTaskService
{ {
@Autowired @Autowired
private TAgentTaskMapper tAgentTaskMapper; private TAgentTaskMapper tAgentTaskMapper;
@Autowired
private SysDeptMapper sysDeptMapper;


/** /**
* 查询任务清单 * 查询任务清单
@@ -161,4 +168,45 @@ public class TAgentTaskServiceImpl implements ITAgentTaskService
public boolean selectTAgentTaskExists(TAgentTask tAgentTask) { public boolean selectTAgentTaskExists(TAgentTask tAgentTask) {
return tAgentTaskMapper.selectTAgentTaskExists(tAgentTask) > 0; return tAgentTaskMapper.selectTAgentTaskExists(tAgentTask) > 0;
} }

@Override
public int updateTAgentTaskCount(TAgentTask tAgentTask)
{
return tAgentTaskMapper.updateTAgentTaskCount(tAgentTask);
}

@Override
public void fillTAgentTaskOrg(TAgentTask tAgentTask)
{
String orgCode = tAgentTask.getOrgCode();
int level = DeptUtils.parseOrgCodeLevel(orgCode);
Assert.isTrue(level >= DeptUtils.LEVEL_TOWN, "orgCode必须是镇级或镇以下级别");

SysDept deptCond = new SysDept();
deptCond.setOrgCode(orgCode);
SysDept org = sysDeptMapper.selectSysDept(deptCond);
Assert.notNull(org, "orgCode对应的地区不存在: {} - {}", orgCode, level);
List<Long> levelIds = org.makeAncestorsIdList(true);

SysDept town;
SysDept county;

if(level > DeptUtils.LEVEL_TOWN) // 镇级以下
{
town = sysDeptMapper.selectDeptById(levelIds.get(DeptUtils.LEVEL_TOWN));
Assert.notNull(town, "orgCode对应的镇级地区不存在: {} - {}", orgCode, level);
}
else
town = org;

county = sysDeptMapper.selectDeptById(levelIds.get(DeptUtils.LEVEL_COUNTY));
Assert.notNull(county, "orgCode对应的区级地区不存在: {} - {}", orgCode, level);

tAgentTask.setCountyCode(county.getOrgCode())
.setCountyName(county.getDeptName())
.setTownCode(town.getOrgCode())
.setTownName(town.getDeptName())
.setOrgName(org.getDeptName())
;
}
} }

+ 218
- 111
ruoyi-agentcenter/src/main/resources/mapper/agentcenter/TAgentTaskMapper.xml View File

@@ -13,23 +13,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="townName" column="town_name" /> <result property="townName" column="town_name" />
<result property="orgCode" column="org_code" /> <result property="orgCode" column="org_code" />
<result property="orgName" column="org_name" /> <result property="orgName" column="org_name" />
<result property="bookCount" column="book_count" />
<result property="bookId" column="book_id" />
<result property="bookName" column="book_name" />
<result property="orderYear" column="order_year" />
<result property="orderMonth" column="order_month" />
<result property="voucherCount" column="voucher_count" /> <result property="voucherCount" column="voucher_count" />
<result property="contractionCount" column="contraction_count" />
<result property="contracCount" column="contrac_count" />
<result property="assetCount" column="asset_count" /> <result property="assetCount" column="asset_count" />
<result property="allCount" column="all_count" /> <result property="allCount" column="all_count" />
<result property="orderYear" column="order_year" />
<result property="orderMonth" column="order_month" />
<result property="finishCount" column="finish_count" />
<result property="agentStatus" column="agent_status" /> <result property="agentStatus" column="agent_status" />
<result property="distributionChief" column="distribution_chief" />
<result property="distributionDate" column="distribution_date" />
<result property="distriUser" column="distri_user" />
<result property="distriNick" column="distri_nick" />
<result property="distriDate" column="distri_date" />
<result property="endAt" column="end_at" /> <result property="endAt" column="end_at" />
<result property="handleAccount" column="handle_account" />
<result property="handleUser" column="handle_user" />
<result property="handleNick" column="handle_nick" />
<result property="handleRemark" column="handle_remark" />
<result property="handleDate" column="handle_date" /> <result property="handleDate" column="handle_date" />
<result property="auditAccount" column="audit_account" />
<result property="auditUser" column="audit_user" />
<result property="auditNick" column="audit_nick" />
<result property="auditDate" column="audit_date" /> <result property="auditDate" column="audit_date" />
<result property="taskScore" column="task_score" />
<result property="taskAppraise" column="task_appraise" />
<result property="appraiseUser" column="appraise_user" />
<result property="appraiseNick" column="appraise_nick" />
<result property="appraiseScore" column="appraise_score" />
<result property="appraiseRemark" column="appraise_remark" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
@@ -37,7 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>


<sql id="selectTAgentTaskVo"> <sql id="selectTAgentTaskVo">
select id, agent_center, county_code, county_name, town_code, town_name, org_code, org_name, book_count, voucher_count, contraction_count, asset_count, all_count, order_year, order_month, agent_status, distribution_chief, distribution_date, end_at, handle_account, handle_date, audit_account, audit_date, task_score, task_appraise, create_by, create_time, update_by, update_time from t_agent_task
select id, agent_center, county_code, county_name, town_code, town_name, org_code, org_name, book_id, book_name, order_year, order_month, voucher_count, contrac_count, asset_count, all_count, finish_count, agent_status, distri_user, distri_nick, distri_date, end_at, handle_user, handle_nick, handle_remark, handle_date, audit_user, audit_nick, audit_date, appraise_user, appraise_nick, appraise_score, appraise_remark, create_by, create_time, update_by, update_time from t_agent_task
</sql> </sql>


<!--条件查询--> <!--条件查询-->
@@ -51,23 +59,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="townName != null and townName != ''"> and town_name like concat('%', #{townName}, '%')</if> <if test="townName != null and townName != ''"> and town_name like concat('%', #{townName}, '%')</if>
<if test="orgCode != null and orgCode != ''"> and org_code = #{orgCode}</if> <if test="orgCode != null and orgCode != ''"> and org_code = #{orgCode}</if>
<if test="orgName != null and orgName != ''"> and org_name like concat('%', #{orgName}, '%')</if> <if test="orgName != null and orgName != ''"> and org_name like concat('%', #{orgName}, '%')</if>
<if test="bookCount != null "> and book_count = #{bookCount}</if>
<if test="bookId != null "> and book_id = #{bookId}</if>
<if test="bookName != null and bookName != ''"> and book_name like concat('%', #{bookName}, '%')</if>
<if test="orderYear != null and orderYear != ''"> and order_year = #{orderYear}</if>
<if test="orderMonth != null and orderMonth != ''"> and order_month = #{orderMonth}</if>
<if test="voucherCount != null "> and voucher_count = #{voucherCount}</if> <if test="voucherCount != null "> and voucher_count = #{voucherCount}</if>
<if test="contractionCount != null "> and contraction_count = #{contractionCount}</if>
<if test="contracCount != null "> and contrac_count = #{contracCount}</if>
<if test="assetCount != null "> and asset_count = #{assetCount}</if> <if test="assetCount != null "> and asset_count = #{assetCount}</if>
<if test="allCount != null "> and all_count = #{allCount}</if> <if test="allCount != null "> and all_count = #{allCount}</if>
<if test="orderYear != null and orderYear != ''"> and order_year = #{orderYear}</if>
<if test="orderMonth != null and orderMonth != ''"> and order_month = #{orderMonth}</if>
<if test="finishCount != null "> and finish_count = #{finishCount}</if>
<if test="agentStatus != null and agentStatus != ''"> and agent_status = #{agentStatus}</if> <if test="agentStatus != null and agentStatus != ''"> and agent_status = #{agentStatus}</if>
<if test="distributionChief != null and distributionChief != ''"> and distribution_chief = #{distributionChief}</if>
<if test="distributionDate != null "> and distribution_date = #{distributionDate}</if>
<if test="distriUser != null and distriUser != ''"> and distri_user = #{distriUser}</if>
<if test="distriNick != null and distriNick != ''"> and distri_nick = #{distriNick}</if>
<if test="distriDate != null "> and distri_date = #{distriDate}</if>
<if test="endAt != null and endAt != ''"> and end_at = #{endAt}</if> <if test="endAt != null and endAt != ''"> and end_at = #{endAt}</if>
<if test="handleAccount != null and handleAccount != ''"> and handle_account = #{handleAccount}</if>
<if test="handleUser != null and handleUser != ''"> and handle_user = #{handleUser}</if>
<if test="handleNick != null and handleNick != ''"> and handle_nick = #{handleNick}</if>
<if test="handleRemark != null and handleRemark != ''"> and handle_remark = #{handleRemark}</if>
<if test="handleDate != null "> and handle_date = #{handleDate}</if> <if test="handleDate != null "> and handle_date = #{handleDate}</if>
<if test="auditAccount != null and auditAccount != ''"> and audit_account = #{auditAccount}</if>
<if test="auditUser != null and auditUser != ''"> and audit_user = #{auditUser}</if>
<if test="auditNick != null and auditNick != ''"> and audit_nick = #{auditNick}</if>
<if test="auditDate != null "> and audit_date = #{auditDate}</if> <if test="auditDate != null "> and audit_date = #{auditDate}</if>
<if test="taskScore != null "> and task_score = #{taskScore}</if>
<if test="taskAppraise != null and taskAppraise != ''"> and task_appraise = #{taskAppraise}</if>
<if test="appraiseUser != null and appraiseUser != ''"> and appraise_user = #{appraiseUser}</if>
<if test="appraiseNick != null and appraiseNick != ''"> and appraise_nick = #{appraiseNick}</if>
<if test="appraiseScore != null "> and appraise_score = #{appraiseScore}</if>
<if test="appraiseRemark != null and appraiseRemark != ''"> and appraise_remark = #{appraiseRemark}</if>
</where> </where>
</select> </select>
@@ -88,23 +104,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="townName != null and townName != ''">town_name,</if> <if test="townName != null and townName != ''">town_name,</if>
<if test="orgCode != null and orgCode != ''">org_code,</if> <if test="orgCode != null and orgCode != ''">org_code,</if>
<if test="orgName != null and orgName != ''">org_name,</if> <if test="orgName != null and orgName != ''">org_name,</if>
<if test="bookCount != null">book_count,</if>
<if test="bookId != null">book_id,</if>
<if test="bookName != null and bookName != ''">book_name,</if>
<if test="orderYear != null and orderYear != ''">order_year,</if>
<if test="orderMonth != null and orderMonth != ''">order_month,</if>
<if test="voucherCount != null">voucher_count,</if> <if test="voucherCount != null">voucher_count,</if>
<if test="contractionCount != null">contraction_count,</if>
<if test="contracCount != null">contrac_count,</if>
<if test="assetCount != null">asset_count,</if> <if test="assetCount != null">asset_count,</if>
<if test="allCount != null">all_count,</if> <if test="allCount != null">all_count,</if>
<if test="orderYear != null and orderYear != ''">order_year,</if>
<if test="orderMonth != null and orderMonth != ''">order_month,</if>
<if test="finishCount != null">finish_count,</if>
<if test="agentStatus != null and agentStatus != ''">agent_status,</if> <if test="agentStatus != null and agentStatus != ''">agent_status,</if>
<if test="distributionChief != null">distribution_chief,</if>
<if test="distributionDate != null">distribution_date,</if>
<if test="distriUser != null">distri_user,</if>
<if test="distriNick != null">distri_nick,</if>
<if test="distriDate != null">distri_date,</if>
<if test="endAt != null">end_at,</if> <if test="endAt != null">end_at,</if>
<if test="handleAccount != null">handle_account,</if>
<if test="handleUser != null">handle_user,</if>
<if test="handleNick != null">handle_nick,</if>
<if test="handleRemark != null">handle_remark,</if>
<if test="handleDate != null">handle_date,</if> <if test="handleDate != null">handle_date,</if>
<if test="auditAccount != null">audit_account,</if>
<if test="auditUser != null">audit_user,</if>
<if test="auditNick != null">audit_nick,</if>
<if test="auditDate != null">audit_date,</if> <if test="auditDate != null">audit_date,</if>
<if test="taskScore != null">task_score,</if>
<if test="taskAppraise != null">task_appraise,</if>
<if test="appraiseUser != null">appraise_user,</if>
<if test="appraiseNick != null">appraise_nick,</if>
<if test="appraiseScore != null">appraise_score,</if>
<if test="appraiseRemark != null">appraise_remark,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
@@ -118,23 +142,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="townName != null and townName != ''">#{townName},</if> <if test="townName != null and townName != ''">#{townName},</if>
<if test="orgCode != null and orgCode != ''">#{orgCode},</if> <if test="orgCode != null and orgCode != ''">#{orgCode},</if>
<if test="orgName != null and orgName != ''">#{orgName},</if> <if test="orgName != null and orgName != ''">#{orgName},</if>
<if test="bookCount != null">#{bookCount},</if>
<if test="bookId != null">#{bookId},</if>
<if test="bookName != null and bookName != ''">#{bookName},</if>
<if test="orderYear != null and orderYear != ''">#{orderYear},</if>
<if test="orderMonth != null and orderMonth != ''">#{orderMonth},</if>
<if test="voucherCount != null">#{voucherCount},</if> <if test="voucherCount != null">#{voucherCount},</if>
<if test="contractionCount != null">#{contractionCount},</if>
<if test="contracCount != null">#{contracCount},</if>
<if test="assetCount != null">#{assetCount},</if> <if test="assetCount != null">#{assetCount},</if>
<if test="allCount != null">#{allCount},</if> <if test="allCount != null">#{allCount},</if>
<if test="orderYear != null and orderYear != ''">#{orderYear},</if>
<if test="orderMonth != null and orderMonth != ''">#{orderMonth},</if>
<if test="finishCount != null">#{finishCount},</if>
<if test="agentStatus != null and agentStatus != ''">#{agentStatus},</if> <if test="agentStatus != null and agentStatus != ''">#{agentStatus},</if>
<if test="distributionChief != null">#{distributionChief},</if>
<if test="distributionDate != null">#{distributionDate},</if>
<if test="distriUser != null">#{distriUser},</if>
<if test="distriNick != null">#{distriNick},</if>
<if test="distriDate != null">#{distriDate},</if>
<if test="endAt != null">#{endAt},</if> <if test="endAt != null">#{endAt},</if>
<if test="handleAccount != null">#{handleAccount},</if>
<if test="handleUser != null">#{handleUser},</if>
<if test="handleNick != null">#{handleNick},</if>
<if test="handleRemark != null">#{handleRemark},</if>
<if test="handleDate != null">#{handleDate},</if> <if test="handleDate != null">#{handleDate},</if>
<if test="auditAccount != null">#{auditAccount},</if>
<if test="auditUser != null">#{auditUser},</if>
<if test="auditNick != null">#{auditNick},</if>
<if test="auditDate != null">#{auditDate},</if> <if test="auditDate != null">#{auditDate},</if>
<if test="taskScore != null">#{taskScore},</if>
<if test="taskAppraise != null">#{taskAppraise},</if>
<if test="appraiseUser != null">#{appraiseUser},</if>
<if test="appraiseNick != null">#{appraiseNick},</if>
<if test="appraiseScore != null">#{appraiseScore},</if>
<if test="appraiseRemark != null">#{appraiseRemark},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
@@ -153,23 +185,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
town_name, town_name,
org_code, org_code,
org_name, org_name,
book_count,
book_id,
book_name,
order_year,
order_month,
voucher_count, voucher_count,
contraction_count,
contrac_count,
asset_count, asset_count,
all_count, all_count,
order_year,
order_month,
finish_count,
agent_status, agent_status,
distribution_chief,
distribution_date,
distri_user,
distri_nick,
distri_date,
end_at, end_at,
handle_account,
handle_user,
handle_nick,
handle_remark,
handle_date, handle_date,
audit_account,
audit_user,
audit_nick,
audit_date, audit_date,
task_score,
task_appraise,
appraise_user,
appraise_nick,
appraise_score,
appraise_remark,
create_by, create_by,
create_time, create_time,
update_by, update_by,
@@ -185,23 +225,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item.townName}, #{item.townName},
#{item.orgCode}, #{item.orgCode},
#{item.orgName}, #{item.orgName},
#{item.bookCount},
#{item.bookId},
#{item.bookName},
#{item.orderYear},
#{item.orderMonth},
#{item.voucherCount}, #{item.voucherCount},
#{item.contractionCount},
#{item.contracCount},
#{item.assetCount}, #{item.assetCount},
#{item.allCount}, #{item.allCount},
#{item.orderYear},
#{item.orderMonth},
#{item.finishCount},
#{item.agentStatus}, #{item.agentStatus},
#{item.distributionChief},
#{item.distributionDate},
#{item.distriUser},
#{item.distriNick},
#{item.distriDate},
#{item.endAt}, #{item.endAt},
#{item.handleAccount},
#{item.handleUser},
#{item.handleNick},
#{item.handleRemark},
#{item.handleDate}, #{item.handleDate},
#{item.auditAccount},
#{item.auditUser},
#{item.auditNick},
#{item.auditDate}, #{item.auditDate},
#{item.taskScore},
#{item.taskAppraise},
#{item.appraiseUser},
#{item.appraiseNick},
#{item.appraiseScore},
#{item.appraiseRemark},
#{item.createBy}, #{item.createBy},
#{item.createTime}, #{item.createTime},
#{item.updateBy}, #{item.updateBy},
@@ -221,23 +269,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="townName != null and townName != ''">town_name = #{townName},</if> <if test="townName != null and townName != ''">town_name = #{townName},</if>
<if test="orgCode != null and orgCode != ''">org_code = #{orgCode},</if> <if test="orgCode != null and orgCode != ''">org_code = #{orgCode},</if>
<if test="orgName != null and orgName != ''">org_name = #{orgName},</if> <if test="orgName != null and orgName != ''">org_name = #{orgName},</if>
<if test="bookCount != null">book_count = #{bookCount},</if>
<if test="bookId != null">book_id = #{bookId},</if>
<if test="bookName != null and bookName != ''">book_name = #{bookName},</if>
<if test="orderYear != null and orderYear != ''">order_year = #{orderYear},</if>
<if test="orderMonth != null and orderMonth != ''">order_month = #{orderMonth},</if>
<if test="voucherCount != null">voucher_count = #{voucherCount},</if> <if test="voucherCount != null">voucher_count = #{voucherCount},</if>
<if test="contractionCount != null">contraction_count = #{contractionCount},</if>
<if test="contracCount != null">contrac_count = #{contracCount},</if>
<if test="assetCount != null">asset_count = #{assetCount},</if> <if test="assetCount != null">asset_count = #{assetCount},</if>
<if test="allCount != null">all_count = #{allCount},</if> <if test="allCount != null">all_count = #{allCount},</if>
<if test="orderYear != null and orderYear != ''">order_year = #{orderYear},</if>
<if test="orderMonth != null and orderMonth != ''">order_month = #{orderMonth},</if>
<if test="finishCount != null">finish_count = #{finishCount},</if>
<if test="agentStatus != null and agentStatus != ''">agent_status = #{agentStatus},</if> <if test="agentStatus != null and agentStatus != ''">agent_status = #{agentStatus},</if>
<if test="distributionChief != null">distribution_chief = #{distributionChief},</if>
<if test="distributionDate != null">distribution_date = #{distributionDate},</if>
<if test="distriUser != null">distri_user = #{distriUser},</if>
<if test="distriNick != null">distri_nick = #{distriNick},</if>
<if test="distriDate != null">distri_date = #{distriDate},</if>
<if test="endAt != null">end_at = #{endAt},</if> <if test="endAt != null">end_at = #{endAt},</if>
<if test="handleAccount != null">handle_account = #{handleAccount},</if>
<if test="handleUser != null">handle_user = #{handleUser},</if>
<if test="handleNick != null">handle_nick = #{handleNick},</if>
<if test="handleRemark != null">handle_remark = #{handleRemark},</if>
<if test="handleDate != null">handle_date = #{handleDate},</if> <if test="handleDate != null">handle_date = #{handleDate},</if>
<if test="auditAccount != null">audit_account = #{auditAccount},</if>
<if test="auditUser != null">audit_user = #{auditUser},</if>
<if test="auditNick != null">audit_nick = #{auditNick},</if>
<if test="auditDate != null">audit_date = #{auditDate},</if> <if test="auditDate != null">audit_date = #{auditDate},</if>
<if test="taskScore != null">task_score = #{taskScore},</if>
<if test="taskAppraise != null">task_appraise = #{taskAppraise},</if>
<if test="appraiseUser != null">appraise_user = #{appraiseUser},</if>
<if test="appraiseNick != null">appraise_nick = #{appraiseNick},</if>
<if test="appraiseScore != null">appraise_score = #{appraiseScore},</if>
<if test="appraiseRemark != null">appraise_remark = #{appraiseRemark},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
@@ -259,23 +315,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="item.townName != null and item.townName != ''">town_name = #{item.townName},</if> <if test="item.townName != null and item.townName != ''">town_name = #{item.townName},</if>
<if test="item.orgCode != null and item.orgCode != ''">org_code = #{item.orgCode},</if> <if test="item.orgCode != null and item.orgCode != ''">org_code = #{item.orgCode},</if>
<if test="item.orgName != null and item.orgName != ''">org_name = #{item.orgName},</if> <if test="item.orgName != null and item.orgName != ''">org_name = #{item.orgName},</if>
<if test="item.bookCount != null">book_count = #{item.bookCount},</if>
<if test="item.bookId != null">book_id = #{item.bookId},</if>
<if test="item.bookName != null and item.bookName != ''">book_name = #{item.bookName},</if>
<if test="item.orderYear != null and item.orderYear != ''">order_year = #{item.orderYear},</if>
<if test="item.orderMonth != null and item.orderMonth != ''">order_month = #{item.orderMonth},</if>
<if test="item.voucherCount != null">voucher_count = #{item.voucherCount},</if> <if test="item.voucherCount != null">voucher_count = #{item.voucherCount},</if>
<if test="item.contractionCount != null">contraction_count = #{item.contractionCount},</if>
<if test="item.contracCount != null">contrac_count = #{item.contracCount},</if>
<if test="item.assetCount != null">asset_count = #{item.assetCount},</if> <if test="item.assetCount != null">asset_count = #{item.assetCount},</if>
<if test="item.allCount != null">all_count = #{item.allCount},</if> <if test="item.allCount != null">all_count = #{item.allCount},</if>
<if test="item.orderYear != null and item.orderYear != ''">order_year = #{item.orderYear},</if>
<if test="item.orderMonth != null and item.orderMonth != ''">order_month = #{item.orderMonth},</if>
<if test="item.finishCount != null">finish_count = #{item.finishCount},</if>
<if test="item.agentStatus != null and item.agentStatus != ''">agent_status = #{item.agentStatus},</if> <if test="item.agentStatus != null and item.agentStatus != ''">agent_status = #{item.agentStatus},</if>
<if test="item.distributionChief != null">distribution_chief = #{item.distributionChief},</if>
<if test="item.distributionDate != null">distribution_date = #{item.distributionDate},</if>
<if test="item.distriUser != null">distri_user = #{item.distriUser},</if>
<if test="item.distriNick != null">distri_nick = #{item.distriNick},</if>
<if test="item.distriDate != null">distri_date = #{item.distriDate},</if>
<if test="item.endAt != null">end_at = #{item.endAt},</if> <if test="item.endAt != null">end_at = #{item.endAt},</if>
<if test="item.handleAccount != null">handle_account = #{item.handleAccount},</if>
<if test="item.handleUser != null">handle_user = #{item.handleUser},</if>
<if test="item.handleNick != null">handle_nick = #{item.handleNick},</if>
<if test="item.handleRemark != null">handle_remark = #{item.handleRemark},</if>
<if test="item.handleDate != null">handle_date = #{item.handleDate},</if> <if test="item.handleDate != null">handle_date = #{item.handleDate},</if>
<if test="item.auditAccount != null">audit_account = #{item.auditAccount},</if>
<if test="item.auditUser != null">audit_user = #{item.auditUser},</if>
<if test="item.auditNick != null">audit_nick = #{item.auditNick},</if>
<if test="item.auditDate != null">audit_date = #{item.auditDate},</if> <if test="item.auditDate != null">audit_date = #{item.auditDate},</if>
<if test="item.taskScore != null">task_score = #{item.taskScore},</if>
<if test="item.taskAppraise != null">task_appraise = #{item.taskAppraise},</if>
<if test="item.appraiseUser != null">appraise_user = #{item.appraiseUser},</if>
<if test="item.appraiseNick != null">appraise_nick = #{item.appraiseNick},</if>
<if test="item.appraiseScore != null">appraise_score = #{item.appraiseScore},</if>
<if test="item.appraiseRemark != null">appraise_remark = #{item.appraiseRemark},</if>
<if test="item.createBy != null">create_by = #{item.createBy},</if> <if test="item.createBy != null">create_by = #{item.createBy},</if>
<if test="item.createTime != null">create_time = #{item.createTime},</if> <if test="item.createTime != null">create_time = #{item.createTime},</if>
<if test="item.updateBy != null">update_by = #{item.updateBy},</if> <if test="item.updateBy != null">update_by = #{item.updateBy},</if>
@@ -311,23 +375,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="townName != null and townName != ''"> and town_name like concat('%', #{townName}, '%')</if> <if test="townName != null and townName != ''"> and town_name like concat('%', #{townName}, '%')</if>
<if test="orgCode != null and orgCode != ''"> and org_code = #{orgCode}</if> <if test="orgCode != null and orgCode != ''"> and org_code = #{orgCode}</if>
<if test="orgName != null and orgName != ''"> and org_name like concat('%', #{orgName}, '%')</if> <if test="orgName != null and orgName != ''"> and org_name like concat('%', #{orgName}, '%')</if>
<if test="bookCount != null "> and book_count = #{bookCount}</if>
<if test="bookId != null "> and book_id = #{bookId}</if>
<if test="bookName != null and bookName != ''"> and book_name like concat('%', #{bookName}, '%')</if>
<if test="orderYear != null and orderYear != ''"> and order_year = #{orderYear}</if>
<if test="orderMonth != null and orderMonth != ''"> and order_month = #{orderMonth}</if>
<if test="voucherCount != null "> and voucher_count = #{voucherCount}</if> <if test="voucherCount != null "> and voucher_count = #{voucherCount}</if>
<if test="contractionCount != null "> and contraction_count = #{contractionCount}</if>
<if test="contracCount != null "> and contrac_count = #{contracCount}</if>
<if test="assetCount != null "> and asset_count = #{assetCount}</if> <if test="assetCount != null "> and asset_count = #{assetCount}</if>
<if test="allCount != null "> and all_count = #{allCount}</if> <if test="allCount != null "> and all_count = #{allCount}</if>
<if test="orderYear != null and orderYear != ''"> and order_year = #{orderYear}</if>
<if test="orderMonth != null and orderMonth != ''"> and order_month = #{orderMonth}</if>
<if test="finishCount != null "> and finish_count = #{finishCount}</if>
<if test="agentStatus != null and agentStatus != ''"> and agent_status = #{agentStatus}</if> <if test="agentStatus != null and agentStatus != ''"> and agent_status = #{agentStatus}</if>
<if test="distributionChief != null and distributionChief != ''"> and distribution_chief = #{distributionChief}</if>
<if test="distributionDate != null "> and distribution_date = #{distributionDate}</if>
<if test="distriUser != null and distriUser != ''"> and distri_user = #{distriUser}</if>
<if test="distriNick != null and distriNick != ''"> and distri_nick = #{distriNick}</if>
<if test="distriDate != null "> and distri_date = #{distriDate}</if>
<if test="endAt != null and endAt != ''"> and end_at = #{endAt}</if> <if test="endAt != null and endAt != ''"> and end_at = #{endAt}</if>
<if test="handleAccount != null and handleAccount != ''"> and handle_account = #{handleAccount}</if>
<if test="handleUser != null and handleUser != ''"> and handle_user = #{handleUser}</if>
<if test="handleNick != null and handleNick != ''"> and handle_nick = #{handleNick}</if>
<if test="handleRemark != null and handleRemark != ''"> and handle_remark = #{handleRemark}</if>
<if test="handleDate != null "> and handle_date = #{handleDate}</if> <if test="handleDate != null "> and handle_date = #{handleDate}</if>
<if test="auditAccount != null and auditAccount != ''"> and audit_account = #{auditAccount}</if>
<if test="auditUser != null and auditUser != ''"> and audit_user = #{auditUser}</if>
<if test="auditNick != null and auditNick != ''"> and audit_nick = #{auditNick}</if>
<if test="auditDate != null "> and audit_date = #{auditDate}</if> <if test="auditDate != null "> and audit_date = #{auditDate}</if>
<if test="taskScore != null "> and task_score = #{taskScore}</if>
<if test="taskAppraise != null and taskAppraise != ''"> and task_appraise = #{taskAppraise}</if>
<if test="appraiseUser != null and appraiseUser != ''"> and appraise_user = #{appraiseUser}</if>
<if test="appraiseNick != null and appraiseNick != ''"> and appraise_nick = #{appraiseNick}</if>
<if test="appraiseScore != null "> and appraise_score = #{appraiseScore}</if>
<if test="appraiseRemark != null and appraiseRemark != ''"> and appraise_remark = #{appraiseRemark}</if>
</where> </where>
limit 1 limit 1
</select> </select>
@@ -343,23 +415,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="townName != null and townName != ''"> and town_name like concat('%', #{townName}, '%')</if> <if test="townName != null and townName != ''"> and town_name like concat('%', #{townName}, '%')</if>
<if test="orgCode != null and orgCode != ''"> and org_code = #{orgCode}</if> <if test="orgCode != null and orgCode != ''"> and org_code = #{orgCode}</if>
<if test="orgName != null and orgName != ''"> and org_name like concat('%', #{orgName}, '%')</if> <if test="orgName != null and orgName != ''"> and org_name like concat('%', #{orgName}, '%')</if>
<if test="bookCount != null "> and book_count = #{bookCount}</if>
<if test="bookId != null "> and book_id = #{bookId}</if>
<if test="bookName != null and bookName != ''"> and book_name like concat('%', #{bookName}, '%')</if>
<if test="orderYear != null and orderYear != ''"> and order_year = #{orderYear}</if>
<if test="orderMonth != null and orderMonth != ''"> and order_month = #{orderMonth}</if>
<if test="voucherCount != null "> and voucher_count = #{voucherCount}</if> <if test="voucherCount != null "> and voucher_count = #{voucherCount}</if>
<if test="contractionCount != null "> and contraction_count = #{contractionCount}</if>
<if test="contracCount != null "> and contrac_count = #{contracCount}</if>
<if test="assetCount != null "> and asset_count = #{assetCount}</if> <if test="assetCount != null "> and asset_count = #{assetCount}</if>
<if test="allCount != null "> and all_count = #{allCount}</if> <if test="allCount != null "> and all_count = #{allCount}</if>
<if test="orderYear != null and orderYear != ''"> and order_year = #{orderYear}</if>
<if test="orderMonth != null and orderMonth != ''"> and order_month = #{orderMonth}</if>
<if test="finishCount != null "> and finish_count = #{finishCount}</if>
<if test="agentStatus != null and agentStatus != ''"> and agent_status = #{agentStatus}</if> <if test="agentStatus != null and agentStatus != ''"> and agent_status = #{agentStatus}</if>
<if test="distributionChief != null and distributionChief != ''"> and distribution_chief = #{distributionChief}</if>
<if test="distributionDate != null "> and distribution_date = #{distributionDate}</if>
<if test="distriUser != null and distriUser != ''"> and distri_user = #{distriUser}</if>
<if test="distriNick != null and distriNick != ''"> and distri_nick = #{distriNick}</if>
<if test="distriDate != null "> and distri_date = #{distriDate}</if>
<if test="endAt != null and endAt != ''"> and end_at = #{endAt}</if> <if test="endAt != null and endAt != ''"> and end_at = #{endAt}</if>
<if test="handleAccount != null and handleAccount != ''"> and handle_account = #{handleAccount}</if>
<if test="handleUser != null and handleUser != ''"> and handle_user = #{handleUser}</if>
<if test="handleNick != null and handleNick != ''"> and handle_nick = #{handleNick}</if>
<if test="handleRemark != null and handleRemark != ''"> and handle_remark = #{handleRemark}</if>
<if test="handleDate != null "> and handle_date = #{handleDate}</if> <if test="handleDate != null "> and handle_date = #{handleDate}</if>
<if test="auditAccount != null and auditAccount != ''"> and audit_account = #{auditAccount}</if>
<if test="auditUser != null and auditUser != ''"> and audit_user = #{auditUser}</if>
<if test="auditNick != null and auditNick != ''"> and audit_nick = #{auditNick}</if>
<if test="auditDate != null "> and audit_date = #{auditDate}</if> <if test="auditDate != null "> and audit_date = #{auditDate}</if>
<if test="taskScore != null "> and task_score = #{taskScore}</if>
<if test="taskAppraise != null and taskAppraise != ''"> and task_appraise = #{taskAppraise}</if>
<if test="appraiseUser != null and appraiseUser != ''"> and appraise_user = #{appraiseUser}</if>
<if test="appraiseNick != null and appraiseNick != ''"> and appraise_nick = #{appraiseNick}</if>
<if test="appraiseScore != null "> and appraise_score = #{appraiseScore}</if>
<if test="appraiseRemark != null and appraiseRemark != ''"> and appraise_remark = #{appraiseRemark}</if>
</where> </where>
</select> </select>


@@ -375,25 +455,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="townName != null and townName != ''"> and town_name like concat('%', #{townName}, '%')</if> <if test="townName != null and townName != ''"> and town_name like concat('%', #{townName}, '%')</if>
<if test="orgCode != null and orgCode != ''"> and org_code = #{orgCode}</if> <if test="orgCode != null and orgCode != ''"> and org_code = #{orgCode}</if>
<if test="orgName != null and orgName != ''"> and org_name like concat('%', #{orgName}, '%')</if> <if test="orgName != null and orgName != ''"> and org_name like concat('%', #{orgName}, '%')</if>
<if test="bookCount != null "> and book_count = #{bookCount}</if>
<if test="bookId != null "> and book_id = #{bookId}</if>
<if test="bookName != null and bookName != ''"> and book_name like concat('%', #{bookName}, '%')</if>
<if test="orderYear != null and orderYear != ''"> and order_year = #{orderYear}</if>
<if test="orderMonth != null and orderMonth != ''"> and order_month = #{orderMonth}</if>
<if test="voucherCount != null "> and voucher_count = #{voucherCount}</if> <if test="voucherCount != null "> and voucher_count = #{voucherCount}</if>
<if test="contractionCount != null "> and contraction_count = #{contractionCount}</if>
<if test="contracCount != null "> and contrac_count = #{contracCount}</if>
<if test="assetCount != null "> and asset_count = #{assetCount}</if> <if test="assetCount != null "> and asset_count = #{assetCount}</if>
<if test="allCount != null "> and all_count = #{allCount}</if> <if test="allCount != null "> and all_count = #{allCount}</if>
<if test="orderYear != null and orderYear != ''"> and order_year = #{orderYear}</if>
<if test="orderMonth != null and orderMonth != ''"> and order_month = #{orderMonth}</if>
<if test="finishCount != null "> and finish_count = #{finishCount}</if>
<if test="agentStatus != null and agentStatus != ''"> and agent_status = #{agentStatus}</if> <if test="agentStatus != null and agentStatus != ''"> and agent_status = #{agentStatus}</if>
<if test="distributionChief != null and distributionChief != ''"> and distribution_chief = #{distributionChief}</if>
<if test="distributionDate != null "> and distribution_date = #{distributionDate}</if>
<if test="distriUser != null and distriUser != ''"> and distri_user = #{distriUser}</if>
<if test="distriNick != null and distriNick != ''"> and distri_nick = #{distriNick}</if>
<if test="distriDate != null "> and distri_date = #{distriDate}</if>
<if test="endAt != null and endAt != ''"> and end_at = #{endAt}</if> <if test="endAt != null and endAt != ''"> and end_at = #{endAt}</if>
<if test="handleAccount != null and handleAccount != ''"> and handle_account = #{handleAccount}</if>
<if test="handleUser != null and handleUser != ''"> and handle_user = #{handleUser}</if>
<if test="handleNick != null and handleNick != ''"> and handle_nick = #{handleNick}</if>
<if test="handleRemark != null and handleRemark != ''"> and handle_remark = #{handleRemark}</if>
<if test="handleDate != null "> and handle_date = #{handleDate}</if> <if test="handleDate != null "> and handle_date = #{handleDate}</if>
<if test="auditAccount != null and auditAccount != ''"> and audit_account = #{auditAccount}</if>
<if test="auditUser != null and auditUser != ''"> and audit_user = #{auditUser}</if>
<if test="auditNick != null and auditNick != ''"> and audit_nick = #{auditNick}</if>
<if test="auditDate != null "> and audit_date = #{auditDate}</if> <if test="auditDate != null "> and audit_date = #{auditDate}</if>
<if test="taskScore != null "> and task_score = #{taskScore}</if>
<if test="taskAppraise != null and taskAppraise != ''"> and task_appraise = #{taskAppraise}</if>
<if test="appraiseUser != null and appraiseUser != ''"> and appraise_user = #{appraiseUser}</if>
<if test="appraiseNick != null and appraiseNick != ''"> and appraise_nick = #{appraiseNick}</if>
<if test="appraiseScore != null "> and appraise_score = #{appraiseScore}</if>
<if test="appraiseRemark != null and appraiseRemark != ''"> and appraise_remark = #{appraiseRemark}</if>
</where> </where>
limit 1 limit 1
) )
</select> </select>

<!--更新-->
<update id="updateTAgentTaskCount" parameterType="TAgentTask">
update t_agent_task
<trim prefix="SET" suffixOverrides=",">
<if test="voucherCount != null">voucher_count = voucher_count + #{voucherCount},</if>
<if test="contracCount != null">contrac_count = contrac_count + #{contracCount},</if>
<if test="assetCount != null">asset_count = asset_count + #{assetCount},</if>
<if test="finishCount != null">finish_count = finish_count + #{finishCount},</if>
<choose>
<when test="allCount != null">
all_count = all_count + #{allCount},</when>
<otherwise>
all_count = voucher_count + contrac_count + asset_count,
</otherwise>
</choose>
</trim>
where id = #{id}
</update>
</mapper> </mapper>

+ 77
- 2
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java View File

@@ -1,18 +1,23 @@
package com.ruoyi.common.core.domain.entity; package com.ruoyi.common.core.domain.entity;


import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import javax.validation.constraints.Email; import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;

import cn.hutool.core.util.StrUtil;
import com.ruoyi.common.utils.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;


/** /**
* 部门表 sys_dept * 部门表 sys_dept
*
*
* @author ruoyi * @author ruoyi
*/ */
public class SysDept extends BaseEntity public class SysDept extends BaseEntity
@@ -51,7 +56,59 @@ public class SysDept extends BaseEntity


/** 父部门名称 */ /** 父部门名称 */
private String parentName; private String parentName;

/** 行政区划代码 */
private String orgCode;

/** 所属中心 字典 agent_center */
private String agentCenter;

/** 客户地址(推送数据的项目接口地址,区县级维护即可) */
private String remoteUrl;

/** 账套数 */
private Integer bookCount;

public String getRemoteUrl()
{
return remoteUrl;
}

public void setRemoteUrl(String remoteUrl)
{
this.remoteUrl = remoteUrl;
}

public Integer getBookCount()
{
return bookCount;
}

public void setBookCount(Integer bookCount)
{
this.bookCount = bookCount;
}

public String getAgentCenter()
{
return agentCenter;
}

public void setAgentCenter(String agentCenter)
{
this.agentCenter = agentCenter;
}

public String getOrgCode()
{
return orgCode;
}

public void setOrgCode(String orgCode)
{
this.orgCode = orgCode;
}

/** 子部门 */ /** 子部门 */
private List<SysDept> children = new ArrayList<SysDept>(); private List<SysDept> children = new ArrayList<SysDept>();


@@ -200,4 +257,22 @@ public class SysDept extends BaseEntity
.append("updateTime", getUpdateTime()) .append("updateTime", getUpdateTime())
.toString(); .toString();
} }

public List<Long> makeAncestorsIdList(boolean...removeZero)
{
if(StringUtils.isEmpty(ancestors))
return new ArrayList<>();
boolean bRemoveZero = null == removeZero || removeZero.length == 0 || removeZero[0];
return Arrays.stream(StrUtil.split(ancestors, ","))
.filter((x) -> !bRemoveZero || !"0".equals(x))
.map(Long::valueOf)
.collect(Collectors.toList());
}

public int orgCodeLength()
{
if(null == orgCode)
return 0;
return orgCode.length();
}
} }

+ 148
- 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/DeptUtils.java View File

@@ -0,0 +1,148 @@
package com.ruoyi.common.utils;

public final class DeptUtils
{
public static final int LEVEL_INVALID = 0; // 无效
public static final int LEVEL_PROVINCE = 1; // 省
public static final int LEVEL_CITY = 2; // 市
public static final int LEVEL_COUNTY = 3; // 区
public static final int LEVEL_TOWN = 4; // 镇
public static final int LEVEL_VILLAGE = 5; // 村
public static final int LEVEL_GROUP = 6; // 组

public static String[] parseOrgCode(String orgCode)
{
String[] res = new String[7]; // 0-6(0无效), 1省, 2市, 3区, 4镇, 5村, 6组

res[0] = levelStr(LEVEL_INVALID);
if(StringUtils.isEmpty(orgCode))
return res;

int length = orgCode.length();
if(length >= 2)
{
res[1] = orgCode.substring(0, 2);
res[0] = levelStr(LEVEL_PROVINCE);
}
if(length >= 4)
{
res[2] = orgCode.substring(2, 2);
res[0] = levelStr(LEVEL_CITY);
}
if(length >= 6)
{
res[3] = orgCode.substring(4, 6);
res[0] = levelStr(LEVEL_COUNTY);
}
if(length >= 9)
{
res[4] = orgCode.substring(6, 9);
res[0] = levelStr(LEVEL_TOWN);
}
if(length >= 12)
{
res[5] = orgCode.substring(9, 12);
res[0] = levelStr(LEVEL_VILLAGE);
}
if(length >= 16)
{
res[6] = orgCode.substring(12, 16);
res[0] = levelStr(LEVEL_GROUP);
}

return res;
}

public static String[] parseFullOrgCode(String orgCode)
{
String[] res = new String[7]; // 0-6(0无效), 1省, 2市, 3区, 4镇, 5村, 6组

res[0] = levelStr(LEVEL_INVALID);
if(StringUtils.isEmpty(orgCode))
return res;

int length = orgCode.length();
if(length >= 2)
{
res[1] = orgCode.substring(0, 2);
res[0] = levelStr(LEVEL_PROVINCE);
}
if(length >= 4)
{
res[2] = orgCode.substring(0, 2);
res[0] = levelStr(LEVEL_CITY);
}
if(length >= 6)
{
res[3] = orgCode.substring(0, 6);
res[0] = levelStr(LEVEL_COUNTY);
}
if(length >= 9)
{
res[4] = orgCode.substring(0, 9);
res[0] = levelStr(LEVEL_TOWN);
}
if(length >= 12)
{
res[5] = orgCode.substring(0, 12);
res[0] = levelStr(LEVEL_VILLAGE);
}
if(length >= 16)
{
res[6] = orgCode.substring(0, 16);
res[0] = levelStr(LEVEL_GROUP);
}

return res;
}

public static int parseOrgCodeLevel(String orgCode)
{
return StringUtils.isEmpty(orgCode) ? LEVEL_INVALID : parseOrgCodeLevel(orgCode.length());
}


public static int parseOrgCodeLevel(int length)
{
int res = LEVEL_INVALID;

if(length >= 16)
{
res = LEVEL_GROUP;
}
else if(length >= 12)
{
res = LEVEL_VILLAGE;
}
else if(length >= 9)
{
res = LEVEL_TOWN;
}
else if(length >= 6)
{
res = LEVEL_COUNTY;
}
else if(length >= 4)
{
res = LEVEL_CITY;
}
else if(length >= 2)
{
res = LEVEL_PROVINCE;
}

return res;
}

public static String levelStr(int level)
{
return "" + level;
}

public static int levelInt(String level)
{
return null == level ? LEVEL_INVALID : Integer.parseInt(level);
}

private DeptUtils() {}
}

+ 46
- 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/sql/SqlUtil.java View File

@@ -2,6 +2,12 @@ package com.ruoyi.common.utils.sql;


import com.ruoyi.common.exception.UtilException; import com.ruoyi.common.exception.UtilException;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.spring.SpringUtils;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.TransactionStatus;

import java.util.function.Supplier;


/** /**
* sql操作工具类 * sql操作工具类
@@ -58,4 +64,44 @@ public class SqlUtil
} }
} }
} }

public static void transaction(Runnable runnable)
{
PlatformTransactionManager manager = SpringUtils.getBean(PlatformTransactionManager.class);
TransactionDefinition definition = SpringUtils.getBean(TransactionDefinition.class);
TransactionStatus transaction = manager.getTransaction(definition);
try
{
runnable.run();
manager.commit(transaction);
}
catch(Exception e)
{
e.printStackTrace();
manager.rollback(transaction);
throw new RuntimeException(e);
}
}

public static <T> T transaction(Supplier<T> runnable, T...ifExceptRet)
{
PlatformTransactionManager manager = SpringUtils.getBean(PlatformTransactionManager.class);
TransactionDefinition definition = SpringUtils.getBean(TransactionDefinition.class);
TransactionStatus transaction = manager.getTransaction(definition);
try
{
T res = runnable.get();
manager.commit(transaction);
return res;
}
catch(Exception e)
{
e.printStackTrace();
manager.rollback(transaction);
if(null != ifExceptRet && ifExceptRet.length > 0)
return ifExceptRet[0];
else
throw new RuntimeException(e);
}
}
} }

+ 7
- 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java View File

@@ -115,4 +115,11 @@ public interface SysDeptMapper
* @return 结果 * @return 结果
*/ */
public int deleteDeptById(Long deptId); public int deleteDeptById(Long deptId);
/**
* 条件单条查询部门
*
* @param sysDept 部门
* @return 部门条目
*/
public SysDept selectSysDept(SysDept sysDept);
} }

+ 7
- 0
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java View File

@@ -121,4 +121,11 @@ public interface ISysDeptService
* @return 结果 * @return 结果
*/ */
public int deleteDeptById(Long deptId); public int deleteDeptById(Long deptId);
/**
* 条件单条查询部门
*
* @param sysDept 部门
* @return 部门条目
*/
public SysDept selectSysDept(SysDept sysDept);
} }

+ 10
- 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java View File

@@ -335,4 +335,14 @@ public class SysDeptServiceImpl implements ISysDeptService
{ {
return getChildList(list, t).size() > 0; return getChildList(list, t).size() > 0;
} }
/**
* 单条条件查询部门
*
* @param sysDept 部门
* @return 部门条目
*/
@Override
public SysDept selectSysDept(SysDept sysDept) {
return deptMapper.selectSysDept(sysDept);
}
} }

+ 41
- 19
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml View File

@@ -5,27 +5,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.ruoyi.system.mapper.SysDeptMapper"> <mapper namespace="com.ruoyi.system.mapper.SysDeptMapper">


<resultMap type="SysDept" id="SysDeptResult"> <resultMap type="SysDept" id="SysDeptResult">
<id property="deptId" column="dept_id" />
<result property="parentId" column="parent_id" />
<result property="ancestors" column="ancestors" />
<result property="deptName" column="dept_name" />
<result property="orderNum" column="order_num" />
<result property="leader" column="leader" />
<result property="phone" column="phone" />
<result property="email" column="email" />
<result property="status" column="status" />
<result property="deptId" column="dept_id" />
<result property="parentId" column="parent_id" />
<result property="ancestors" column="ancestors" />
<result property="deptName" column="dept_name" />
<result property="agentCenter" column="agent_center" />
<result property="orgCode" column="org_code" />
<result property="remoteUrl" column="remote_url" />
<result property="bookCount" column="book_count" />
<result property="orderNum" column="order_num" />
<result property="leader" column="leader" />
<result property="phone" column="phone" />
<result property="email" column="email" />
<result property="status" column="status" />
<result property="delFlag" column="del_flag" /> <result property="delFlag" column="del_flag" />
<result property="parentName" column="parent_name" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap> </resultMap>
<sql id="selectDeptVo"> <sql id="selectDeptVo">
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
from sys_dept d
</sql>
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.agent_center, d.org_code, d.remote_url, d.book_count, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time, d.update_by, d.update_time
from sys_dept d
</sql>
<select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult"> <select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
<include refid="selectDeptVo"/> <include refid="selectDeptVo"/>
@@ -59,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult"> <select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status,
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.agent_center, d.org_code, d.remote_url, d.book_count, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time, d.update_by, d.update_time,
(select dept_name from sys_dept where dept_id = d.parent_id) parent_name (select dept_name from sys_dept where dept_id = d.parent_id) parent_name
from sys_dept d from sys_dept d
where d.dept_id = #{deptId} where d.dept_id = #{deptId}
@@ -156,4 +159,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update sys_dept set del_flag = '2' where dept_id = #{deptId} update sys_dept set del_flag = '2' where dept_id = #{deptId}
</delete> </delete>


<!--单条条件查询-->
<select id="selectSysDept" parameterType="SysDept" resultMap="SysDeptResult">
<include refid="selectDeptVo"/>
<where>
<if test="parentId != null "> and parent_id = #{parentId}</if>
<if test="ancestors != null and ancestors != ''"> and ancestors = #{ancestors}</if>
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
<if test="agentCenter != null and agentCenter != ''"> and agent_center = #{agentCenter}</if>
<if test="orgCode != null and orgCode != ''"> and org_code = #{orgCode}</if>
<if test="remoteUrl != null and remoteUrl != ''"> and remote_url = #{remoteUrl}</if>
<if test="bookCount != null "> and book_count = #{bookCount}</if>
<if test="orderNum != null "> and order_num = #{orderNum}</if>
<if test="leader != null and leader != ''"> and leader = #{leader}</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="email != null and email != ''"> and email = #{email}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
limit 1
</select>
</mapper> </mapper>

Loading…
Cancel
Save