Browse Source

清理禅道13号bug

v2
蟑螂恶霸 2 years ago
parent
commit
508b2e39cc
  1. 2
      lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnterpriseComplaintController.java
  2. 2
      lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnterpriseLawEnforcementController.java
  3. 13
      lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppThirdLoginController.java
  4. 2
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/common/constant/UserConstants.java
  5. 2
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/framework/config/ShiroConfig.java
  6. 1
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/framework/config/XssAndSqlHttpServletRequestWrapper.java
  7. 10
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnforcementInspectionProgram.java
  8. 48
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnterpriseComplaint.java
  9. 9
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnterpriseInformation.java
  10. 9
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnterpriseLawEnforcement.java
  11. 2
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementInspectionProgramServiceImpl.java
  12. 2
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseComplaintServiceImpl.java
  13. 1
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseLawEnforcementServiceImpl.java
  14. 4
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/ThirdLoginServiceImpl.java
  15. 36
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml
  16. 8
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnterpriseInformationMapper.xml
  17. 23
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnterpriseLawEnforcementMapper.xml

2
lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnterpriseComplaintController.java

@ -60,7 +60,7 @@ public class AppEnterpriseComplaintController extends BaseController
/**
* 新增保存企业执法-在线投诉
*/
@RequiresPermissions("code:complaint:add")
// @RequiresPermissions("code:complaint:add")
@PostMapping("/add")
@ResponseBody
public ZDResponse addSave(@RequestBody EnterpriseComplaint enterpriseComplaint)

2
lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnterpriseLawEnforcementController.java

@ -1,5 +1,7 @@
package com.zdxt.app.controller;
import com.zdxt.auth.dto.UserBean;
import com.zdxt.auth.feign.UserApi;
import com.zdxt.code.domain.EnterpriseLawEnforcement;
import com.zdxt.code.domain.LinkageDict;
import com.zdxt.code.service.IEnterpriseLawEnforcementService;

13
lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppThirdLoginController.java

@ -12,6 +12,7 @@ import com.zdxt.code.service.ThirdLoginService;
import com.zdxt.code.utils.HttpUtil;
import com.zdxt.code.utils.IdCardCryptoUtil;
import com.zdxt.common.ZDResponse;
import com.zdxt.common.util.RedisCache;
import com.zdxt.domain.auth.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -52,6 +53,8 @@ public class AppThirdLoginController {
@Autowired
private UserApi userApi;
@Autowired
private RedisCache redisCache;
/**
* 深圳易平台登录
@ -59,6 +62,11 @@ public class AppThirdLoginController {
@GetMapping("/szyptLogin/{code}")
@ResponseBody
public ZDResponse szyptLogin(@PathVariable String code){
System.out.println("====================== code ======================");
System.out.println(code);
System.out.println("====================== code ======================");
String accessToken = "";
String userInfo = "";
try {
@ -73,13 +81,12 @@ public class AppThirdLoginController {
System.out.println("====================== userInfo ======================");
System.out.println(userInfo);
System.out.println("====================== userInfo ======================");
redisCache.setCacheObject("shiro:app:1731", new User()); // todo:这里需要将转换出来的User存redis用于做权限
} catch (Exception e) {
e.printStackTrace();
}
JSONObject jsonObject = JSONObject.parseObject(userInfo);
System.out.println("====================== userInfo ======================");
System.out.println(jsonObject);
System.out.println("====================== userInfo ======================");
return ZDResponse.success();
}

2
lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/common/constant/UserConstants.java

@ -32,7 +32,7 @@ public class UserConstants
* 用户名长度限制
*/
public static final int USERNAME_MIN_LENGTH = 2;
public static final int USERNAME_MAX_LENGTH = 20;
public static final int USERNAME_MAX_LENGTH = 30;
/** 登录名称是否唯一的返回结果码 */
public final static String USER_NAME_UNIQUE = "0";

2
lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/framework/config/ShiroConfig.java

@ -288,6 +288,8 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/app/**", "anon");
filterChainDefinitionMap.put("/app-z/**", "anon");
filterChainDefinitionMap.put("/Cesium-1.95/**", "anon");
// 临时放开附件, 不然浏览器玩不了
filterChainDefinitionMap.put("/common/upload", "anon");
filterChainDefinitionMap.put("/api/**", "anon");
filterChainDefinitionMap.put("/auth-center/**", "anon");

1
lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/framework/config/XssAndSqlHttpServletRequestWrapper.java

@ -295,6 +295,7 @@ public class XssAndSqlHttpServletRequestWrapper extends HttpServletRequestWrappe
Map<String, String[]> submitParams = new HashMap(parameterMap);
Set<String> submitNames = submitParams.keySet();
for (String submitName : submitNames) {
if ("cronExpression".equals(submitName)) { return false; }
Object submitValues = submitParams.get(submitName);
if ((submitValues instanceof String)) {
if (checkXSSAndSql((String) submitValues)) {

10
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnforcementInspectionProgram.java

@ -49,6 +49,8 @@ public class EnforcementInspectionProgram extends BaseDomain
*/
private List<FileObject> fileList;
private List<FileObject> fileListObj;
/**
* 执法计划
*/
@ -204,6 +206,14 @@ public class EnforcementInspectionProgram extends BaseDomain
this.isPublish = isPublish;
}
public List<FileObject> getFileListObj() {
return fileListObj;
}
public void setFileListObj(List<FileObject> fileListObj) {
this.fileListObj = fileListObj;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

48
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnterpriseComplaint.java

@ -40,7 +40,53 @@ public class EnterpriseComplaint extends BaseDomain
*/
private List<String> fileList;
public void setId(String id)
public String enterpriseNumber;
public String lawEnforcementIncident;
public String enforceTypeText;
public String enterpriseName;
private List fileListObj;
public String getEnforceTypeText() {
return enforceTypeText;
}
public void setEnforceTypeText(String enforceTypeText) {
this.enforceTypeText = enforceTypeText;
}
public String getEnterpriseNumber() {
return enterpriseNumber;
}
public void setEnterpriseNumber(String enterpriseNumber) {
this.enterpriseNumber = enterpriseNumber;
}
public List getFileListObj() {
return fileListObj;
}
public void setFileListObj(List fileListObj) {
this.fileListObj = fileListObj;
}
public String getEnterpriseName() {
return enterpriseName;
}
public void setEnterpriseName(String enterpriseName) {
this.enterpriseName = enterpriseName;
}
public String getLawEnforcementIncident() {
return lawEnforcementIncident;
}
public void setLawEnforcementIncident(String lawEnforcementIncident) {
this.lawEnforcementIncident = lawEnforcementIncident;
}
public void setId(String id)
{
this.id = id;
}

9
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnterpriseInformation.java

@ -28,6 +28,7 @@ public class EnterpriseInformation extends BaseDomain
/** 企业类型 */
private String enterpriseType;
private String companyOrgType;
/** 企业地址 */
private String enterpriseAddress;
@ -219,6 +220,14 @@ public class EnterpriseInformation extends BaseDomain
this.enterpriseTel = enterpriseTel;
}
public String getCompanyOrgType() {
return companyOrgType;
}
public void setCompanyOrgType(String companyOrgType) {
this.companyOrgType = companyOrgType;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

9
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnterpriseLawEnforcement.java

@ -99,6 +99,15 @@ public class EnterpriseLawEnforcement extends BaseDomain
private String lawEnforcerText;
private String lawCertificateNumTwo;
private String lawEnforcerTextTwo;
private String dataScopeId;
public String getDataScopeId() {
return dataScopeId;
}
public void setDataScopeId(String dataScopeId) {
this.dataScopeId = dataScopeId;
}
public String getLawEnforcerTextTwo() {
return lawEnforcerTextTwo;

2
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementInspectionProgramServiceImpl.java

@ -98,7 +98,7 @@ public class EnforcementInspectionProgramServiceImpl implements IEnforcementInsp
{
enforcementInspectionProgram.setCreateTime(DateUtils.getNowDate());
UserBean user = userApi.getCurrentUser();
UserBean user = userApi.getUserByUserId(enforcementInspectionProgram.getUserId());
enforcementInspectionProgram.setCreateTime(DateUtils.getNowDate());
enforcementInspectionProgram.setId(IdUtil.simpleUUID());
enforcementInspectionProgram.setUserId(user.getUserId());

2
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseComplaintServiceImpl.java

@ -71,7 +71,7 @@ public class EnterpriseComplaintServiceImpl implements IEnterpriseComplaintServi
@Override
public int insertEnterpriseComplaint(EnterpriseComplaint enterpriseComplaint)
{
UserBean user = userApi.getCurrentUser();
UserBean user = userApi.getUserByUserId(enterpriseComplaint.getUserId());
enterpriseComplaint.setCreateTime(DateUtils.getNowDate());
enterpriseComplaint.setId(IdUtil.simpleUUID());
int i = enterpriseComplaintMapper.insertEnterpriseComplaint(enterpriseComplaint);

1
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseLawEnforcementServiceImpl.java

@ -12,6 +12,7 @@ import com.zdxt.code.domain.EnterpriseMerchantAuthorization;
import com.zdxt.code.domain.LinkageDict;
import com.zdxt.code.service.IEnterpriseMerchantAuthorizationService;
import com.zdxt.code.service.ILinkageDictService;
import com.zdxt.common.annotation.DataScope;
import com.zdxt.common.util.DateUtils;
import com.zdxt.common.util.StringUtils;
import com.zdxt.common.zdxtFile.ZdxtFileCommon;

4
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/ThirdLoginServiceImpl.java

@ -106,6 +106,10 @@ public class ThirdLoginServiceImpl implements ThirdLoginService {
enterpriseInformation.setEnterpriseNumber(jsonObject.getString("corpCid"));
//企业名称
enterpriseInformation.setEnterpriseName(jsonObject.getString("corpName"));
//企业类型
enterpriseInformation.setCompanyOrgType(jsonObject.getString("companyOrgType"));
//注册时间
enterpriseInformation.setEstablishmentTime(jsonObject.getSqlDate("establishDate"));
//经营范围
enterpriseInformation.setBusinessScope(jsonObject.getString("businessScope"));
//注册地址

36
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml

@ -73,43 +73,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null "> and status = #{status}</if>
<if test="lawEnforcementCode != null and lawEnforcementCode != ''"> and law_enforcement_code = #{lawEnforcementCode}</if>
<if test="searchValue != null and searchValue != ''">
and ( law_enforcement_item like concat(concat('%',#{searchValue}),'%')
and ( law_enforcement_item in (SELECT id FROM linkage_dict where title like concat(concat('%',#{searchValue}),'%'))
or law_enforcement like concat(concat('%',#{searchValue}),'%')
or law_enforcer like concat(concat('%',#{searchValue}),'%')
or law_enforcer_two like concat(concat('%',#{searchValue}),'%')
or enterprise_name like concat(concat('%',#{searchValue}),'%')
)
</if>
<if test="dateType != null and dateType == 1">
and DATE_FORMAT(create_time, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m')
and DATE_FORMAT(enforcement_time, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m')
</if>
<if test="dateType != null and dateType == 2">
and create_time >= CONCAT(YEAR(CURDATE()), '-', QUARTER(CURDATE()), '-01')
and create_time &lt;= CONCAT(YEAR(CURDATE()), '-',
and enforcement_time >= CONCAT(YEAR(CURDATE()), '-',
CASE WHEN QUARTER(CURDATE()) IN (1) THEN 2
WHEN QUARTER(CURDATE()) IN (2) THEN 4
WHEN QUARTER(CURDATE()) IN (3) THEN 7
ELSE 10 END, '-01')
and enforcement_time &lt;= CONCAT(YEAR(CURDATE()), '-',
CASE
WHEN QUARTER(CURDATE()) IN (1, 2, 3) THEN 3
WHEN QUARTER(CURDATE()) IN (4, 5, 6) THEN 6
WHEN QUARTER(CURDATE()) IN (7, 8, 9) THEN 9
WHEN QUARTER(CURDATE()) IN (1) THEN 3
WHEN QUARTER(CURDATE()) IN (2) THEN 6
WHEN QUARTER(CURDATE()) IN (3) THEN 9
ELSE 12
END,
'-',
DAY(LAST_DAY(CURDATE())))
</if>
<if test="dateType != null and dateType == 3">
and DATE_FORMAT(create_time, '%Y') = DATE_FORMAT(CURDATE(), '%Y')
and DATE_FORMAT(enforcement_time, '%Y') = DATE_FORMAT(CURDATE(), '%Y')
</if>
<if test="dateSearch != null and dateSearch != ''">
and DATE_FORMAT(create_time, '%Y-%m') = #{dateSearch}
</if>
<if test="beginTime != null and beginTime != ''">
and DATE_FORMAT(create_time, '%Y-%m') <![CDATA[ >= ]]> #{beginTime}
</if>
<if test="endTime != null and endTime != ''">
and DATE_FORMAT(create_time, '%Y-%m') <![CDATA[ <= ]]> #{endTime}
</if>
<if test="params.beginEnforcementTime != null and params.beginEnforcementTime != ''">
AND create_time <![CDATA[ >= ]]> #{params.beginEnforcementTime}
</if>
<if test="params.endEnforcementTime != null and params.endEnforcementTime != ''">
AND create_time <![CDATA[ <= ]]> #{params.endEnforcementTime}
and DATE_FORMAT(enforcement_time, '%Y-%m') = #{dateSearch}
</if>
</where>
order by create_time desc

8
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnterpriseInformationMapper.xml

@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="enterpriseName" column="enterprise_name" />
<result property="enterpriseNumber" column="enterprise_number" />
<result property="enterpriseType" column="enterprise_type" />
<result property="companyOrgType" column="company_org_type" />
<result property="enterpriseAddress" column="enterprise_address" />
<result property="legalPerson" column="legal_person" />
<result property="registeredCapital" column="registered_capital" />
@ -26,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectEnterpriseInformationVo">
select id, enterprise_name, enterprise_number, enterprise_type, enterprise_address, legal_person, registered_capital, establishment_time,
select id, enterprise_name, enterprise_number, enterprise_type, company_org_type, enterprise_address, legal_person, registered_capital, establishment_time,
operating_term, business_scope, create_time, create_by, user_id, dept_id,is_unsubscribe ,is_delete,salt,enterprise_tel from enterprise_information
</sql>
@ -36,6 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<if test="enterpriseNumber != null and enterpriseNumber != ''"> and enterprise_number like concat('%', #{enterpriseNumber}, '%')</if>
<if test="enterpriseType != null and enterpriseType != ''"> and enterprise_type = #{enterpriseType}</if>
<if test="companyOrgType != null and companyOrgType != ''"> and company_org_type = #{companyOrgType}</if>
<if test="enterpriseAddress != null and enterpriseAddress != ''"> and enterprise_address = #{enterpriseAddress}</if>
<if test="legalPerson != null and legalPerson != ''"> and legal_person = #{legalPerson}</if>
<if test="registeredCapital != null and registeredCapital != ''"> and registered_capital = #{registeredCapital}</if>
@ -71,6 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="enterpriseName != null and enterpriseName != ''">enterprise_name,</if>
<if test="enterpriseNumber != null and enterpriseNumber != ''">enterprise_number,</if>
<if test="enterpriseType != null and enterpriseType != ''">enterprise_type,</if>
<if test="companyOrgType != null and companyOrgType != ''">company_org_type,</if>
<if test="enterpriseAddress != null and enterpriseAddress != ''">enterprise_address,</if>
<if test="legalPerson != null and legalPerson != ''">legal_person,</if>
<if test="registeredCapital != null and registeredCapital != ''">registered_capital,</if>
@ -90,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="enterpriseName != null and enterpriseName != ''">#{enterpriseName},</if>
<if test="enterpriseNumber != null and enterpriseNumber != ''">#{enterpriseNumber},</if>
<if test="enterpriseType != null and enterpriseType != ''">#{enterpriseType},</if>
<if test="companyOrgType != null and companyOrgType != ''">#{companyOrgType},</if>
<if test="enterpriseAddress != null and enterpriseAddress != ''">#{enterpriseAddress},</if>
<if test="legalPerson != null and legalPerson != ''">#{legalPerson},</if>
<if test="registeredCapital != null and registeredCapital != ''">#{registeredCapital},</if>
@ -112,6 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="SET" suffixOverrides=",">
<if test="enterpriseName != null and enterpriseName != ''">enterprise_name = #{enterpriseName},</if>
<if test="enterpriseType != null and enterpriseType != ''">enterprise_type = #{enterpriseType},</if>
<if test="companyOrgType != null and companyOrgType != ''">company_org_type = #{companyOrgType},</if>
<if test="enterpriseAddress != null and enterpriseAddress != ''">enterprise_address = #{enterpriseAddress},</if>
<if test="legalPerson != null and legalPerson != ''">legal_person = #{legalPerson},</if>
<if test="registeredCapital != null and registeredCapital != ''">registered_capital = #{registeredCapital},</if>
@ -130,6 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="SET" suffixOverrides=",">
<if test="enterpriseName != null and enterpriseName != ''">enterprise_name = #{enterpriseName},</if>
<if test="enterpriseType != null and enterpriseType != ''">enterprise_type = #{enterpriseType},</if>
<if test="companyOrgType != null and companyOrgType != ''">company_org_type = #{companyOrgType},</if>
<if test="enterpriseAddress != null and enterpriseAddress != ''">enterprise_address = #{enterpriseAddress},</if>
<if test="legalPerson != null and legalPerson != ''">legal_person = #{legalPerson},</if>
<if test="registeredCapital != null and registeredCapital != ''">registered_capital = #{registeredCapital},</if>

23
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnterpriseLawEnforcementMapper.xml

@ -40,7 +40,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<if test="checkTime != null "> and check_time = #{checkTime}</if>
<if test="lawEnforcer != null and lawEnforcer != ''"> and law_enforcer = #{lawEnforcer}</if>
<if test="lawEnforcerId != null "> and law_enforcer_id = #{lawEnforcerId}</if>
<if test="lawEnforcerTel != null and lawEnforcerTel != ''"> and law_enforcer_tel = #{lawEnforcerTel}</if>
<if test="status != null"> and status = #{lawEnforcerTel}</if>
<if test="isSubmit != null "> and is_submit = #{isSubmit}</if>
@ -59,31 +58,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="searchValue != null and searchValue != ''">
and ( enterprise_name like concat(concat('%',#{searchValue}),'%')
or check_item like concat(concat('%',#{searchValue}),'%')
or check_item in (SELECT id FROM linkage_dict where title like concat(concat('%',#{searchValue}),'%'))
or law_enforcement_code like concat(concat('%',#{searchValue}),'%')
or law_enforcement like concat(concat('%',#{searchValue}),'%')
)
</if>
<if test="dateType != null and dateType == 1">
and DATE_FORMAT(create_time, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m')
and DATE_FORMAT(check_time, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m')
</if>
<if test="dateType != null and dateType == 2">
and create_time >= CONCAT(YEAR(CURDATE()), '-', QUARTER(CURDATE()), '-01')
and create_time &lt;= CONCAT(YEAR(CURDATE()), '-',
and check_time >= CONCAT(YEAR(CURDATE()), '-',
CASE WHEN QUARTER(CURDATE()) IN (1) THEN 2
WHEN QUARTER(CURDATE()) IN (2) THEN 4
WHEN QUARTER(CURDATE()) IN (3) THEN 7
ELSE 10 END, '-01')
and check_time &lt;= CONCAT(YEAR(CURDATE()), '-',
CASE
WHEN QUARTER(CURDATE()) IN (1, 2, 3) THEN 3
WHEN QUARTER(CURDATE()) IN (4, 5, 6) THEN 6
WHEN QUARTER(CURDATE()) IN (7, 8, 9) THEN 9
WHEN QUARTER(CURDATE()) IN (1) THEN 3
WHEN QUARTER(CURDATE()) IN (2) THEN 6
WHEN QUARTER(CURDATE()) IN (3) THEN 9
ELSE 12
END,
'-',
DAY(LAST_DAY(CURDATE())))
</if>
<if test="dateType != null and dateType == 3">
and DATE_FORMAT(create_time, '%Y') = DATE_FORMAT(CURDATE(), '%Y')
and DATE_FORMAT(check_time, '%Y') = DATE_FORMAT(CURDATE(), '%Y')
</if>
<if test="searchDate != null and searchDate != ''">
and DATE_FORMAT(create_time, '%Y-%m') = #{searchDate}
and DATE_FORMAT(check_time, '%Y-%m') = #{searchDate}
</if>
</where>
order by create_time desc

Loading…
Cancel
Save