|
|
@@ -1,10 +1,12 @@
|
|
|
package thyyxxk.webserver.dao.his.dictionary;
|
|
|
|
|
|
+import org.apache.ibatis.annotations.Delete;
|
|
|
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.ibatis.annotations.Update;
|
|
|
+import thyyxxk.webserver.entity.yp.YpZdClass;
|
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
@@ -127,4 +129,94 @@ public interface BedDeptDictDao {
|
|
|
" #{airConditionFee}, #{heatColdFlag}, #{sex}, #{type}, #{specialCharge}, #{chargeCodeBed}, #{chargeCodeAir}) ")
|
|
|
int saveBedForDeptAndBedNo(Map<String, Object> bedInfo);
|
|
|
|
|
|
+ @Select(" select * from zy_adtward where ward_code = #{wardCode} and dept_code = #{deptCode} ")
|
|
|
+ Map<String, Object> selectRoomDeptByCode(@Param("wardCode") String wardCode, @Param("deptCode") String deptCode);
|
|
|
+
|
|
|
+ @Update("<script>" +
|
|
|
+ "update zy_adtward " +
|
|
|
+ "<trim prefix=\"set\" suffixOverrides=\",\">" +
|
|
|
+ "<if test=\"wardCode != null and wardCode != '' \">" +
|
|
|
+ "ward_code = #{wardCode}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"wardName != null and wardName != '' \">" +
|
|
|
+ "ward_name = #{wardName}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"deptCode != null and deptCode != '' \">" +
|
|
|
+ "dept_code = #{deptCode}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"deptName != null and deptName != '' \">" +
|
|
|
+ "dept_name = #{deptName}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"wardPyCode != null and wardPyCode != '' \">" +
|
|
|
+ "ward_py_code = #{wardPyCode}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"wardDCode != null and wardDCode != '' \">" +
|
|
|
+ "ward_d_code = #{wardDCode}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"deptPyCode != null and deptPyCode != '' \">" +
|
|
|
+ "dept_py_code = #{deptPyCode}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"deptDCode != null and deptDCode != '' \">" +
|
|
|
+ "dept_d_code = #{deptDCode}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"openbedNum != null and openbedNum != '' \">" +
|
|
|
+ "openbed_num = #{openbedNum}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"oweLimit != null and oweLimit != '' \">" +
|
|
|
+ "owe_limit = #{oweLimit}, " +
|
|
|
+ "</if>" +
|
|
|
+ "</trim>" +
|
|
|
+ "where ward_code = #{wardCode} and dept_code = #{deptCode} " +
|
|
|
+ "</script>")
|
|
|
+ int updateRoomDeptByCode(Map<String, Object> roomDept);
|
|
|
+
|
|
|
+ @Insert(" insert into zy_adtward(ward_code, dept_code, openbed_num, ward_name, dept_name, " +
|
|
|
+ " ward_py_code, ward_d_code, dept_py_code, dept_d_code, owe_limit) " +
|
|
|
+ " values (#{wardCode}, #{deptCode}, #{openbedNum}, #{wardName}, #{deptName}, " +
|
|
|
+ " #{wardPyCode}, #{wardDCode}, #{deptPyCode}, #{deptDCode}, #{oweLimit})")
|
|
|
+ int insertRoomDept(Map<String, Object> roomDept);
|
|
|
+
|
|
|
+ @Delete(" delete from zy_adtward where ward_code = #{wardCode} and dept_code = #{deptCode} ")
|
|
|
+ int deleteRoomDeptByCode(@Param("wardCode") String wardCode, @Param("deptCode") String deptCode);
|
|
|
+
|
|
|
+ @Select("select ad2.dept_code as deptCode, ad1.ward_code as wardCode, " +
|
|
|
+ " ad2.dept_name as deptName, ad1.ward_name as wardName, " +
|
|
|
+ " ad2.dept_py_code as deptPyCode, ad1.ward_py_code as wardPyCode, " +
|
|
|
+ " ad2.dept_d_code as deptDCode, ad1.ward_d_code as wardDCode, " +
|
|
|
+ " al.dept, al.small_dept as smallDept, al.dept_id as deptId " +
|
|
|
+ " from zd_dept_all as al " +
|
|
|
+ " inner join zy_adtward as ad1 on ad1.ward_code = al.dept " +
|
|
|
+ " inner join zy_adtward as ad2 on ad2.ward_code = al.small_dept " +
|
|
|
+ " where (ad1.dept_py_code like '${text}%' or ad1.ward_py_code like '${text}%' " +
|
|
|
+ " or ad1.dept_d_code like '${text}%' or ad1.ward_d_code like '${text}%' " +
|
|
|
+ " or ad1.dept_code like '${text}%' or ad1.ward_code like '${text}%' " +
|
|
|
+ " or ad1.dept_name like '${text}%' or ad1.ward_name like '${text}%') ")
|
|
|
+ List<Map<String, Object>> selectSmallDept(@Param("text") String text);
|
|
|
+
|
|
|
+ @Select(" select * from zd_dept_all where dept_id = #{deptId} ")
|
|
|
+ Map<String, Object> selectSmallDeptByCode(@Param("deptId") String deptId);
|
|
|
+
|
|
|
+ @Update("<script>" +
|
|
|
+ "update zd_dept_all " +
|
|
|
+ "<trim prefix=\"set\" suffixOverrides=\",\">" +
|
|
|
+ "<if test=\"dept != null and dept != '' \">" +
|
|
|
+ "dept = #{dept}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"smallDept != null and smallDept != '' \">" +
|
|
|
+ "small_dept = #{smallDept}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"deptId != null and deptId != '' \">" +
|
|
|
+ "dept_id = #{deptId}, " +
|
|
|
+ "</if>" +
|
|
|
+ "</trim>" +
|
|
|
+ "where dept_id = #{deptId} " +
|
|
|
+ "</script>")
|
|
|
+ int updateSmallDeptByCode(Map<String, Object> smallMap);
|
|
|
+
|
|
|
+ @Insert(" insert into zd_dept_all(dept, small_dept) values (#{dept}, #{smallDept})")
|
|
|
+ int insertSmallDept(Map<String, Object> smallMap);
|
|
|
+
|
|
|
+ @Delete(" delete from zd_dept_all where dept_id = #{deptId} ")
|
|
|
+ int deleteSmallDeptByCode(@Param("deptId") String deptId);
|
|
|
+
|
|
|
}
|