liuyu
21 小时以前 6eef0b6730d940ef44e0f66dd8e7d178f1cd2d1f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package jnpf.tmsMapper;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.tmsEntity.TmsTaskEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
 
@Mapper
public interface TmsTaskMapper extends BaseMapper<TmsTaskEntity> {
 
    /**
     * 当月最大任务编号(含已逻辑删除,避免流水回退)。
     * 格式:前缀(2) + yyyyMM(6) + 4位 = 12位,如 TT2026090001 / TD2026090001。
     */
    @Select("SELECT MAX(task_no) FROM tms_task WHERE task_no LIKE CONCAT(#{prefix}, '%') AND LENGTH(task_no) = 12")
    String selectMaxTaskNo(@Param("prefix") String prefix);
}