| | |
| | | Map<String, Object> templateParam = new HashMap<>(5); |
| | | fill(templateParam, "contractNumber", contract.getContractNumber()); |
| | | fill(templateParam, "partyOneName", contract.getPartyOneName()); |
| | | fill(templateParam, "partyTwoName", contract.getPartyTwoName()); |
| | | |
| | | |
| | | if (Objects.nonNull(tenant)) { |
| | | fill(templateParam, "mailAddress", tenant.getMailAddress()); |
| | |
| | | fill(templateParam, "residentName", tenant.getResidentName()); |
| | | fill(templateParam, "bankNumber", tenant.getBankNumber()); |
| | | fill(templateParam, "bankName", tenant.getBankName()); |
| | | fill(templateParam, "partyTwoName", tenant.getLessee()); |
| | | |
| | | // 企业、政府机构、国有企业 |
| | | if (Objects.nonNull(tenant.getTenantType()) |
| | |
| | | @ApiOperation(value = "获取合同分页列表") |
| | | @GetMapping(value = "/contractListByTenantId") |
| | | public R<List<TContract>> contractListByTenantId(@RequestParam String tenantId) { |
| | | return R.ok(contractService.list(Wrappers.lambdaQuery(TContract.class).eq(TContract::getTenantId, tenantId))); |
| | | String businessDeptId = SecurityUtils.getBusinessDeptId(); |
| | | return R.ok(contractService.list(Wrappers.lambdaQuery(TContract.class) |
| | | .eq(!businessDeptId.equals("0"), TContract::getBusinessDeptId, businessDeptId) |
| | | .eq(TContract::getTenantId, tenantId))); |
| | | } |
| | | |
| | | /** |
| | |
| | | <if test="query.userId != null and query.userId !=''"> |
| | | and t.id = #{query.userId} |
| | | </if> |
| | | <if test='query.businessDeptId != null and query.businessDeptId != "" and query.businessDeptId!="0"'> |
| | | <if test='query.businessDeptId != null and query.businessDeptId != "" and query.businessDeptId!=0'> |
| | | and b.business_dept_id = #{query.businessDeptId} |
| | | </if> |
| | | <if test="query.billType != null"> |
| | |
| | | SELECT COUNT(DISTINCT tc.tenant_id) AS new_tenant_count |
| | | FROM t_contract tc |
| | | <where> |
| | | <if test="businessDeptId!=0"> |
| | | AND tc.business_dept_id = #{businessDeptId} |
| | | </if> |
| | | -- 筛选本月签订的合同 |
| | | AND DATE_FORMAT(tc.sign_time, '%Y%m') = DATE_FORMAT(CURDATE(), '%Y%m') AND tc.status IN ("4", "5", "6", "7", "8", "9") |
| | | DATE_FORMAT(tc.sign_time, '%Y%m') = DATE_FORMAT(CURDATE(), '%Y%m') AND tc.status IN ("4", "5", "6", "7", "8", "9") |
| | | -- 且租户在本月前从未签订过任何合同 |
| | | AND NOT EXISTS ( |
| | | SELECT 1 |
| | |
| | | WHERE tc_hist.tenant_id = tc.tenant_id |
| | | AND tc_hist.sign_time <![CDATA[ < ]]> DATE_FORMAT(CURDATE(), '%Y-%m-01') AND tc_hist.status IN ("4", "5", "6", "7", "8", "9") |
| | | ) |
| | | <if test="businessDeptId!=0"> |
| | | AND tc.business_dept_id = #{businessDeptId} |
| | | </if> |
| | | </where> |
| | | |
| | | </select> |