Browse Source

feat: [模板管理] 编号修改

master
memorylkf 3 months ago
parent
commit
a7cc4702be
3 changed files with 3 additions and 3 deletions
  1. +1
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SnGenMapper.java
  2. +1
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SnGenServiceImpl.java
  3. +1
    -1
      hxhq-modules/hxhq-system/src/main/resources/mapper/business/SnGenMapper.xml

+ 1
- 1
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SnGenMapper.java View File

@ -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);
}

+ 1
- 1
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SnGenServiceImpl.java View File

@ -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);

+ 1
- 1
hxhq-modules/hxhq-system/src/main/resources/mapper/business/SnGenMapper.xml View File

@ -4,6 +4,6 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hxhq.business.mapper.SnGenMapper">
<update id="addSn">
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'
</update>
</mapper>

Loading…
Cancel
Save