|
@@ -1,16 +1,54 @@
|
|
|
package thyyxxk.webserver.dao.his.examinations;
|
|
|
|
|
|
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
|
-import org.apache.ibatis.annotations.Mapper;
|
|
|
-import org.apache.ibatis.annotations.Select;
|
|
|
-import thyyxxk.webserver.entity.examinations.MixLabelPrinter;
|
|
|
+import org.apache.ibatis.annotations.*;
|
|
|
+import thyyxxk.webserver.entity.examinations.mixlabel.MixLabel;
|
|
|
+import thyyxxk.webserver.entity.examinations.mixlabel.MixLabelRange;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
|
|
|
@Mapper
|
|
|
-public interface MixLabelPrintDao extends BaseMapper<MixLabelPrinter> {
|
|
|
+public interface MixLabelPrintDao {
|
|
|
+
|
|
|
+ @Update("create table dbo.${table} (label varchar(32) not null constraint ${table}_pk primary key, " +
|
|
|
+ "status tinyint default 0 not null, reprint tinyint default 0 not null, " +
|
|
|
+ "print_staff varchar(12), print_datetime datetime, " +
|
|
|
+ "reprint_staff varchar(12), reprint_datetime datetime);" +
|
|
|
+ "exec sp_addextendedproperty 'MS_Description', '核酸混采标签打印', 'SCHEMA', 'dbo', 'TABLE', '${table}';" +
|
|
|
+ "exec sp_addextendedproperty 'MS_Description', '标签编号', 'SCHEMA', 'dbo', 'TABLE', '${table}', 'COLUMN', 'label';" +
|
|
|
+ "exec sp_addextendedproperty 'MS_Description', '状态:0-未打印,1-已打印', 'SCHEMA', 'dbo', 'TABLE', '${table}', 'COLUMN', 'status';" +
|
|
|
+ "exec sp_addextendedproperty 'MS_Description', '是否重复打印过:0-否,1-是', 'SCHEMA', 'dbo', 'TABLE', '${table}', 'COLUMN', 'reprint';" +
|
|
|
+ "exec sp_addextendedproperty 'MS_Description', '打印操作人', 'SCHEMA', 'dbo', 'TABLE', '${table}', 'COLUMN', 'print_staff';" +
|
|
|
+ "exec sp_addextendedproperty 'MS_Description', '打印时间', 'SCHEMA', 'dbo', 'TABLE', '${table}', 'COLUMN', 'print_datetime';" +
|
|
|
+ "exec sp_addextendedproperty 'MS_Description', '重复打印操作人', 'SCHEMA', 'dbo', 'TABLE', '${table}', 'COLUMN', 'reprint_staff';" +
|
|
|
+ "exec sp_addextendedproperty 'MS_Description', '重复打印操作时间', 'SCHEMA', 'dbo', 'TABLE', '${table}', 'COLUMN', 'reprint_datetime';")
|
|
|
+ void createTable(@Param("table") String table);
|
|
|
+
|
|
|
+ @Insert("insert into ${table} (label,status,reprint) values (#{label},0,0)")
|
|
|
+ void insertNewLabel(@Param("table") String table, @Param("label") String label);
|
|
|
+
|
|
|
+ @Insert("insert into t_mix_label_ranges(table_name, min_label, max_label, prefix, slice_index, end_number) values " +
|
|
|
+ "(#{tableName},#{minLabel},#{maxLabel},#{prefix},#{sliceIndex},#{endNumber})")
|
|
|
+ void insertNewLabelRange(MixLabelRange labelRange);
|
|
|
+
|
|
|
+ @Select("select * from t_mix_label_ranges")
|
|
|
+ List<MixLabelRange> selectLabelRanges();
|
|
|
+
|
|
|
+ @Select("select top 1 label from ${table} where status=0 order by label")
|
|
|
+ String selectMinUnprintedLabel(@Param("table") String table);
|
|
|
+
|
|
|
+ @Select("select * from ${table} where label=#{label}")
|
|
|
+ MixLabel selectSingleLabel(@Param("table") String table, @Param("label") String label);
|
|
|
+
|
|
|
+ @Update("update ${tableName} set status=1,print_staff=#{printStaff},print_datetime=#{printDatetime} where label=#{label}")
|
|
|
+ void updatePrinted(MixLabel printer);
|
|
|
+
|
|
|
+ @Update("update ${tableName} set reprint=1,reprint_staff=#{reprintStaff}, " +
|
|
|
+ "reprint_datetime=#{reprintDatetime} where label=#{label}")
|
|
|
+ void updateReprinted(MixLabel printer);
|
|
|
|
|
|
- @Select("select min(label) + ' - ' + max(label) from t_mix_label_printer")
|
|
|
- String selectMaxLabelRange();
|
|
|
+ @Select("select count(1) from ${table} where status=0")
|
|
|
+ Integer selectNotPrintedCount(@Param("table") String table);
|
|
|
|
|
|
- @Select("select top 1 label from t_mix_label_printer where status=0 order by label")
|
|
|
- String selectMinUnprintedLabel();
|
|
|
+ @Update("update t_mix_label_ranges set finish_flag=1 where table_name=#{tableName}")
|
|
|
+ void updateAllPrinted(@Param("table") String table);
|
|
|
}
|