|
@@ -1,7 +1,10 @@
|
|
|
package thyyxxk.webserver.dao.his.datamodify;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
-import org.apache.ibatis.annotations.*;
|
|
|
+import org.apache.ibatis.annotations.Delete;
|
|
|
+import org.apache.ibatis.annotations.Param;
|
|
|
+import org.apache.ibatis.annotations.Select;
|
|
|
+import org.apache.ibatis.annotations.Update;
|
|
|
import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
|
|
|
import thyyxxk.webserver.entity.datamodify.InOrOutOfWarehousePojo;
|
|
|
import thyyxxk.webserver.entity.datamodify.YpInDetl;
|
|
@@ -17,7 +20,6 @@ import java.util.List;
|
|
|
* @author xc
|
|
|
* @date 2021-06-01 14:06
|
|
|
*/
|
|
|
-@Mapper
|
|
|
public interface InOrOutOfWarehouseDao {
|
|
|
|
|
|
/**
|
|
@@ -32,7 +34,7 @@ public interface InOrOutOfWarehouseDao {
|
|
|
"manu_code_name = (select name from yp_zd_manufactory where code = manu_code)," +
|
|
|
"purchaser_name = (select name from a_employee_mi where code = purchaser)," +
|
|
|
"charge_code_name = (select name from yp_zd_dict where " +
|
|
|
- " serial = yp_in_detl.serial and code = charge_code),* " +
|
|
|
+ "serial = yp_in_detl.serial and code = charge_code),* " +
|
|
|
"from yp_in_detl where 1=1 " +
|
|
|
"<if test=\"param.startTime!=null and param.startTime!=''\">" +
|
|
|
"and in_date >= #{param.startTime} and in_date<=#{param.endTime} " +
|
|
@@ -41,8 +43,8 @@ public interface InOrOutOfWarehouseDao {
|
|
|
"and in_docu_no=#{param.inDocuNo}" +
|
|
|
"</if>" +
|
|
|
"</script>")
|
|
|
- List<YpInDetl> queryRuKuXinXi(IPage<InOrOutOfWarehousePojo> page, @Param("param") InOrOutOfWarehousePojo param);
|
|
|
-
|
|
|
+ List<YpInDetl> queryRuKuXinXi(IPage<InOrOutOfWarehousePojo> page,
|
|
|
+ @Param("param") InOrOutOfWarehousePojo param);
|
|
|
|
|
|
/**
|
|
|
* 根据不同拼音码 和 不同的表格来查询数据
|
|
@@ -51,15 +53,19 @@ public interface InOrOutOfWarehouseDao {
|
|
|
* @param pyCode 拼音码
|
|
|
* @return 返回多个 code 和 name
|
|
|
*/
|
|
|
- @Select("select code,rtrim(name)name from ${tableName} where py_code like #{pyCode} and isnull(del_flag,0)=0")
|
|
|
+ @Select("<script>" +
|
|
|
+ "select code,rtrim(name)name from ${tableName} where py_code like #{pyCode} and isnull(del_flag,0)=0" +
|
|
|
+ "<if test=\"tableName == 'a_employee_mi'\">" +
|
|
|
+ "and dept_code = '2060000' " +
|
|
|
+ "</if>" +
|
|
|
+ "</script>")
|
|
|
List<GetDropdownBox> queryCode(@Param("tableName") String tableName,
|
|
|
@Param("pyCode") String pyCode);
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 更新 入库信息
|
|
|
*
|
|
|
- * @param param 要更新的字段
|
|
|
+ * @param param 要更新的字段 以及条件
|
|
|
*/
|
|
|
@Update("update yp_in_detl set in_docu_no=#{inDocuNo},supply_code=#{supplyCode},rept_no=#{reptNo}, " +
|
|
|
"purchaser=#{purchaser},fp_no=#{fpNo},manu_no=#{manuNo},manu_code=#{manuCode}," +
|
|
@@ -69,7 +75,6 @@ public interface InOrOutOfWarehouseDao {
|
|
|
"where in_docu_no = #{oldInDocuNo} and charge_code = #{chargeCode} and in_seri=#{inSeri}")
|
|
|
void xiuGiRuKuXinXi(YpInDetl param);
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 根据入库单号 或者 入库时间 来查询数据
|
|
|
*
|
|
@@ -90,18 +95,17 @@ public interface InOrOutOfWarehouseDao {
|
|
|
"and out_date >= #{param.startTime} and out_date<=#{param.endTime} " +
|
|
|
"</if>" +
|
|
|
"<if test=\"param.drawNo!=null and param.drawNo!=''\">" +
|
|
|
- "and draw_no=#{param.drawNo}" +
|
|
|
+ "and draw_no=#{param.drawNo} " +
|
|
|
"</if>" +
|
|
|
"<if test=\"param.inDrawNo!=null and param.inDrawNo!=''\">" +
|
|
|
- "and in_draw_no=#{param.inDrawNo}" +
|
|
|
+ "and in_draw_no=#{param.inDrawNo} " +
|
|
|
"</if>" +
|
|
|
"<if test=\"param.chargeCode!=null and param.chargeCode!=''\">" +
|
|
|
- "and charge_code=#{param.chargeCode}" +
|
|
|
+ "and charge_code=#{param.chargeCode} " +
|
|
|
"</if>" +
|
|
|
"</script>")
|
|
|
List<YpOutDetl> queryChuKuXinXi(IPage<InOrOutOfWarehousePojo> page, @Param("param") InOrOutOfWarehousePojo param);
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 获取到科室的code
|
|
|
*
|
|
@@ -115,7 +119,7 @@ public interface InOrOutOfWarehouseDao {
|
|
|
*
|
|
|
* @return 返回code name
|
|
|
*/
|
|
|
- @Select("select group_no code,rtrim(group_name) name from yp_zd_group_name")
|
|
|
+ @Select("select group_no code,rtrim(group_name) name from yp_zd_group_name ")
|
|
|
List<GetDropdownBox> queryGroupNo();
|
|
|
|
|
|
/**
|
|
@@ -123,22 +127,33 @@ public interface InOrOutOfWarehouseDao {
|
|
|
*
|
|
|
* @param param 要更新的字段
|
|
|
*/
|
|
|
- @Update("update yp_out_detl set draw_no=#{drawNo},out_seri=#{outSeri},in_draw_no=#{inDrawNo}, " +
|
|
|
- "in_date=#{inDate},group_no=#{groupNo}," +
|
|
|
- "out_amt=#{outAmt},manu_no=#{manuNo}," +
|
|
|
- "group_no_out=#{groupNoOut},dept_code=#{deptCode},out_date=#{outDate}, " +
|
|
|
- "sys_date=#{outDate}, " +
|
|
|
- "confirm_date=#{confirmDate} " +
|
|
|
- "where out_seri=#{oldOutSeri} and draw_no=#{oldDrawNo} and charge_code = #{chargeCode}")
|
|
|
+ @Update("UPDATE yp_out_detl SET draw_no=#{drawNo}, " +
|
|
|
+ "out_seri=#{outSeri}, " +
|
|
|
+ "in_draw_no=#{inDrawNo}, " +
|
|
|
+ "in_date=#{inDate}, " +
|
|
|
+ "group_no=#{groupNo}, " +
|
|
|
+ "out_amt=#{outAmt}, " +
|
|
|
+ "manu_no=#{manuNo}, " +
|
|
|
+ "group_no_out=#{groupNoOut}, " +
|
|
|
+ "dept_code=#{deptCode}, " +
|
|
|
+ "out_date=#{outDate}, " +
|
|
|
+ "sys_date=#{outDate}, " +
|
|
|
+ "confirm_date=#{confirmDate} " +
|
|
|
+ "WHERE out_seri=#{oldOutSeri} " +
|
|
|
+ "AND draw_no=#{oldDrawNo} " +
|
|
|
+ "AND charge_code = #{chargeCode}")
|
|
|
void xiuGaiChuKu(YpOutDetl param);
|
|
|
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 在修改出库信息的时候要同步修改 药库的信息
|
|
|
+ *
|
|
|
+ * @param param 修改的参数 以及 查询到的条件
|
|
|
+ */
|
|
|
@Update("update yp_in_detl_yf set " +
|
|
|
"manu_no=#{manuNo},buy_amt = #{outAmt},group_no=#{groupNoOut} " +
|
|
|
"where charge_code = #{chargeCode} and out_draw_no = #{oldDrawNo} and in_seri = #{oldOutSeri}")
|
|
|
void xiuGaiYaoFangRuKuXinXi(YpOutDetl param);
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 删除出库的一条记录
|
|
|
*
|
|
@@ -153,15 +168,21 @@ public interface InOrOutOfWarehouseDao {
|
|
|
"and in_draw_no=#{inDrawNo}" +
|
|
|
"</if> " +
|
|
|
"</script>")
|
|
|
- void shanChuChuKuXinXin(@Param("drawNo") String drawNo,
|
|
|
- @Param("chargeCode") String chargeCode,
|
|
|
- @Param("outSeri") Integer outSeri,
|
|
|
- @Param("inDrawNo") String inDrawNo);
|
|
|
+ Integer shanChuChuKuXinXin(@Param("drawNo") String drawNo,
|
|
|
+ @Param("chargeCode") String chargeCode,
|
|
|
+ @Param("outSeri") Integer outSeri,
|
|
|
+ @Param("inDrawNo") String inDrawNo);
|
|
|
|
|
|
+ /**
|
|
|
+ * 在删除出库信息的时候也要同步删除 药库的信息
|
|
|
+ *
|
|
|
+ * @param outDrawNo 出库单号
|
|
|
+ * @param chargeCode 药品编码
|
|
|
+ * @param inSeri 序号
|
|
|
+ * @return 返回收到影响的行数 用来判断是否真的删除成功了
|
|
|
+ */
|
|
|
@Delete("delete from yp_in_detl_yf where out_draw_no=#{outDrawNo} and charge_code=#{chargeCode} and in_seri=#{inSeri}")
|
|
|
Integer shanChuYaoFangShuJu(@Param("outDrawNo") String outDrawNo,
|
|
|
@Param("chargeCode") String chargeCode,
|
|
|
@Param("inSeri") Integer inSeri);
|
|
|
-
|
|
|
-
|
|
|
}
|