zhaowenxuan
2024-07-19 c4962d4a0cb4089bcffda90b07da34d666e4bbc2
ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjOrderDetailMapper.java
@@ -55,6 +55,11 @@
     */
    public int deleteTjOrderDetailByOrderDetailId(String orderDetailId);
    @Delete("    delete\n" +
            "        from tj_order_detail\n" +
            "        where order_id = #{orderId}")
    int deleteTjOrderDetailByOrderId(String orderId);
    /**
     * 批量删除体检项目明细
     *
@@ -68,14 +73,14 @@
     * 查询已缴费项目
     */
    @Select("SELECT * FROM tj_project p WHERE p.pro_parent_id =0 AND p.pro_id IN (\n" +
            "  SELECT a.pro_id FROM tj_order_detail a WHERE !ISNULL(flowing_water_id) AND order_id=#{orderId})")
            "  SELECT a.pro_id FROM tj_order_detail a WHERE !ISNULL(flowing_water_id) AND order_id=#{orderId} and a.deleted=0 )")
    public List<TjProject> selectTjOrderDetailListByFlowingWaterIdIsNotNull(String orderId);
    /**
     * 查询未缴费项目
     */
    @Select("SELECT * FROM tj_project p WHERE p.pro_parent_id =0 AND p.pro_id IN (\n" +
            "  SELECT a.pro_id FROM tj_order_detail a WHERE ISNULL(flowing_water_id) AND order_id=#{orderId})")
            "  SELECT a.pro_id FROM tj_order_detail a WHERE ISNULL(flowing_water_id) AND order_id=#{orderId} and a.deleted=0 )")
    public List<TjProject> selectTjOrderDetailListByFlowingWaterIdIsNull(String orderId);
@@ -114,12 +119,33 @@
            "  create_id,\n" +
            "  pro_type) \n" +
            "  \n" +
            "  SELECT #{orderId},a.pro_id,IFNULL(b.pro_default,''),'0',SYSDATE(),#{userName},b.is_sampling,#{userId},IFNULL(a.pac_id,0) FROM tb_transition a LEFT JOIN tj_project b ON a.pro_id=b.pro_id  WHERE a.cus_id=#{cusId} and b.need_report='Y' \n" +
            "  SELECT #{orderId},a.pro_id,IFNULL(b.pro_default,''),'0',SYSDATE(),#{userName},b.is_sampling,#{userId},IFNULL(a.pac_id,0) FROM tb_transition a LEFT JOIN tj_project b ON a.pro_id=b.pro_id  WHERE a.cus_id=#{cusId} \n" +
            "\t\t\n" +
            "\tUNION\n" +
            "  \n" +
            "\tSELECT #{orderId},a.parent_pro_id,IFNULL(b.pro_default,''),'0',SYSDATE(),#{userName},b.is_sampling,#{userId},IFNULL(a.pac_id,0) FROM tb_transition a LEFT JOIN tj_project b ON a.parent_pro_id=b.pro_id  WHERE a.cus_id=#{cusId} and b.need_report='Y' GROUP BY a.parent_pro_id")
            "\tSELECT #{orderId},a.parent_pro_id,IFNULL(b.pro_default,''),'0',SYSDATE(),#{userName},b.is_sampling,#{userId},IFNULL(a.pac_id,0) FROM tb_transition a LEFT JOIN tj_project b ON a.parent_pro_id=b.pro_id  WHERE a.cus_id=#{cusId}  GROUP BY a.parent_pro_id")
     boolean saveTjOrderDetailsByCusId(@Param("cusId")String cusId,@Param("orderId")String orderId,@Param("userName")String userName,@Param("userId") String userId);
    @Insert("\tINSERT INTO tj_order_detail(\n" +
//            "\torder_detail_id,\n" +
            "  order_id,\n" +
            "  pro_id,\n" +
            "  pro_result,\n" +
            "  tj_status,\n" +
            "  create_time,\n" +
            "  create_by,\n" +
            "  is_sampling,\n" +
            "  create_id,\n" +
            "  pro_type) \n" +
            "  \n" +
            "  SELECT #{orderId},a.pro_id,IFNULL(b.pro_default,''),'1',SYSDATE(),#{userName},b.is_sampling,#{userId},IFNULL(a.pac_id,0) FROM tb_transition a LEFT JOIN tj_project b ON a.pro_id=b.pro_id  WHERE a.cus_id=#{cusId} \n" +
            "\t\t\n" +
            "\tUNION\n" +
            "  \n" +
            "\tSELECT #{orderId},a.parent_pro_id,IFNULL(b.pro_default,''),'0',SYSDATE(),#{userName},b.is_sampling,#{userId},IFNULL(a.pac_id,0) FROM tb_transition a LEFT JOIN tj_project b ON a.parent_pro_id=b.pro_id  WHERE a.cus_id=#{cusId}  GROUP BY a.parent_pro_id")
    boolean saveJSYTjOrderDetailsByCusId(@Param("cusId")String cusId,@Param("orderId")String orderId,@Param("userName")String userName,@Param("userId") String userId);
    @Insert("INSERT INTO tj_pure_tone_test (\n" +
@@ -154,8 +180,18 @@
            "(select pro_id from tj_project where pro_parent_id=#{proParentId})")
    public List<TjOrderDetail> getDetailByOrderIdAndParId(@Param("orderId")Long orderId,@Param("proParentId")Long proParentId);
    public List<TjOrderDetail> getDetailByOrderIdAndParIds(@Param("orderId")Long orderId,@Param("proParentIds")List<Long> proParentIds);
    @Select("call pro_lis_sqdbgd(1,#{tjnumber,mode=IN})")
//    @Select("select * from test_detail")
    List<TjOrderDetail> addHuaYanTable(@Param("tjnumber") String tjnumber);
    @Select("call pro_checkhyAndcg(1,#{tjnumber,mode=IN})")
    List<TjOrderDetail> addHuaYanAndCgTable(String tjnumber);
    @Delete("delete\n" +
            " from tj_order_detail\n" +
            " where jxbz = #{jxbz}")
    void deleteTjOrderDetailByjxbz(String jxbz);
}