zjh
2025-06-05 2c19fa65dc87ea8f3d81f84154f4eeabff7f8d00
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package com.ltkj.hosp.mapper;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.poi.ss.formula.functions.T;
 
@Mapper
public interface OrderNumberMapper extends BaseMapper<T> {
    @Select("SELECT max(last_id) FROM order_number WHERE date_key = #{dateKey} and fl=#{fl}")
    Integer getLastId(@Param("dateKey") String dateKey,@Param("fl") String fl);
 
    @Insert("INSERT INTO order_number(date_key, last_id,fl) VALUES(#{dateKey}, #{lastId},#{fl}) ON DUPLICATE KEY UPDATE last_id = #{lastId}")
    void updateLastId(@Param("dateKey") String dateKey, @Param("lastId") int lastId,@Param("fl") String fl);
}