diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SnGenMapper.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SnGenMapper.java index b7ed4c3..593f12b 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SnGenMapper.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SnGenMapper.java @@ -16,5 +16,5 @@ public interface SnGenMapper extends BaseMapper * 递增id * @param date */ - void addSn(@Param("date") String date); + void addSn(@Param("date") String date,@Param("type") Integer type); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SnGenServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SnGenServiceImpl.java index 1883f46..88398be 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SnGenServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SnGenServiceImpl.java @@ -46,7 +46,7 @@ public class SnGenServiceImpl extends ServiceImpl implements snGen.setType(type); save(snGen); }else{ - baseMapper.addSn(date); + baseMapper.addSn(date,type); sort = getOne(queryWrapper,false).getSn(); } return date+"-"+String.format("%04d", sort); diff --git a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/SnGenMapper.xml b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/SnGenMapper.xml index ea7975e..67d8f76 100644 --- a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/SnGenMapper.xml +++ b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/SnGenMapper.xml @@ -4,6 +4,6 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - update t_sn_gen set sn = sn+1 where `date`=#{date} and del_flag='0' + update t_sn_gen set sn = sn+1 where `date`=#{date} and `type`=#{type} and del_flag='0' \ No newline at end of file