fix:十二分制-申请单
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.dao.tp;
|
||||
|
||||
import com.alibaba.excel.util.CollectionUtils;
|
||||
import com.cool.store.entity.tp.TpApplyFormDO;
|
||||
import com.cool.store.enums.tp.TpFormStatusEnum;
|
||||
import com.cool.store.enums.tp.TpFormTypeEnum;
|
||||
@@ -11,6 +12,7 @@ import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -73,6 +75,13 @@ public class TpApplyFormDAO {
|
||||
return tpApplyFormMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询有效申请单
|
||||
*/
|
||||
public TpApplyFormDO getEffectiveById(Long id) {
|
||||
return tpApplyFormMapper.selectOne(TpApplyFormDO.builder().id(id).deleted(0).build());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询有效记录列表
|
||||
* @param request 申请单查询Request
|
||||
@@ -118,4 +127,35 @@ public class TpApplyFormDAO {
|
||||
}
|
||||
return tpApplyFormMapper.selectCountByExample(example) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据处罚单id查询申请单
|
||||
* @param penaltyId 处罚单id
|
||||
* @return 申请单
|
||||
*/
|
||||
public TpApplyFormDO getByPenaltyId(Long penaltyId) {
|
||||
return tpApplyFormMapper.selectOne(TpApplyFormDO.builder().penaltyId(penaltyId).deleted(0).build());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id列表查询
|
||||
*/
|
||||
public List<TpApplyFormDO> getByIds(List<Long> ids) {
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
Example example = new Example(TpApplyFormDO.class);
|
||||
example.createCriteria().andIn("id", ids);
|
||||
return tpApplyFormMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请单作废
|
||||
* @param applyId 申请单id
|
||||
*/
|
||||
public void cancelApply(Long applyId) {
|
||||
Example example = new Example(TpApplyFormDO.class);
|
||||
example.createCriteria().andEqualTo("id", applyId).andEqualTo("deleted", 0);
|
||||
tpApplyFormMapper.updateByExampleSelective(TpApplyFormDO.builder().status(TpFormStatusEnum.CANCEL.getStatus()).build(), example);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.cool.store.mapper.tp;
|
||||
|
||||
import com.cool.store.entity.tp.TpAppealFormDO;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
public interface TpAppealFormMapper extends Mapper<TpAppealFormDO> {
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.tp.TpAppealFormMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.tp.TpAppealFormDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="apply_no" jdbcType="VARCHAR" property="applyNo" />
|
||||
<result column="punish_id" jdbcType="BIGINT" property="punishId" />
|
||||
<result column="store_id" jdbcType="VARCHAR" property="storeId" />
|
||||
<result column="applicant_name" jdbcType="VARCHAR" property="applicantName" />
|
||||
<result column="phone" jdbcType="VARCHAR" property="phone" />
|
||||
<result column="appeal_reason" jdbcType="VARCHAR" property="appealReason" />
|
||||
<result column="detail_reason" jdbcType="VARCHAR" property="detailReason" />
|
||||
<result column="status" jdbcType="BIT" property="status" />
|
||||
<result column="source" jdbcType="BIT" property="source" />
|
||||
<result column="approve_user_id" jdbcType="VARCHAR" property="approveUserId" />
|
||||
<result column="approve_time" jdbcType="TIMESTAMP" property="approveTime" />
|
||||
<result column="is_draft" jdbcType="TINYINT" property="isDraft" />
|
||||
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||
<result column="proof_urls" jdbcType="LONGVARCHAR" property="proofUrls" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
@@ -31,12 +31,18 @@
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||
<result column="proof_urls" jdbcType="LONGVARCHAR" property="proofUrls" />
|
||||
<result column="penalty_id" jdbcType="BIGINT" property="penaltyId" />
|
||||
<result column="applicant_name" jdbcType="VARCHAR" property="applicantName" />
|
||||
<result column="phone" jdbcType="VARCHAR" property="phone" />
|
||||
<result column="appeal_reason" jdbcType="VARCHAR" property="appealReason" />
|
||||
<result column="appeal_detail_reason" jdbcType="VARCHAR" property="appealDetailReason" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, type, apply_no, store_id, rule_id, rule_no, problem_classification, project_category, project_name,
|
||||
is_full, score, remark, amount, appeal_end_date, status, pay_status, is_draft, source, apply_user_id,
|
||||
apply_user_name, approve_user_id, approve_time, create_time, update_time, deleted, proof_urls
|
||||
apply_user_name, approve_user_id, approve_time, create_time, update_time, deleted, proof_urls,
|
||||
penalty_id, applicant_name, phone, appeal_reason, appeal_detail_reason
|
||||
</sql>
|
||||
|
||||
<select id="getEffectiveList" parameterType="com.cool.store.request.tp.TpApplyQueryRequest" resultMap="BaseResultMap">
|
||||
@@ -74,6 +80,9 @@
|
||||
AND (b.store_name LIKE CONCAT('%', #{storeNameOrNum}, '%')
|
||||
OR b.store_num LIKE CONCAT('%', #{storeNameOrNum}, '%')
|
||||
</if>
|
||||
<if test="appealReason != null and appealReason != ''">
|
||||
AND b.appeal_reason LIKE CONCAT('%', #{appealReason}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user