zjh
2023-12-06 41f99a843fb2c0424426e006f29c1e78192eae01
ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjOrderDetailMapper.java
@@ -118,11 +118,11 @@
            "  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} \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}")
            "\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);
@@ -133,4 +133,13 @@
            "a.update_id=#{userId}\n" +
            "WHERE a.order_id=#{orderId}")
    boolean updateTjOrderDetailsByOrderId(@Param("orderId")String orderId,@Param("userName")String userName,@Param("userId") String userId,@Param("ls")String ls);
    @Select("SELECT *\n" +
            "FROM `tj_order_detail` \n" +
            "where order_id=#{orderId}\n" +
            "and pro_id IN\n" +
            "(select pro_id from tj_project where pro_parent_id=#{proParentId})")
    public List<TjOrderDetail> getDetailByOrderIdAndParId(@Param("orderId")Long orderId,@Param("proParentId")Long proParentId);
}