zjh
2024-05-30 1bbfc22504bb180aa381ba6c2f7451b8e386cca2
ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TbTransitionMapper.java
@@ -69,6 +69,14 @@
    public boolean deletedTbTransitionByCusId(String cusId);
    @Delete("DELETE  FROM tb_transition WHERE tj_num=#{tjNum}")
    public boolean deletedTbTransitionByTjNum(String tjNum);
    @Update("UPDATE tb_transition a SET "+
            "a.tj_num=null" +
            " WHERE a.tj_num=#{tjNum}")
    boolean updateTbTransitionByTjNum(String tjNum);
    @Select("SELECT * FROM tb_transition WHERE cus_id=#{cusId} AND pac_id=#{pacId}")
    public List<TbTransition> getTbTransitionListByCusIdAndPac(@Param("cusId") String cusId,@Param("pacId") String pacId);
@@ -100,7 +108,7 @@
    @Update("UPDATE tb_transition a SET \n" +
            "a.ord_price=a.now_price,\n" +
            "a.now_price=a.ord_price*#{discount}," +
            "a.now_price=a.ord_price*(#{discount}/10)," +
            "a.tj_num=#{tjNum}"+
            " WHERE a.cus_id=#{cusId} ")
    boolean updateTbTransitionPriceByCusId(@Param("cusId")String cusId,@Param("discount")BigDecimal discount,@Param("tjNum")String tjNum);
@@ -128,8 +136,8 @@
            "\tc.pro_name,\n" +
            "\tb.pro_id,\n" +
            "\tb.pro_name,\n" +
            "\tTRUNCATE(c.pro_price * (TRUNCATE ( a.price_now / b.pro_price, 5 )),2),\n" +
            "\tTRUNCATE(c.pro_price * (TRUNCATE ( a.price_now / b.pro_price, 5 )),2),\n" +
            "\tTRUNCATE(c.pro_price,2),\n" +
            " IFNULL(TRUNCATE(c.pro_price * (TRUNCATE ( a.price_now / b.pro_price, 5 )),2),0), " +
            "\tSYSDATE(),\n" +
            "\tc.pro_check_method,\n" +
            "\tIFNULL(c.pro_type,'')\n" +
@@ -209,6 +217,9 @@
            "WHERE a.cus_id=#{cusId}) AND b.parent_pro_id=#{proId})  ")
    BigDecimal getTbTransitionDxPriceAndOrdPrice(@Param("cusId")String cusId,@Param("proId")Long proId);
    @Select("SELECT DISTINCT a.pac_id FROM tb_transition a WHERE a.tj_num=#{tjNum}")
    String selectPacIdByTbTransitionTjNumAndProId(@Param("tjNum")String tjNum);
    @Select("SELECT DISTINCT a.pac_id FROM tb_transition a WHERE a.tj_num=#{tjNum}AND a.card_id=#{cardId} AND !ISNULL(a.pac_id)")
    String selectPacIdByTbTransitionTjNumAndProId(@Param("tjNum")String tjNum,@Param("cardId")String cardId);
    @Select("SELECT SUM(a.now_price) FROM tb_transition a WHERE a.cus_id=#{cusId} AND a.parent_pro_id=#{proId} and a.card_id=#{cardId} and a.pac_id=#{pacId}")
    BigDecimal getTbTransitionDxPriceByPac(@Param("cusId")String cusId,@Param("proId")Long proId,@Param("cardId")String cardId,@Param("pacId")Long pacId);
}