|
@@ -33,20 +33,18 @@ import java.util.Set;
|
|
|
*/
|
|
|
@Mapper
|
|
|
public interface PublicDao {
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 查询医嘱
|
|
|
*
|
|
|
* @return 返回医嘱号
|
|
|
*/
|
|
|
- @Select("select act_order_no from yz_sequence WITH (NOLOCK) ")
|
|
|
- float getActOrderNo();
|
|
|
+ @Select("select cast(act_order_no as decimal(14)) as act_order_no from yz_sequence WITH (TABLOCKX)")
|
|
|
+ BigDecimal getActOrderNo();
|
|
|
|
|
|
/**
|
|
|
* @return 获取模板的自增id
|
|
|
*/
|
|
|
- @Select("select pattern_code from yz_sequence")
|
|
|
+ @Select("select pattern_code from yz_sequence WITH (TABLOCKX) ")
|
|
|
Integer getPatternCode();
|
|
|
|
|
|
/**
|
|
@@ -55,14 +53,14 @@ public interface PublicDao {
|
|
|
@Update("update yz_sequence set pattern_code = #{newId} where pattern_code = #{oldId} ")
|
|
|
int updatePatternCode(Integer newId, Integer oldId);
|
|
|
|
|
|
- @Select("select p_act_order_no from yz_sequence")
|
|
|
- float getPatternOrderCode();
|
|
|
+ @Select("select cast(p_act_order_no as decimal(9)) from yz_sequence WITH (TABLOCKX)")
|
|
|
+ BigDecimal getPatternOrderCode();
|
|
|
|
|
|
/**
|
|
|
* @param pActOrderNo 返回新的模板编码
|
|
|
*/
|
|
|
@Update("update yz_sequence set p_act_order_no = #{newId} where p_act_order_no = #{oldId} ")
|
|
|
- int updatePatternOrderCode(float newId, float oldId);
|
|
|
+ int updatePatternOrderCode(BigDecimal newId, BigDecimal oldId);
|
|
|
|
|
|
/**
|
|
|
* 插入新的医嘱
|
|
@@ -70,16 +68,16 @@ public interface PublicDao {
|
|
|
* @param actOrderNo 医嘱号
|
|
|
*/
|
|
|
@Update("update yz_sequence set act_order_no = #{newOrderNo} where act_order_no = #{oldOrderNo} ")
|
|
|
- int updateActOrderNo(float newOrderNo, float oldOrderNo);
|
|
|
+ int updateActOrderNo(BigDecimal newOrderNo, BigDecimal oldOrderNo);
|
|
|
|
|
|
|
|
|
- @Select("select req_no from ysh_config ")
|
|
|
+ @Select("select req_no from ysh_config WITH (TABLOCKX) ")
|
|
|
Integer getReqNo();
|
|
|
|
|
|
@Update("update ysh_config set req_no =#{newId} where req_no = #{oldId} ")
|
|
|
int updateReqNo(Integer newId, Integer oldId);
|
|
|
|
|
|
- @Select("select yj_template_no from ysh_config")
|
|
|
+ @Select("select yj_template_no from ysh_config WITH (TABLOCKX) ")
|
|
|
Integer tempNo();
|
|
|
|
|
|
@Update("update ysh_config set yj_template_no = #{newId} where yj_template_no = #{oldId} ")
|
|
@@ -94,17 +92,7 @@ public interface PublicDao {
|
|
|
@Select("select code,case when parent_code = code then null else parent_code end as parent_code from zd_unit_code where (parent_code = #{deptCode} or code = #{deptCode}) and isnull(del_flag,0) = 0")
|
|
|
List<GetDropdownBox> getKeShiLieBiao(String deptCode);
|
|
|
|
|
|
- @Select("<script>" +
|
|
|
- "select code from zd_unit_code where (parent_code in " +
|
|
|
- "<foreach collection='deptCodeList' item='item' index='index' open='(' close=')' separator=','>" +
|
|
|
- " #{item,jdbcType = CHAR}" +
|
|
|
- "</foreach> " +
|
|
|
- "or code in " +
|
|
|
- "<foreach collection='deptCodeList' item='item' index='index' open='(' close=')' separator=','>" +
|
|
|
- "#{item,jdbcType = CHAR}" +
|
|
|
- "</foreach>" +
|
|
|
- ") and isnull(del_flag,0) = 0" +
|
|
|
- "</script>")
|
|
|
+ @Select("<script>" + "select code from zd_unit_code where (parent_code in " + "<foreach collection='deptCodeList' item='item' index='index' open='(' close=')' separator=','>" + " #{item,jdbcType = CHAR}" + "</foreach> " + "or code in " + "<foreach collection='deptCodeList' item='item' index='index' open='(' close=')' separator=','>" + "#{item,jdbcType = CHAR}" + "</foreach>" + ") and isnull(del_flag,0) = 0" + "</script>")
|
|
|
List<String> getKeShiLieBiaoList(@Param("deptCodeList") List<String> deptCodeList);
|
|
|
|
|
|
/**
|
|
@@ -113,191 +101,84 @@ public interface PublicDao {
|
|
|
* @param code 人员代码
|
|
|
* @return 返回人员
|
|
|
*/
|
|
|
- @Select("<script>" +
|
|
|
- "select distinct rtrim(code) code,rtrim(name) name," +
|
|
|
- " dept_name = (select rtrim(name) from zd_unit_code where zd_unit_code.code = dept_code)," +
|
|
|
- " emp_tit_name = (select rtrim(name) from zd_emp_title where zd_emp_title.code = emp_tit_code)," +
|
|
|
- " rtrim(yb_code) as yb_code " +
|
|
|
- "from a_employee_mi where " +
|
|
|
- "(code like #{code} or name like #{code} or code_rs like #{code} or py_code like #{code}) " +
|
|
|
- "and isnull(del_flag,0) = 0 " +
|
|
|
- "<if test=\"deptCode != null and deptCode != '' \">" +
|
|
|
- "and dept_code = #{deptCode} " +
|
|
|
- "</if>" +
|
|
|
- "</script>")
|
|
|
+ @Select("<script>" + "select distinct rtrim(code) code,rtrim(name) name," + " dept_name = (select rtrim(name) from zd_unit_code where zd_unit_code.code = dept_code)," + " emp_tit_name = (select rtrim(name) from zd_emp_title where zd_emp_title.code = emp_tit_code)," + " rtrim(yb_code) as yb_code " + "from a_employee_mi where " + "(code like #{code} or name like #{code} or code_rs like #{code} or py_code like #{code}) " + "and isnull(del_flag,0) = 0 " + "<if test=\"deptCode != null and deptCode != '' \">" + "and dept_code = #{deptCode} " + "</if>" + "</script>")
|
|
|
List<GetDropdownBox> getRenYuan(String code, String deptCode);
|
|
|
|
|
|
/**
|
|
|
* @param pyCode 拼音编码
|
|
|
* @return 获取项目的名称和code
|
|
|
*/
|
|
|
- @Select("select distinct code,name from zd_charge_item where (py_code like #{pyCode} or code like #{pyCode} or name like #{pyCode})" +
|
|
|
- "union all " +
|
|
|
- "select distinct code,name from yp_zd_dict where (py_code like #{pyCode} or code like #{pyCode} or name like #{pyCode})")
|
|
|
+ @Select("select distinct code,name from zd_charge_item where (py_code like #{pyCode} or code like #{pyCode} or name like #{pyCode})" + "union all " + "select distinct code,name from yp_zd_dict where (py_code like #{pyCode} or code like #{pyCode} or name like #{pyCode})")
|
|
|
List<GetDropdownBox> getChargeCode(String pyCode);
|
|
|
|
|
|
- @Select("select distinct rtrim(code) + '_' + rtrim(serial) as code, name " +
|
|
|
- "from yp_zd_dict " +
|
|
|
- "where (code like #{name} or name like #{name} or py_code like #{name} or d_code like #{name})")
|
|
|
+ @Select("select distinct rtrim(code) + '_' + rtrim(serial) as code, name " + "from yp_zd_dict " + "where (code like #{name} or name like #{name} or py_code like #{name} or d_code like #{name})")
|
|
|
List<GetDropdownBox> getDrugInfo(String name);
|
|
|
|
|
|
@Select("select rtrim(code) code,rtrim(name) name from zd_unit_code where isnull(del_flag,0) = 0")
|
|
|
List<GetDropdownBox> getDept();
|
|
|
|
|
|
|
|
|
- @Select("select rtrim(code) code,rtrim(name) name from zd_unit_code with(nolock)" +
|
|
|
- "where isnull(del_flag,0) = 0 and code not like '8%' and " +
|
|
|
- "(py_code like #{pyCode} or name like #{pyCode} or code like #{pyCode})")
|
|
|
+ @Select("select rtrim(code) code,rtrim(name) name from zd_unit_code with(nolock)" + "where isnull(del_flag,0) = 0 and code not like '8%' and " + "(py_code like #{pyCode} or name like #{pyCode} or code like #{pyCode})")
|
|
|
List<GetDropdownBox> queryDept(String pyCode);
|
|
|
|
|
|
|
|
|
@Select("select isnull(max(ledger_sn),1) from zy_ledger_file where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes}")
|
|
|
- Integer getLedgerSn(@Param("inpatientNo") String inpatient,
|
|
|
- @Param("admissTimes") Integer admissTimes);
|
|
|
-
|
|
|
-
|
|
|
- @Select("select rtrim(inpatient_no) inpatient_no,admiss_times,admiss_date,dis_date,name, " +
|
|
|
- "responce_name = (select rtrim(name) name from zy_zd_responce_type where code = responce_type)," +
|
|
|
- "responce_type, " +
|
|
|
- "ward,ward_name = (select rtrim(name) name from zd_unit_code where code = ward), " +
|
|
|
- "ledger_sn = (select max(ledger_sn) from zy_ledger_file where a.inpatient_no = zy_ledger_file.inpatient_no and a.admiss_times = zy_ledger_file.admiss_times), " +
|
|
|
- "chu_yuan_yi_zhu = (case when (select count(1) from yz_act_order where inpatient_no= a.inpatient_no and admiss_times= a.admiss_times " +
|
|
|
- "and status_flag > '2' and isnull(group_no,'00' )='00' and order_code in ('06026','06053','05973')) > 0 " +
|
|
|
- "then 1 " +
|
|
|
- "when (select count(1) from yz_inact_order where inpatient_no= a.inpatient_no and admiss_times= a.admiss_times " +
|
|
|
- "and status_flag > '2' and isnull(group_no,'00' )='00' and order_code in ('06026','06053','05973')) > 0 " +
|
|
|
- "then 1 else 0 end ), " +
|
|
|
- "bed_no,total_charge,balance from zy_actpatient a where inpatient_no = #{inpatientNo} ")
|
|
|
+ Integer getLedgerSn(@Param("inpatientNo") String inpatient, @Param("admissTimes") Integer admissTimes);
|
|
|
+
|
|
|
+
|
|
|
+ @Select("select rtrim(inpatient_no) inpatient_no,admiss_times,admiss_date,dis_date,name, " + "responce_name = (select rtrim(name) name from zy_zd_responce_type where code = responce_type)," + "responce_type, " + "ward,ward_name = (select rtrim(name) name from zd_unit_code where code = ward), " + "ledger_sn = (select max(ledger_sn) from zy_ledger_file where a.inpatient_no = zy_ledger_file.inpatient_no and a.admiss_times = zy_ledger_file.admiss_times), " + "chu_yuan_yi_zhu = (case when (select count(1) from yz_act_order where inpatient_no= a.inpatient_no and admiss_times= a.admiss_times " + "and status_flag > '2' and isnull(group_no,'00' )='00' and order_code in ('06026','06053','05973')) > 0 " + "then 1 " + "when (select count(1) from yz_inact_order where inpatient_no= a.inpatient_no and admiss_times= a.admiss_times " + "and status_flag > '2' and isnull(group_no,'00' )='00' and order_code in ('06026','06053','05973')) > 0 " + "then 1 else 0 end ), " + "bed_no,total_charge,balance from zy_actpatient a where inpatient_no = #{inpatientNo} ")
|
|
|
ZyActpatient getHuanZheJiBenXinXi(@Param("inpatientNo") String inpatientNo);
|
|
|
|
|
|
- @Update("update zy_detail_charge set ori_detail_sn = null where inpatient_no = #{inpatientNo} " +
|
|
|
- "and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} and ori_detail_sn = -1 and charge_amount > 0")
|
|
|
- void chongZhiZhenLiuShui(@Param("inpatientNo") String inpatientNo,
|
|
|
- @Param("admissTimes") Integer admissTimes,
|
|
|
- @Param("ledgerSn") Integer ledgerSn);
|
|
|
-
|
|
|
- @Select("select ori_detail_sn from zy_detail_charge where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} " +
|
|
|
- "and ori_detail_sn is not null " +
|
|
|
- "and charge_amount < 0")
|
|
|
- List<Integer> huoQuTuiFeiYuanLiuShui(@Param("inpatientNo") String inpatientNo,
|
|
|
- @Param("admissTimes") Integer admissTimes,
|
|
|
- @Param("ledgerSn") Integer ledgerSn);
|
|
|
-
|
|
|
- @Update("<script>" +
|
|
|
- "update zy_detail_charge set ori_detail_sn = -1 where inpatient_no = '${inpatientNo}' and admiss_times = ${admissTimes} and ledger_sn = ${ledgerSn} " +
|
|
|
- "and charge_amount > 0 and detail_sn in " +
|
|
|
- "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
|
|
|
- "${item}" +
|
|
|
- "</foreach>" +
|
|
|
- "</script>")
|
|
|
- void genXingFuShuDuiYingZhenLiuShui(@Param("inpatientNo") String inpatientNo,
|
|
|
- @Param("admissTimes") Integer admissTimes,
|
|
|
- @Param("ledgerSn") Integer ledgerSn,
|
|
|
- @Param("list") List<Integer> detailSnList);
|
|
|
-
|
|
|
- @Select("select ori_detail_sn,sum(charge_fee) charge_fee,sum(charge_amount) charge_amount " +
|
|
|
- "from zy_detail_charge a " +
|
|
|
- "where inpatient_no=#{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} and order_no <> 6 and trans_flag_yb <> 2 " +
|
|
|
- " and ori_detail_sn is not null and charge_amount<0 " +
|
|
|
- "group by ori_detail_sn having count(1) > 1")
|
|
|
- List<ZyDetailCharge> chongFuTuiFeiLiuShui(@Param("inpatientNo") String inpatientNo,
|
|
|
- @Param("admissTimes") Integer admissTimes,
|
|
|
- @Param("ledgerSn") Integer ledgerSn);
|
|
|
-
|
|
|
-
|
|
|
- @Select("<script>" +
|
|
|
- "select detail_sn,charge_fee,charge_amount from zy_detail_charge where inpatient_no=#{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} " +
|
|
|
- "and detail_sn in " +
|
|
|
- "<foreach collection='oriSn' item='sn' open='(' close=')' separator=','>" +
|
|
|
- "#{sn}" +
|
|
|
- "</foreach>" +
|
|
|
- "</script>")
|
|
|
- List<ZyDetailCharge> getZhenShuLiuShui(@Param("inpatientNo") String inpatientNo,
|
|
|
- @Param("admissTimes") Integer admissTimes,
|
|
|
- @Param("ledgerSn") Integer ledgerSn,
|
|
|
- @Param("oriSn") Set<Integer> oriSn);
|
|
|
-
|
|
|
- @Update("<script>" +
|
|
|
- "<foreach collection='list' item='item' separator=';'>" +
|
|
|
- "update zy_detail_charge set ori_detail_sn = null where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} " +
|
|
|
- "and (detail_sn = #{item} or ori_detail_sn = #{item}) " +
|
|
|
- "</foreach>" +
|
|
|
- "</script>")
|
|
|
- void chongFuTuiFeiChongZhi(@Param("inpatientNo") String inpatientNo,
|
|
|
- @Param("admissTimes") Integer admissTimes,
|
|
|
- @Param("ledgerSn") Integer ledgerSn,
|
|
|
- @Param("list") List<Integer> oriDetailSn);
|
|
|
-
|
|
|
- @Select("select isnull(sum(charge_fee),0) from zy_detail_charge " +
|
|
|
- "where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} and trans_flag_yb=2")
|
|
|
- BigDecimal zhenFuXingDiFeiYong(@Param("inpatientNo") String inpatientNo,
|
|
|
- @Param("admissTimes") Integer admissTimes,
|
|
|
- @Param("ledgerSn") Integer ledgerSn);
|
|
|
-
|
|
|
- @Update("update zy_detail_charge set trans_flag_yb = 0 where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} and " +
|
|
|
- "trans_flag_yb = 2")
|
|
|
- void chongXingZhengFuXiangDi(@Param("inpatientNo") String inpatientNo,
|
|
|
- @Param("admissTimes") Integer admissTimes,
|
|
|
- @Param("ledgerSn") Integer ledgerSn);
|
|
|
-
|
|
|
- @Select("select detail_sn from zy_detail_charge where inpatient_no= #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} " +
|
|
|
- "and trans_flag_yb <> 2 and charge_amount > 0 and ori_detail_sn is not null")
|
|
|
- List<Integer> zhenShuLiuShui(@Param("inpatientNo") String inpatientNo,
|
|
|
- @Param("admissTimes") Integer admissTimes,
|
|
|
- @Param("ledgerSn") Integer ledgerSn);
|
|
|
-
|
|
|
- @Select("select ori_detail_sn from zy_detail_charge where inpatient_no= #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} " +
|
|
|
- "and trans_flag_yb <> 2 and charge_amount < 0 and ori_detail_sn is not null")
|
|
|
- List<Integer> fuShuLiuShui(@Param("inpatientNo") String inpatientNo,
|
|
|
- @Param("admissTimes") Integer admissTimes,
|
|
|
- @Param("ledgerSn") Integer ledgerSn);
|
|
|
-
|
|
|
- @Update("<script>" +
|
|
|
- "<foreach collection='list' item='item' separator=';'>" +
|
|
|
- "update zy_detail_charge set ori_detail_sn = null where inpatient_no= #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} " +
|
|
|
- "and charge_fee < 0 and ori_detail_sn = #{item}" +
|
|
|
- "</foreach>" +
|
|
|
- "</script> ")
|
|
|
- void chongZhiFuShuYuanLiuShui(@Param("inpatientNo") String inpatientNo,
|
|
|
- @Param("admissTimes") Integer admissTimes,
|
|
|
- @Param("ledgerSn") Integer ledgerSn,
|
|
|
- @Param("list") List<Integer> oriDetailSn);
|
|
|
-
|
|
|
- @Select("select top(1) code,dept_code,name,code_rs,rtrim(yb_code) yb_code" +
|
|
|
- " from a_employee_mi where (code = #{code} or code_rs = #{code}) and isnull(del_flag,0) = 0 ")
|
|
|
+ @Update("update zy_detail_charge set ori_detail_sn = null where inpatient_no = #{inpatientNo} " + "and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} and ori_detail_sn = -1 and charge_amount > 0")
|
|
|
+ void chongZhiZhenLiuShui(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes, @Param("ledgerSn") Integer ledgerSn);
|
|
|
+
|
|
|
+ @Select("select ori_detail_sn from zy_detail_charge where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} " + "and ori_detail_sn is not null " + "and charge_amount < 0")
|
|
|
+ List<Integer> huoQuTuiFeiYuanLiuShui(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes, @Param("ledgerSn") Integer ledgerSn);
|
|
|
+
|
|
|
+ @Update("<script>" + "update zy_detail_charge set ori_detail_sn = -1 where inpatient_no = '${inpatientNo}' and admiss_times = ${admissTimes} and ledger_sn = ${ledgerSn} " + "and charge_amount > 0 and detail_sn in " + "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" + "${item}" + "</foreach>" + "</script>")
|
|
|
+ void genXingFuShuDuiYingZhenLiuShui(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes, @Param("ledgerSn") Integer ledgerSn, @Param("list") List<Integer> detailSnList);
|
|
|
+
|
|
|
+ @Select("select ori_detail_sn,sum(charge_fee) charge_fee,sum(charge_amount) charge_amount " + "from zy_detail_charge a " + "where inpatient_no=#{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} and order_no <> 6 and trans_flag_yb <> 2 " + " and ori_detail_sn is not null and charge_amount<0 " + "group by ori_detail_sn having count(1) > 1")
|
|
|
+ List<ZyDetailCharge> chongFuTuiFeiLiuShui(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes, @Param("ledgerSn") Integer ledgerSn);
|
|
|
+
|
|
|
+
|
|
|
+ @Select("<script>" + "select detail_sn,charge_fee,charge_amount from zy_detail_charge where inpatient_no=#{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} " + "and detail_sn in " + "<foreach collection='oriSn' item='sn' open='(' close=')' separator=','>" + "#{sn}" + "</foreach>" + "</script>")
|
|
|
+ List<ZyDetailCharge> getZhenShuLiuShui(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes, @Param("ledgerSn") Integer ledgerSn, @Param("oriSn") Set<Integer> oriSn);
|
|
|
+
|
|
|
+ @Update("<script>" + "<foreach collection='list' item='item' separator=';'>" + "update zy_detail_charge set ori_detail_sn = null where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} " + "and (detail_sn = #{item} or ori_detail_sn = #{item}) " + "</foreach>" + "</script>")
|
|
|
+ void chongFuTuiFeiChongZhi(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes, @Param("ledgerSn") Integer ledgerSn, @Param("list") List<Integer> oriDetailSn);
|
|
|
+
|
|
|
+ @Select("select isnull(sum(charge_fee),0) from zy_detail_charge " + "where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} and trans_flag_yb=2")
|
|
|
+ BigDecimal zhenFuXingDiFeiYong(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes, @Param("ledgerSn") Integer ledgerSn);
|
|
|
+
|
|
|
+ @Update("update zy_detail_charge set trans_flag_yb = 0 where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} and " + "trans_flag_yb = 2")
|
|
|
+ void chongXingZhengFuXiangDi(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes, @Param("ledgerSn") Integer ledgerSn);
|
|
|
+
|
|
|
+ @Select("select detail_sn from zy_detail_charge where inpatient_no= #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} " + "and trans_flag_yb <> 2 and charge_amount > 0 and ori_detail_sn is not null")
|
|
|
+ List<Integer> zhenShuLiuShui(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes, @Param("ledgerSn") Integer ledgerSn);
|
|
|
+
|
|
|
+ @Select("select ori_detail_sn from zy_detail_charge where inpatient_no= #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} " + "and trans_flag_yb <> 2 and charge_amount < 0 and ori_detail_sn is not null")
|
|
|
+ List<Integer> fuShuLiuShui(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes, @Param("ledgerSn") Integer ledgerSn);
|
|
|
+
|
|
|
+ @Update("<script>" + "<foreach collection='list' item='item' separator=';'>" + "update zy_detail_charge set ori_detail_sn = null where inpatient_no= #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} " + "and charge_fee < 0 and ori_detail_sn = #{item}" + "</foreach>" + "</script> ")
|
|
|
+ void chongZhiFuShuYuanLiuShui(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes, @Param("ledgerSn") Integer ledgerSn, @Param("list") List<Integer> oriDetailSn);
|
|
|
+
|
|
|
+ @Select("select top(1) code,dept_code,name,code_rs,rtrim(yb_code) yb_code" + " from a_employee_mi where (code = #{code} or code_rs = #{code}) and isnull(del_flag,0) = 0 ")
|
|
|
UserInfo huoQuYuanGongBianMa(String code);
|
|
|
|
|
|
@Select("SELECT small_dept FROM zd_dept_all where dept = #{deptCode}")
|
|
|
List<String> bingFangSuoSuKeShi(String deptCode);
|
|
|
|
|
|
// 重置 流水号
|
|
|
- @Select("select row_number() over (order by charge_date ) row_index, " +
|
|
|
- " ledger_sn, " +
|
|
|
- " detail_sn " +
|
|
|
- "from zy_detail_charge " +
|
|
|
- "where inpatient_no = '${patNo}' " +
|
|
|
- " and admiss_times = ${times} ")
|
|
|
- List<ZyDetailCharge> huoQuZhongYeFeiYong(@Param("patNo") String patNo,
|
|
|
- @Param("times") Integer times);
|
|
|
-
|
|
|
- @Select("select count(1) " +
|
|
|
- "from zy_detail_charge " +
|
|
|
- "where inpatient_no = '${patNo}' " +
|
|
|
- " and admiss_times = ${times}")
|
|
|
- int maxDetailSn(@Param("patNo") String patNo,
|
|
|
- @Param("times") Integer times);
|
|
|
-
|
|
|
-
|
|
|
- @Update("<script>" +
|
|
|
- "<foreach collection='list' item='item' separator=';' index='index' >" +
|
|
|
- "update zy_detail_charge set detail_sn = ${item.rowIndex} + ${maxDetailSn} " +
|
|
|
- "where inpatient_no= '${patNo}' and admiss_times = ${times} and ledger_sn = ${item.ledgerSn} and detail_sn = ${item.detailSn}" +
|
|
|
- "</foreach>" +
|
|
|
- "</script>")
|
|
|
- void chongZhiLiuShui(@Param("patNo") String patNo,
|
|
|
- @Param("times") Integer times,
|
|
|
- @Param("list") List<ZyDetailCharge> list,
|
|
|
- @Param("maxDetailSn") int maxDetailSn);
|
|
|
+ @Select("select row_number() over (order by charge_date ) row_index, " + " ledger_sn, " + " detail_sn " + "from zy_detail_charge " + "where inpatient_no = '${patNo}' " + " and admiss_times = ${times} ")
|
|
|
+ List<ZyDetailCharge> huoQuZhongYeFeiYong(@Param("patNo") String patNo, @Param("times") Integer times);
|
|
|
+
|
|
|
+ @Select("select count(1) " + "from zy_detail_charge " + "where inpatient_no = '${patNo}' " + " and admiss_times = ${times}")
|
|
|
+ int maxDetailSn(@Param("patNo") String patNo, @Param("times") Integer times);
|
|
|
+
|
|
|
+
|
|
|
+ @Update("<script>" + "<foreach collection='list' item='item' separator=';' index='index' >" + "update zy_detail_charge set detail_sn = ${item.rowIndex} + ${maxDetailSn} " + "where inpatient_no= '${patNo}' and admiss_times = ${times} and ledger_sn = ${item.ledgerSn} and detail_sn = ${item.detailSn}" + "</foreach>" + "</script>")
|
|
|
+ void chongZhiLiuShui(@Param("patNo") String patNo, @Param("times") Integer times, @Param("list") List<ZyDetailCharge> list, @Param("maxDetailSn") int maxDetailSn);
|
|
|
|
|
|
|
|
|
@Select("select rtrim(code) code,rtrim(name) name from zd_anaesthesia")
|
|
@@ -321,66 +202,33 @@ public interface PublicDao {
|
|
|
@Update("update op_config set op_record_id =#{code} ")
|
|
|
void genXingShouShuXuHao(Integer code);
|
|
|
|
|
|
- @Select("select page_no from yz_sequence")
|
|
|
+ @Select("select page_no from yz_sequence WITH (TABLOCKX) ")
|
|
|
Integer caoYaoDanHao();
|
|
|
|
|
|
@Update("update yz_sequence set page_no = #{index} where page_no = #{oldId} ")
|
|
|
int genXingCaoYaoDanHao(Integer newId, Integer oldId);
|
|
|
|
|
|
- @Select("select top (1) cast(settle_type as int) as settle_type " +
|
|
|
- "from zy_ledger_file " +
|
|
|
- "where inpatient_no = #{patNo} " +
|
|
|
- " and admiss_times = #{times} " +
|
|
|
- "order by ledger_sn desc")
|
|
|
- Integer jieSuanXinXi(@Param("patNo") String patNo,
|
|
|
- @Param("times") Integer times);
|
|
|
-
|
|
|
- @Select("select * " +
|
|
|
- "from ysh_hz_record " +
|
|
|
- "where act_order_no = #{actOrder}")
|
|
|
+ @Select("select top (1) cast(settle_type as int) as settle_type " + "from zy_ledger_file " + "where inpatient_no = #{patNo} " + " and admiss_times = #{times} " + "order by ledger_sn desc")
|
|
|
+ Integer jieSuanXinXi(@Param("patNo") String patNo, @Param("times") Integer times);
|
|
|
+
|
|
|
+ @Select("select * " + "from ysh_hz_record " + "where act_order_no = #{actOrder}")
|
|
|
YshHzRecord huiZhen(BigDecimal actOrder);
|
|
|
|
|
|
- @Select("select * " +
|
|
|
- "from ysh_yj_req " +
|
|
|
- "where act_order_no = #{actOrder}")
|
|
|
+ @Select("select * " + "from ysh_yj_req " + "where act_order_no = #{actOrder}")
|
|
|
YshYjReq yiJi(BigDecimal actOrder);
|
|
|
|
|
|
- @Select("select * " +
|
|
|
- "from op_record " +
|
|
|
- "where act_order_no = #{actOrder}")
|
|
|
+ @Select("select * " + "from op_record " + "where act_order_no = #{actOrder}")
|
|
|
OpRecord shouShu(BigDecimal actOrder);
|
|
|
|
|
|
- @Select("select * " +
|
|
|
- "from yz_act_order_cy " +
|
|
|
- "where order_no = #{actOrder}")
|
|
|
+ @Select("select * " + "from yz_act_order_cy " + "where order_no = #{actOrder}")
|
|
|
YzActOrderCy caoYao(BigDecimal actOrder);
|
|
|
|
|
|
|
|
|
- @Select("select cast(rtrim(isnull(nullif(del_flag, ''), 0)) as int) del_flag," +
|
|
|
- "national_code,rtrim(code) + '-' + rtrim(serial) code,rtrim(name) name, rtrim(name) as zd_name,rtrim(code) zd_code,rtrim(serial) serial " +
|
|
|
- "from yp_zd_dict " +
|
|
|
- "${ew.customSqlSegment}")
|
|
|
+ @Select("select cast(rtrim(isnull(nullif(del_flag, ''), 0)) as int) del_flag," + "national_code,rtrim(code) + '-' + rtrim(serial) code,rtrim(name) name, rtrim(name) as zd_name,rtrim(code) zd_code,rtrim(serial) serial " + "from yp_zd_dict " + "${ew.customSqlSegment}")
|
|
|
List<YaoPinXiangMu> huoQuYaoPinPiPeiXinXi(@Param(Constants.WRAPPER) Wrapper<?> wp);
|
|
|
|
|
|
|
|
|
- @Select("<script>" +
|
|
|
- "select rtrim(a.order_code) code, " +
|
|
|
- " rtrim(a.order_name) name, " +
|
|
|
- " national_code, " +
|
|
|
- " rtrim(c.code) as zd_code," +
|
|
|
- " rtrim(c.name) as zd_name," +
|
|
|
- " cast(rtrim(isnull(nullif(c.del_flag, ''), 0)) as int) del_flag," +
|
|
|
- " serial = '00' " +
|
|
|
- "from yz_order_item a with (NOLOCK) , " +
|
|
|
- " yz_order_occurence b with (NOLOCK) , " +
|
|
|
- " zd_charge_item c with (NOLOCK)" +
|
|
|
- "where a.order_code in " +
|
|
|
- "<foreach collection='code' item='item' index='index' open='(' close=')' separator=','>" +
|
|
|
- "#{item}" +
|
|
|
- "</foreach>" +
|
|
|
- " and a.order_code = b.order_code " +
|
|
|
- " and b.occ_code = c.code" +
|
|
|
- "</script>")
|
|
|
+ @Select("<script>" + "select rtrim(a.order_code) code, " + " rtrim(a.order_name) name, " + " national_code, " + " rtrim(c.code) as zd_code," + " rtrim(c.name) as zd_name," + " cast(rtrim(isnull(nullif(c.del_flag, ''), 0)) as int) del_flag," + " serial = '00' " + "from yz_order_item a with (NOLOCK) , " + " yz_order_occurence b with (NOLOCK) , " + " zd_charge_item c with (NOLOCK)" + "where a.order_code in " + "<foreach collection='code' item='item' index='index' open='(' close=')' separator=','>" + "#{item}" + "</foreach>" + " and a.order_code = b.order_code " + " and b.occ_code = c.code" + "</script>")
|
|
|
List<YaoPinXiangMu> huoQuXiangMuXinXi(List<String> code);
|
|
|
|
|
|
|
|
@@ -390,11 +238,7 @@ public interface PublicDao {
|
|
|
* @param wardCode 科室编码
|
|
|
* @return 数据
|
|
|
*/
|
|
|
- @Select("select code " +
|
|
|
- "from a_employee_mi " +
|
|
|
- "where dept_code = #{wardCode} " +
|
|
|
- " and isnull(del_flag, 0) <> 1 " +
|
|
|
- " and emp_tit_code in ('010') ")
|
|
|
+ @Select("select code " + "from a_employee_mi " + "where dept_code = #{wardCode} " + " and isnull(del_flag, 0) <> 1 " + " and emp_tit_code in ('010') ")
|
|
|
List<String> huoQuHuanZheBingFangDeHuShi(String wardCode);
|
|
|
|
|
|
|
|
@@ -407,41 +251,19 @@ public interface PublicDao {
|
|
|
void chaRuTongZhiXinXi(@Param("list") List<SocketMessage> list);
|
|
|
|
|
|
|
|
|
- @Insert({"<script>" +
|
|
|
- "insert into t_socket_message_consumer (msg_id, sender, receiver) values " +
|
|
|
- "<foreach collection='list' item='item' separator=','>" +
|
|
|
- " (#{item.msgId}, #{item.sender}, #{item.receiver})" +
|
|
|
- "</foreach>" +
|
|
|
- "</script>"})
|
|
|
+ @Insert({"<script>" + "insert into t_socket_message_consumer (msg_id, sender, receiver) values " + "<foreach collection='list' item='item' separator=','>" + " (#{item.msgId}, #{item.sender}, #{item.receiver})" + "</foreach>" + "</script>"})
|
|
|
void chaRuJieShouShuJu(@Param("list") List<SocketMessage> list);
|
|
|
|
|
|
@Select("select rtrim(${id}) as code, rtrim(${name}) as name from ${table} where isnull(${pyColumn}, '')='' ")
|
|
|
- List<CodeName> originalList(@Param("table") String table,
|
|
|
- @Param("id") String id,
|
|
|
- @Param("name") String name,
|
|
|
- @Param("pyColumn") String pyColumn);
|
|
|
+ List<CodeName> originalList(@Param("table") String table, @Param("id") String id, @Param("name") String name, @Param("pyColumn") String pyColumn);
|
|
|
|
|
|
@Update("update ${table} set ${pyColumn}='${pyCode}' where ${idColumn}='${id}' ")
|
|
|
- void updatePycode(@Param("table") String table,
|
|
|
- @Param("idColumn") String idColumn,
|
|
|
- @Param("id") String id,
|
|
|
- @Param("pyColumn") String pyColumn,
|
|
|
- @Param("pyCode") String pyCode);
|
|
|
-
|
|
|
- @Select("select code, name " +
|
|
|
- "from zd_allergen " +
|
|
|
- "where (wb_code like #{name} or py_code like #{name} or name like #{name})")
|
|
|
+ void updatePycode(@Param("table") String table, @Param("idColumn") String idColumn, @Param("id") String id, @Param("pyColumn") String pyColumn, @Param("pyCode") String pyCode);
|
|
|
+
|
|
|
+ @Select("select code, name " + "from zd_allergen " + "where (wb_code like #{name} or py_code like #{name} or name like #{name})")
|
|
|
List<GetDropdownBox> getAllergens(@Param("name") String name);
|
|
|
|
|
|
- @Select("select allergen_code, (select name from zd_allergen where zd_allergen.code = allergen_code) as allergenName, id,type " +
|
|
|
- "from patient_allergen_info " +
|
|
|
- "where pat_no = #{patNo} " +
|
|
|
- " and type = 0 " +
|
|
|
- "union all " +
|
|
|
- "select allergen_code, (select name from yp_zd_dict b where rtrim(b.code) + '_' + rtrim(b.serial) = allergen_code) as allergenName, id,type " +
|
|
|
- "from patient_allergen_info " +
|
|
|
- "where pat_no = #{patNo} " +
|
|
|
- " and type = 1")
|
|
|
+ @Select("select allergen_code, (select name from zd_allergen where zd_allergen.code = allergen_code) as allergenName, id,type " + "from patient_allergen_info " + "where pat_no = #{patNo} " + " and type = 0 " + "union all " + "select allergen_code, (select name from yp_zd_dict b where rtrim(b.code) + '_' + rtrim(b.serial) = allergen_code) as allergenName, id,type " + "from patient_allergen_info " + "where pat_no = #{patNo} " + " and type = 1")
|
|
|
List<PatientAllergenInfo> getPatientAllergens(@Param("patNo") String patNo);
|
|
|
|
|
|
@Select("select count(1) from patient_allergen_info where pat_no = #{patNo}")
|
|
@@ -458,61 +280,34 @@ public interface PublicDao {
|
|
|
@Select("select * from bld_cat_code where (code = #{name} or name like #{name})")
|
|
|
List<GetDropdownBox> getBldCat(String name);
|
|
|
|
|
|
- @Select("SELECT distinct rtrim(a.dept_code) as dept_code, " +
|
|
|
- " rtrim(a.dept_name) as dept_name, " +
|
|
|
- " rtrim(a.ward_code) as ward_code, " +
|
|
|
- " rtrim(a.ward_name) as ward_name, " +
|
|
|
- " rtrim(b.small_dept) as small_code, " +
|
|
|
- " small_name = (select rtrim(name) name from zd_unit_code where code = small_dept) " +
|
|
|
- "FROM zy_adtward a, " +
|
|
|
- " zd_dept_all b " +
|
|
|
- "where a.ward_code = b.dept")
|
|
|
+ @Select("SELECT distinct rtrim(a.dept_code) as dept_code, " + " rtrim(a.dept_name) as dept_name, " + " rtrim(a.ward_code) as ward_code, " + " rtrim(a.ward_name) as ward_name, " + " rtrim(b.small_dept) as small_code, " + " small_name = (select rtrim(name) name from zd_unit_code where code = small_dept) " + "FROM zy_adtward a, " + " zd_dept_all b " + "where a.ward_code = b.dept")
|
|
|
List<ZkList> getTheTransferList();
|
|
|
|
|
|
@Select("select RTRIM(code) AS code,RTRIM(name) AS name from zd_emp_position where isnull(del_flag,0) = 0")
|
|
|
List<GetDropdownBox> getEmpPosition();
|
|
|
|
|
|
- @Select("select RTRIM(code) AS code,RTRIM(name) AS name " +
|
|
|
- "from zd_emp_inmark")
|
|
|
+ @Select("select RTRIM(code) AS code,RTRIM(name) AS name " + "from zd_emp_inmark")
|
|
|
List<GetDropdownBox> getEmpInmark();
|
|
|
|
|
|
- @Select("select RTRIM(code) AS code,RTRIM(name) AS name " +
|
|
|
- "from zd_ifcadre")
|
|
|
+ @Select("select RTRIM(code) AS code,RTRIM(name) AS name " + "from zd_ifcadre")
|
|
|
List<GetDropdownBox> getZdIfcadre();
|
|
|
|
|
|
- @Select("select RTRIM(code) AS code,RTRIM(name) AS name " +
|
|
|
- "from zd_emp_title " +
|
|
|
- "where isnull(del_flag, 0) = 0")
|
|
|
+ @Select("select RTRIM(code) AS code,RTRIM(name) AS name " + "from zd_emp_title " + "where isnull(del_flag, 0) = 0")
|
|
|
List<GetDropdownBox> getZdEmpTitle();
|
|
|
|
|
|
- @Select("select RTRIM(code) AS code,RTRIM(name) AS name " +
|
|
|
- "from mzy_zd_charge_type " +
|
|
|
- "where isnull(del_flag, 0) = 0")
|
|
|
+ @Select("select RTRIM(code) AS code,RTRIM(name) AS name " + "from mzy_zd_charge_type " + "where isnull(del_flag, 0) = 0")
|
|
|
List<GetDropdownBox> getMzyZdChargeType();
|
|
|
|
|
|
- @Update("update rs_config " +
|
|
|
- "set rs_code =rs_code")
|
|
|
+ @Update("update rs_config " + "set rs_code =rs_code")
|
|
|
void lockThePersonnelCodeTable();
|
|
|
|
|
|
- @Select("select rs_code + 1 " +
|
|
|
- "from rs_config")
|
|
|
+ @Select("select rs_code + 1 " + "from rs_config")
|
|
|
Integer getPersonnelCode();
|
|
|
|
|
|
- @Update("update rs_config " +
|
|
|
- "set rs_code = #{code}")
|
|
|
+ @Update("update rs_config " + "set rs_code = #{code}")
|
|
|
void updateStaffCodeTable(Integer code);
|
|
|
|
|
|
- @Select("SELECT rtrim(code_rs) as uid,\n" +
|
|
|
- " rtrim(name) as displayName,\n" +
|
|
|
- " manager = '', /*1 就是有审核权限*/\n" +
|
|
|
- " oldUid = '',\n" +
|
|
|
- " userPassword = '123456',\n" +
|
|
|
- " ou= '001',\n" +
|
|
|
- " _id = 'Emr.model.EmrUsers-' + cast(row_number() over (order by code ) + 2 as varchar),\n" +
|
|
|
- " phone_no as mobile\n" +
|
|
|
- "from a_employee_mi\n" +
|
|
|
- "where isnull(del_flag, 0) = 0\n" +
|
|
|
- " and (select role_id from dj_user_role where dj_user_role.user_code = a_employee_mi.code and role_id = 11) = 11")
|
|
|
+ @Select("SELECT rtrim(code_rs) as uid,\n" + " rtrim(name) as displayName,\n" + " manager = '', /*1 就是有审核权限*/\n" + " oldUid = '',\n" + " userPassword = '123456',\n" + " ou= '001',\n" + " _id = 'Emr.model.EmrUsers-' + cast(row_number() over (order by code ) + 2 as varchar),\n" + " phone_no as mobile\n" + "from a_employee_mi\n" + "where isnull(del_flag, 0) = 0\n" + " and (select role_id from dj_user_role where dj_user_role.user_code = a_employee_mi.code and role_id = 11) = 11")
|
|
|
List<Map<String, String>> emrAdd();
|
|
|
|
|
|
@Select("SELECT rtrim(dept_code) code ,rtrim(dept_name) name FROM zy_adtward WHERE PATINDEX('8%',ward_code)=0 ")
|